From 735a8268a8cac444dff2e02b4443f30028f01379 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:52:19 -0600 Subject: [PATCH] refactor: adapt code to get ready for adding logging (#2914) - fix some deprecation warnings - have bodys return as the type they, a bytes.Buffer - add new handle to return a bytes.Buffer instead of Reader --- .../v1/abusiveexperiencereport-gen.go | 15 +- .../v1/acceleratedmobilepageurl-gen.go | 10 +- accessapproval/v1/accessapproval-gen.go | 92 +- .../v1/accesscontextmanager-gen.go | 130 +- acmedns/v1/acmedns-gen.go | 13 +- addressvalidation/v1/addressvalidation-gen.go | 13 +- .../v2beta1/adexchangebuyer2-gen.go | 245 +- .../v1/adexperiencereport-gen.go | 15 +- admin/datatransfer/v1/admin-gen.go | 24 +- admin/directory/v1/admin-gen.go | 415 ++-- admin/reports/v1/admin-gen.go | 33 +- admob/v1/admob-gen.go | 25 +- admob/v1beta/admob-gen.go | 64 +- adsense/v2/adsense-gen.go | 106 +- adsensehost/v4.1/adsensehost-gen.go | 95 +- .../v1/advisorynotifications-gen.go | 33 +- aiplatform/v1/aiplatform-gen.go | 1820 +++++---------- aiplatform/v1beta1/aiplatform-gen.go | 2060 ++++++----------- airquality/v1/airquality-gen.go | 25 +- alertcenter/v1beta1/alertcenter-gen.go | 42 +- alloydb/v1/alloydb-gen.go | 121 +- alloydb/v1alpha/alloydb-gen.go | 121 +- alloydb/v1beta/alloydb-gen.go | 121 +- analytics/v3/analytics-gen.go | 287 +-- analyticsadmin/v1alpha/analyticsadmin-gen.go | 491 ++-- analyticsadmin/v1beta/analyticsadmin-gen.go | 176 +- analyticsdata/v1beta/analyticsdata-gen.go | 40 +- analyticshub/v1/analyticshub-gen.go | 93 +- analyticshub/v1beta1/analyticshub-gen.go | 63 +- .../v4/analyticsreporting-gen.go | 15 +- .../v1/androiddeviceprovisioning-gen.go | 92 +- androidenterprise/v1/androidenterprise-gen.go | 265 +-- androidmanagement/v1/androidmanagement-gen.go | 110 +- androidpublisher/v3/androidpublisher-gen.go | 431 ++-- apigateway/v1/apigateway-gen.go | 97 +- apigateway/v1beta/apigateway-gen.go | 97 +- apigee/v1/apigee-gen.go | 986 +++----- apigeeregistry/v1/apigeeregistry-gen.go | 310 +-- apikeys/v2/apikeys-gen.go | 38 +- apim/v1alpha/apim-gen.go | 73 +- appengine/v1/appengine-gen.go | 135 +- appengine/v1alpha/appengine-gen.go | 69 +- appengine/v1beta/appengine-gen.go | 147 +- apphub/v1/apphub-gen.go | 115 +- apphub/v1alpha/apphub-gen.go | 121 +- area120tables/v1alpha1/area120tables-gen.go | 45 +- artifactregistry/v1/artifactregistry-gen.go | 246 +- .../v1beta1/artifactregistry-gen.go | 79 +- .../v1beta2/artifactregistry-gen.go | 119 +- assuredworkloads/v1/assuredworkloads-gen.go | 49 +- .../v1beta1/assuredworkloads-gen.go | 55 +- .../v1/authorizedbuyersmarketplace-gen.go | 126 +- backupdr/v1/backupdr-gen.go | 136 +- baremetalsolution/v2/baremetalsolution-gen.go | 163 +- batch/v1/batch-gen.go | 46 +- beyondcorp/v1/beyondcorp-gen.go | 213 +- beyondcorp/v1alpha/beyondcorp-gen.go | 369 +-- biglake/v1/biglake-gen.go | 52 +- bigquery/v2/bigquery-gen.go | 152 +- .../v1/bigqueryconnection-gen.go | 31 +- .../v1beta1/bigqueryconnection-gen.go | 34 +- .../v1/bigquerydatapolicy-gen.go | 34 +- .../v1/bigquerydatatransfer-gen.go | 106 +- .../v1/bigqueryreservation-gen.go | 73 +- bigtableadmin/v2/bigtableadmin-gen.go | 174 +- billingbudgets/v1/billingbudgets-gen.go | 22 +- billingbudgets/v1beta1/billingbudgets-gen.go | 22 +- .../v1/binaryauthorization-gen.go | 72 +- .../v1beta1/binaryauthorization-gen.go | 54 +- .../v1/blockchainnodeengine-gen.go | 40 +- blogger/v2/blogger-gen.go | 42 +- blogger/v3/blogger-gen.go | 120 +- books/v1/books-gen.go | 184 +- .../v1/businessprofileperformance-gen.go | 16 +- calendar/v3/calendar-gen.go | 132 +- .../v1/certificatemanager-gen.go | 115 +- chat/v1/chat-gen.go | 112 +- checks/v1alpha/checks-gen.go | 64 +- chromemanagement/v1/chromemanagement-gen.go | 91 +- chromepolicy/v1/chromepolicy-gen.go | 59 +- chromeuxreport/v1/chromeuxreport-gen.go | 13 +- civicinfo/v2/civicinfo-gen.go | 29 +- classroom/v1/classroom-gen.go | 298 +-- cloudasset/v1/cloudasset-gen.go | 89 +- cloudasset/v1beta1/cloudasset-gen.go | 35 +- cloudasset/v1p1beta1/cloudasset-gen.go | 15 +- cloudasset/v1p5beta1/cloudasset-gen.go | 10 +- cloudasset/v1p7beta1/cloudasset-gen.go | 15 +- cloudbilling/v1/cloudbilling-gen.go | 67 +- cloudbilling/v1beta/cloudbilling-gen.go | 67 +- cloudbuild/v1/cloudbuild-gen.go | 210 +- cloudbuild/v2/cloudbuild-gen.go | 73 +- cloudchannel/v1/cloudchannel-gen.go | 208 +- .../v1/cloudcontrolspartner-gen.go | 46 +- .../v1beta/cloudcontrolspartner-gen.go | 46 +- clouddeploy/v1/clouddeploy-gen.go | 184 +- .../v1beta1/clouderrorreporting-gen.go | 40 +- cloudfunctions/v1/cloudfunctions-gen.go | 51 +- cloudfunctions/v2/cloudfunctions-gen.go | 64 +- cloudfunctions/v2alpha/cloudfunctions-gen.go | 64 +- cloudfunctions/v2beta/cloudfunctions-gen.go | 64 +- cloudidentity/v1/cloudidentity-gen.go | 191 +- cloudidentity/v1beta1/cloudidentity-gen.go | 196 +- cloudkms/v1/cloudkms-gen.go | 186 +- cloudprofiler/v2/cloudprofiler-gen.go | 19 +- .../v1/cloudresourcemanager-gen.go | 129 +- .../v1beta1/cloudresourcemanager-gen.go | 57 +- .../v2/cloudresourcemanager-gen.go | 45 +- .../v2beta1/cloudresourcemanager-gen.go | 45 +- .../v3/cloudresourcemanager-gen.go | 194 +- cloudscheduler/v1/cloudscheduler-gen.go | 51 +- cloudscheduler/v1beta1/cloudscheduler-gen.go | 37 +- cloudsearch/v1/cloudsearch-gen.go | 179 +- cloudshell/v1/cloudshell-gen.go | 36 +- cloudsupport/v2/cloudsupport-gen.go | 58 +- cloudsupport/v2beta/cloudsupport-gen.go | 61 +- cloudtasks/v2/cloudtasks-gen.go | 70 +- cloudtasks/v2beta2/cloudtasks-gen.go | 87 +- cloudtasks/v2beta3/cloudtasks-gen.go | 70 +- cloudtrace/v1/cloudtrace-gen.go | 16 +- cloudtrace/v2/cloudtrace-gen.go | 13 +- cloudtrace/v2beta1/cloudtrace-gen.go | 22 +- composer/v1/composer-gen.go | 91 +- composer/v1beta1/composer-gen.go | 94 +- compute/v0.alpha/compute-gen.go | 37 +- compute/v0.alpha/compute2-gen.go | 1612 +++++-------- compute/v0.alpha/compute3-gen.go | 1363 ++++------- compute/v0.beta/compute-gen.go | 37 +- compute/v0.beta/compute2-gen.go | 1462 ++++-------- compute/v0.beta/compute3-gen.go | 1225 ++++------ compute/v1/compute-gen.go | 37 +- compute/v1/compute2-gen.go | 1276 ++++------ compute/v1/compute3-gen.go | 1096 +++------ config/v1/config-gen.go | 103 +- connectors/v1/connectors-gen.go | 220 +- connectors/v2/connectors-gen.go | 58 +- .../v1alpha1/contactcenteraiplatform-gen.go | 43 +- .../v1/contactcenterinsights-gen.go | 244 +- container/v1/container-gen.go | 202 +- container/v1beta1/container-gen.go | 217 +- containeranalysis/v1/containeranalysis-gen.go | 139 +- .../v1alpha1/containeranalysis-gen.go | 108 +- .../v1beta1/containeranalysis-gen.go | 145 +- content/v2.1/content-gen.go | 442 ++-- contentwarehouse/v1/contentwarehouse-gen.go | 115 +- css/v1/css-gen.go | 40 +- customsearch/v1/customsearch-gen.go | 13 +- datacatalog/v1/datacatalog-gen.go | 226 +- datacatalog/v1beta1/datacatalog-gen.go | 176 +- dataflow/v1b3/dataflow-gen.go | 130 +- dataform/v1beta1/dataform-gen.go | 193 +- datafusion/v1/datafusion-gen.go | 64 +- datafusion/v1beta1/datafusion-gen.go | 82 +- datalabeling/v1beta1/datalabeling-gen.go | 148 +- datamigration/v1/datamigration-gen.go | 208 +- datamigration/v1beta1/datamigration-gen.go | 94 +- datapipelines/v1/datapipelines-gen.go | 31 +- dataplex/v1/dataplex-gen.go | 528 ++--- dataportability/v1/dataportability-gen.go | 23 +- dataportability/v1beta/dataportability-gen.go | 23 +- dataproc/v1/dataproc-gen.go | 394 ++-- datastore/v1/datastore-gen.go | 61 +- datastore/v1beta1/datastore-gen.go | 13 +- datastore/v1beta3/datastore-gen.go | 31 +- datastream/v1/datastream-gen.go | 103 +- datastream/v1alpha1/datastream-gen.go | 100 +- .../v0.alpha/deploymentmanager-gen.go | 118 +- deploymentmanager/v2/deploymentmanager-gen.go | 69 +- .../v2beta/deploymentmanager-gen.go | 115 +- developerconnect/v1/developerconnect-gen.go | 76 +- dfareporting/v3.5/dfareporting-gen.go | 18 +- dfareporting/v4/dfareporting-gen.go | 678 ++---- dialogflow/v2/dialogflow-gen.go | 793 +++---- dialogflow/v2beta1/dialogflow-gen.go | 745 ++---- dialogflow/v3/dialogflow-gen.go | 400 ++-- dialogflow/v3beta1/dialogflow-gen.go | 469 ++-- digitalassetlinks/v1/digitalassetlinks-gen.go | 15 +- discovery/v1/discovery-gen.go | 13 +- discoveryengine/v1/discoveryengine-gen.go | 580 ++--- .../v1alpha/discoveryengine-gen.go | 754 ++---- discoveryengine/v1beta/discoveryengine-gen.go | 679 ++---- displayvideo/v2/displayvideo-gen.go | 540 ++--- displayvideo/v3/displayvideo-gen.go | 534 ++--- dlp/v2/dlp-gen.go | 442 ++-- dns/v1/dns-gen.go | 143 +- dns/v1beta2/dns-gen.go | 143 +- docs/v1/docs-gen.go | 16 +- documentai/v1/documentai-gen.go | 102 +- documentai/v1beta2/documentai-gen.go | 25 +- documentai/v1beta3/documentai-gen.go | 118 +- domains/v1/domains-gen.go | 91 +- domains/v1alpha2/domains-gen.go | 91 +- domains/v1beta1/domains-gen.go | 91 +- domainsrdap/v1/domainsrdap-gen.go | 47 +- .../v2/doubleclickbidmanager-gen.go | 28 +- doubleclicksearch/v2/doubleclicksearch-gen.go | 44 +- drive/v2/drive-gen.go | 271 +-- drive/v3/drive-gen.go | 223 +- driveactivity/v2/driveactivity-gen.go | 10 +- drivelabels/v2/drivelabels-gen.go | 86 +- drivelabels/v2beta/drivelabels-gen.go | 86 +- essentialcontacts/v1/essentialcontacts-gen.go | 74 +- eventarc/v1/eventarc-gen.go | 205 +- factchecktools/v1alpha1/factchecktools-gen.go | 30 +- fcm/v1/fcm-gen.go | 10 +- fcmdata/v1beta1/fcmdata-gen.go | 10 +- file/v1/file-gen.go | 79 +- file/v1beta1/file-gen.go | 94 +- firebase/v1beta1/firebase-gen.go | 122 +- firebaseappcheck/v1/firebaseappcheck-gen.go | 158 +- .../v1beta/firebaseappcheck-gen.go | 173 +- .../v1/firebaseappdistribution-gen.go | 95 +- .../v1alpha/firebaseappdistribution-gen.go | 69 +- .../v1beta/firebasedatabase-gen.go | 28 +- .../v1/firebasedynamiclinks-gen.go | 26 +- firebasehosting/v1/firebasehosting-gen.go | 24 +- .../v1beta1/firebasehosting-gen.go | 207 +- firebaseml/v1/firebaseml-gen.go | 16 +- firebaseml/v1beta2/firebaseml-gen.go | 28 +- firebaseml/v2beta/firebaseml-gen.go | 16 +- firebaserules/v1/firebaserules-gen.go | 40 +- firebasestorage/v1beta/firebasestorage-gen.go | 28 +- firestore/v1/firestore-gen.go | 148 +- firestore/v1beta1/firestore-gen.go | 76 +- firestore/v1beta2/firestore-gen.go | 34 +- fitness/v1/fitness-gen.go | 46 +- forms/v1/forms-gen.go | 34 +- games/v1/games-gen.go | 148 +- .../v1configuration/gamesconfiguration-gen.go | 39 +- .../v1management/gamesmanagement-gen.go | 69 +- gkebackup/v1/gkebackup-gen.go | 154 +- gkehub/v1/gkehub-gen.go | 189 +- gkehub/v1alpha/gkehub-gen.go | 201 +- gkehub/v1beta/gkehub-gen.go | 189 +- gkehub/v1beta1/gkehub-gen.go | 58 +- gkehub/v2alpha/gkehub-gen.go | 37 +- gkeonprem/v1/gkeonprem-gen.go | 244 +- gmail/v1/gmail-gen.go | 292 +-- .../v1/gmailpostmastertools-gen.go | 19 +- .../v1beta1/gmailpostmastertools-gen.go | 19 +- go.work.sum | 2 + google-api-go-generator/gen.go | 45 +- google-api-go-generator/gen_test.go | 1 + google-api-go-generator/testdata/any.want | 52 +- .../testdata/arrayofarray-1.want | 5 +- .../testdata/arrayofenum.want | 5 +- .../testdata/arrayofmapofobjects.want | 5 +- .../testdata/arrayofmapofstrings.want | 5 +- .../testdata/blogger-3.want | 114 +- google-api-go-generator/testdata/floats.want | 5 +- .../testdata/getwithoutbody.want | 10 +- .../testdata/http-body.want | 17 +- .../testdata/json-body.want | 97 +- .../testdata/mapofany.want | 5 +- .../testdata/mapofarrayofobjects.want | 10 +- .../testdata/mapofint64strings.want | 5 +- .../testdata/mapofobjects.want | 5 +- .../testdata/mapofstrings-1.want | 10 +- .../testdata/mapprotostruct.want | 10 +- .../testdata/mediaupload.json | 226 ++ .../testdata/mediaupload.want | 415 ++++ .../testdata/param-rename.want | 15 +- .../testdata/quotednum.want | 5 +- .../testdata/repeated.want | 10 +- .../testdata/required-query.want | 10 +- .../testdata/resource-named-service.want | 64 +- .../testdata/unfortunatedefaults.want | 5 +- .../testdata/variants.want | 5 +- .../testdata/wrapnewlines.want | 5 +- googleapi/googleapi.go | 10 + groupsmigration/v1/groupsmigration-gen.go | 18 +- groupssettings/v1/groupssettings-gen.go | 16 +- healthcare/v1/healthcare-gen.go | 480 ++-- healthcare/v1beta1/healthcare-gen.go | 573 ++--- homegraph/v1/homegraph-gen.go | 24 +- iam/v1/iam-gen.go | 314 +-- iam/v2/iam-gen.go | 25 +- iam/v2beta/iam-gen.go | 25 +- iamcredentials/v1/iamcredentials-gen.go | 22 +- iap/v1/iap-gen.go | 66 +- iap/v1beta1/iap-gen.go | 16 +- identitytoolkit/v1/identitytoolkit-gen.go | 134 +- identitytoolkit/v2/identitytoolkit-gen.go | 163 +- identitytoolkit/v3/identitytoolkit-gen.go | 67 +- ids/v1/ids-gen.go | 49 +- indexing/v3/indexing-gen.go | 13 +- internal/gensupport/media.go | 3 + jobs/v3/jobs-gen.go | 52 +- jobs/v3p1beta1/jobs-gen.go | 55 +- jobs/v4/jobs-gen.go | 76 +- keep/v1/keep-gen.go | 30 +- kgsearch/v1/kgsearch-gen.go | 10 +- kmsinventory/v1/kmsinventory-gen.go | 18 +- language/v1/language-gen.go | 28 +- language/v1beta2/language-gen.go | 28 +- language/v2/language-gen.go | 22 +- libraryagent/v1/libraryagent-gen.go | 25 +- licensing/v1/licensing-gen.go | 28 +- lifesciences/v2beta/lifesciences-gen.go | 25 +- localservices/v1/localservices-gen.go | 15 +- logging/v2/logging-gen.go | 789 +++---- looker/v1/looker-gen.go | 67 +- managedidentities/v1/managedidentities-gen.go | 142 +- .../v1alpha1/managedidentities-gen.go | 142 +- .../v1beta1/managedidentities-gen.go | 142 +- manufacturers/v1/manufacturers-gen.go | 31 +- .../v1alpha/marketingplatformadmin-gen.go | 22 +- meet/v2/meet-gen.go | 57 +- memcache/v1/memcache-gen.go | 52 +- memcache/v1beta2/memcache-gen.go | 55 +- .../accounts_v1beta/merchantapi-gen.go | 135 +- .../conversions_v1beta/merchantapi-gen.go | 25 +- .../datasources_v1beta/merchantapi-gen.go | 28 +- .../inventories_v1beta/merchantapi-gen.go | 25 +- merchantapi/lfp_v1beta/merchantapi-gen.go | 25 +- .../notifications_v1beta/merchantapi-gen.go | 22 +- .../products_v1beta/merchantapi-gen.go | 19 +- .../promotions_v1beta/merchantapi-gen.go | 16 +- merchantapi/quota_v1beta/merchantapi-gen.go | 10 +- merchantapi/reports_v1beta/merchantapi-gen.go | 10 +- metastore/v1/metastore-gen.go | 151 +- metastore/v1alpha/metastore-gen.go | 163 +- metastore/v1beta/metastore-gen.go | 163 +- migrationcenter/v1/migrationcenter-gen.go | 187 +- .../v1alpha1/migrationcenter-gen.go | 208 +- ml/v1/ml-gen.go | 145 +- monitoring/v1/monitoring-gen.go | 62 +- monitoring/v3/monitoring-gen.go | 177 +- .../v1/mybusinessaccountmanagement-gen.go | 57 +- .../v1/mybusinessbusinessinformation-gen.go | 62 +- mybusinesslodging/v1/mybusinesslodging-gen.go | 16 +- .../v1/mybusinessnotifications-gen.go | 13 +- .../v1/mybusinessplaceactions-gen.go | 27 +- mybusinessqanda/v1/mybusinessqanda-gen.go | 28 +- .../v1/mybusinessverifications-gen.go | 22 +- .../v1/networkconnectivity-gen.go | 244 +- .../v1alpha1/networkconnectivity-gen.go | 97 +- networkmanagement/v1/networkmanagement-gen.go | 52 +- .../v1beta1/networkmanagement-gen.go | 67 +- networksecurity/v1/networksecurity-gen.go | 318 +-- .../v1beta1/networksecurity-gen.go | 438 ++-- networkservices/v1/networkservices-gen.go | 268 +-- .../v1beta1/networkservices-gen.go | 241 +- notebooks/v1/notebooks-gen.go | 193 +- notebooks/v2/notebooks-gen.go | 85 +- oauth2/v2/oauth2-gen.go | 16 +- ondemandscanning/v1/ondemandscanning-gen.go | 28 +- .../v1beta1/ondemandscanning-gen.go | 28 +- orgpolicy/v2/orgpolicy-gen.go | 89 +- osconfig/v1/osconfig-gen.go | 91 +- osconfig/v1alpha/osconfig-gen.go | 55 +- osconfig/v1beta/osconfig-gen.go | 61 +- oslogin/v1/oslogin-gen.go | 28 +- oslogin/v1alpha/oslogin-gen.go | 34 +- oslogin/v1beta/oslogin-gen.go | 34 +- pagespeedonline/v5/pagespeedonline-gen.go | 10 +- .../v1/paymentsresellersubscription-gen.go | 40 +- people/v1/people-gen.go | 83 +- places/v1/places-gen.go | 22 +- playcustomapp/v1/playcustomapp-gen.go | 18 +- .../v1alpha1/playdeveloperreporting-gen.go | 68 +- .../v1beta1/playdeveloperreporting-gen.go | 68 +- playgrouping/v1alpha1/playgrouping-gen.go | 13 +- playintegrity/v1/playintegrity-gen.go | 15 +- policyanalyzer/v1/policyanalyzer-gen.go | 20 +- policyanalyzer/v1beta1/policyanalyzer-gen.go | 20 +- policysimulator/v1/policysimulator-gen.go | 73 +- .../v1alpha/policysimulator-gen.go | 97 +- policysimulator/v1beta/policysimulator-gen.go | 97 +- .../v1/policytroubleshooter-gen.go | 10 +- .../v1beta/policytroubleshooter-gen.go | 10 +- pollen/v1/pollen-gen.go | 15 +- poly/v1/poly-gen.go | 21 +- privateca/v1/privateca-gen.go | 139 +- privateca/v1beta1/privateca-gen.go | 52 +- .../v1alpha1/prod_tt_sasportal-gen.go | 261 +-- publicca/v1/publicca-gen.go | 10 +- publicca/v1alpha1/publicca-gen.go | 10 +- publicca/v1beta1/publicca-gen.go | 10 +- pubsub/v1/pubsub-gen.go | 145 +- pubsub/v1beta1a/pubsub-gen.go | 54 +- pubsub/v1beta2/pubsub-gen.go | 67 +- pubsublite/v1/pubsublite-gen.go | 95 +- .../v1/rapidmigrationassessment-gen.go | 55 +- .../readerrevenuesubscriptionlinking-gen.go | 19 +- realtimebidding/v1/realtimebidding-gen.go | 123 +- .../v1alpha/realtimebidding-gen.go | 19 +- .../v1/recaptchaenterprise-gen.go | 73 +- .../v1beta1/recommendationengine-gen.go | 73 +- recommender/v1/recommender-gen.go | 157 +- recommender/v1beta1/recommender-gen.go | 179 +- redis/v1/redis-gen.go | 100 +- redis/v1beta1/redis-gen.go | 100 +- reseller/v1/reseller-gen.go | 62 +- resourcesettings/v1/resourcesettings-gen.go | 38 +- retail/v2/retail-gen.go | 208 +- retail/v2alpha/retail-gen.go | 259 +-- retail/v2beta/retail-gen.go | 223 +- run/v1/run-gen.go | 183 +- run/v2/run-gen.go | 118 +- runtimeconfig/v1/runtimeconfig-gen.go | 16 +- runtimeconfig/v1beta1/runtimeconfig-gen.go | 73 +- safebrowsing/v4/safebrowsing-gen.go | 40 +- safebrowsing/v5/safebrowsing-gen.go | 10 +- sasportal/v1alpha1/sasportal-gen.go | 261 +-- script/v1/script-gen.go | 59 +- searchads360/v0/searchads360-gen.go | 27 +- searchconsole/v1/searchconsole-gen.go | 48 +- secretmanager/v1/secretmanager-gen.go | 103 +- secretmanager/v1beta1/secretmanager-gen.go | 58 +- secretmanager/v1beta2/secretmanager-gen.go | 103 +- securitycenter/v1/securitycenter-gen.go | 527 ++--- securitycenter/v1beta1/securitycenter-gen.go | 76 +- securitycenter/v1beta2/securitycenter-gen.go | 194 +- .../v1/serviceconsumermanagement-gen.go | 51 +- .../v1beta1/serviceconsumermanagement-gen.go | 51 +- servicecontrol/v1/servicecontrol-gen.go | 16 +- servicecontrol/v2/servicecontrol-gen.go | 13 +- servicedirectory/v1/servicedirectory-gen.go | 79 +- .../v1beta1/servicedirectory-gen.go | 88 +- servicemanagement/v1/servicemanagement-gen.go | 75 +- servicenetworking/v1/servicenetworking-gen.go | 96 +- .../v1beta/servicenetworking-gen.go | 27 +- serviceusage/v1/serviceusage-gen.go | 39 +- serviceusage/v1beta1/serviceusage-gen.go | 72 +- sheets/v4/sheets-gen.go | 58 +- siteverification/v1/siteverification-gen.go | 28 +- slides/v1/slides-gen.go | 22 +- .../v1/smartdevicemanagement-gen.go | 28 +- solar/v1/solar-gen.go | 20 +- spanner/v1/spanner-gen.go | 297 +-- speech/v1/speech-gen.go | 53 +- speech/v1p1beta1/speech-gen.go | 53 +- sqladmin/v1/sqladmin-gen.go | 214 +- sqladmin/v1beta4/sqladmin-gen.go | 214 +- storage/v1/storage-gen.go | 280 +-- storagetransfer/v1/storagetransfer-gen.go | 64 +- streetviewpublish/v1/streetviewpublish-gen.go | 55 +- sts/v1/sts-gen.go | 10 +- sts/v1beta/sts-gen.go | 10 +- tagmanager/v1/tagmanager-gen.go | 154 +- tagmanager/v2/tagmanager-gen.go | 319 +-- tasks/v1/tasks-gen.go | 51 +- testing/v1/testing-gen.go | 41 +- texttospeech/v1/texttospeech-gen.go | 34 +- texttospeech/v1beta1/texttospeech-gen.go | 26 +- toolresults/v1beta3/toolresults-gen.go | 94 +- tpu/v1/tpu-gen.go | 58 +- tpu/v1alpha1/tpu-gen.go | 58 +- tpu/v2/tpu-gen.go | 79 +- tpu/v2alpha1/tpu-gen.go | 91 +- trafficdirector/v2/trafficdirector-gen.go | 10 +- trafficdirector/v3/trafficdirector-gen.go | 10 +- transcoder/v1/transcoder-gen.go | 31 +- translate/v2/translate-gen.go | 26 +- translate/v3/translate-gen.go | 157 +- translate/v3beta1/translate-gen.go | 67 +- travelimpactmodel/v1/travelimpactmodel-gen.go | 10 +- vault/v1/vault-gen.go | 108 +- verifiedaccess/v1/verifiedaccess-gen.go | 13 +- verifiedaccess/v2/verifiedaccess-gen.go | 13 +- versionhistory/v1/versionhistory-gen.go | 19 +- videointelligence/v1/videointelligence-gen.go | 35 +- .../v1beta2/videointelligence-gen.go | 10 +- .../v1p1beta1/videointelligence-gen.go | 10 +- .../v1p2beta1/videointelligence-gen.go | 10 +- .../v1p3beta1/videointelligence-gen.go | 10 +- vision/v1/vision-gen.go | 129 +- vision/v1p1beta1/vision-gen.go | 47 +- vision/v1p2beta1/vision-gen.go | 47 +- vmmigration/v1/vmmigration-gen.go | 184 +- vmmigration/v1alpha1/vmmigration-gen.go | 184 +- vmwareengine/v1/vmwareengine-gen.go | 271 +-- vpcaccess/v1/vpcaccess-gen.go | 31 +- vpcaccess/v1beta1/vpcaccess-gen.go | 31 +- walletobjects/v1/walletobjects-gen.go | 336 +-- webfonts/v1/webfonts-gen.go | 10 +- webrisk/v1/webrisk-gen.go | 37 +- .../v1/websecurityscanner-gen.go | 46 +- .../v1alpha/websecurityscanner-gen.go | 46 +- .../v1beta/websecurityscanner-gen.go | 46 +- .../v1/workflowexecutions-gen.go | 37 +- .../v1beta/workflowexecutions-gen.go | 19 +- workflows/v1/workflows-gen.go | 40 +- workflows/v1beta/workflows-gen.go | 37 +- workloadmanager/v1/workloadmanager-gen.go | 61 +- workspaceevents/v1/workspaceevents-gen.go | 30 +- workstations/v1/workstations-gen.go | 103 +- workstations/v1beta/workstations-gen.go | 97 +- youtube/v3/youtube-gen.go | 344 +-- youtubeanalytics/v2/youtubeanalytics-gen.go | 35 +- youtubereporting/v1/youtubereporting-gen.go | 35 +- 492 files changed, 21787 insertions(+), 40554 deletions(-) create mode 100644 google-api-go-generator/testdata/mediaupload.json create mode 100644 google-api-go-generator/testdata/mediaupload.want diff --git a/abusiveexperiencereport/v1/abusiveexperiencereport-gen.go b/abusiveexperiencereport/v1/abusiveexperiencereport-gen.go index 279af9685b0..f45a4e461a2 100644 --- a/abusiveexperiencereport/v1/abusiveexperiencereport-gen.go +++ b/abusiveexperiencereport/v1/abusiveexperiencereport-gen.go @@ -103,7 +103,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Sites = NewSitesService(s) + s.ViolatingSites = NewViolatingSitesService(s) if err != nil { return nil, err } @@ -122,10 +124,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Sites = NewSitesService(s) - s.ViolatingSites = NewViolatingSitesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -299,12 +298,11 @@ func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -403,12 +401,11 @@ func (c *ViolatingSitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/violatingSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-gen.go b/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-gen.go index fd8a3754dd1..44010042a4e 100644 --- a/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-gen.go +++ b/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AmpUrls = NewAmpUrlsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AmpUrls = NewAmpUrlsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -327,8 +326,7 @@ func (c *AmpUrlsBatchGetCall) Header() http.Header { func (c *AmpUrlsBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetampurlsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchgetampurlsrequest) if err != nil { return nil, err } diff --git a/accessapproval/v1/accessapproval-gen.go b/accessapproval/v1/accessapproval-gen.go index 6bd7f701b01..2b420bb3f3d 100644 --- a/accessapproval/v1/accessapproval-gen.go +++ b/accessapproval/v1/accessapproval-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -859,12 +858,11 @@ func (c *FoldersDeleteAccessApprovalSettingsCall) Header() http.Header { func (c *FoldersDeleteAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -968,12 +966,11 @@ func (c *FoldersGetAccessApprovalSettingsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1077,12 +1074,11 @@ func (c *FoldersGetServiceAccountCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1194,8 +1190,7 @@ func (c *FoldersUpdateAccessApprovalSettingsCall) Header() http.Header { func (c *FoldersUpdateAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessapprovalsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessapprovalsettings) if err != nil { return nil, err } @@ -1298,8 +1293,7 @@ func (c *FoldersApprovalRequestsApproveCall) Header() http.Header { func (c *FoldersApprovalRequestsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approveapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approveapprovalrequestmessage) if err != nil { return nil, err } @@ -1404,8 +1398,7 @@ func (c *FoldersApprovalRequestsDismissCall) Header() http.Header { func (c *FoldersApprovalRequestsDismissCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dismissapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dismissapprovalrequestmessage) if err != nil { return nil, err } @@ -1518,12 +1511,11 @@ func (c *FoldersApprovalRequestsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1620,8 +1612,7 @@ func (c *FoldersApprovalRequestsInvalidateCall) Header() http.Header { func (c *FoldersApprovalRequestsInvalidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.invalidateapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.invalidateapprovalrequestmessage) if err != nil { return nil, err } @@ -1761,12 +1752,11 @@ func (c *FoldersApprovalRequestsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/approvalRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1883,12 +1873,11 @@ func (c *OrganizationsDeleteAccessApprovalSettingsCall) Header() http.Header { func (c *OrganizationsDeleteAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1992,12 +1981,11 @@ func (c *OrganizationsGetAccessApprovalSettingsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2101,12 +2089,11 @@ func (c *OrganizationsGetServiceAccountCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2218,8 +2205,7 @@ func (c *OrganizationsUpdateAccessApprovalSettingsCall) Header() http.Header { func (c *OrganizationsUpdateAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessapprovalsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessapprovalsettings) if err != nil { return nil, err } @@ -2322,8 +2308,7 @@ func (c *OrganizationsApprovalRequestsApproveCall) Header() http.Header { func (c *OrganizationsApprovalRequestsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approveapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approveapprovalrequestmessage) if err != nil { return nil, err } @@ -2428,8 +2413,7 @@ func (c *OrganizationsApprovalRequestsDismissCall) Header() http.Header { func (c *OrganizationsApprovalRequestsDismissCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dismissapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dismissapprovalrequestmessage) if err != nil { return nil, err } @@ -2542,12 +2526,11 @@ func (c *OrganizationsApprovalRequestsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2644,8 +2627,7 @@ func (c *OrganizationsApprovalRequestsInvalidateCall) Header() http.Header { func (c *OrganizationsApprovalRequestsInvalidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.invalidateapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.invalidateapprovalrequestmessage) if err != nil { return nil, err } @@ -2785,12 +2767,11 @@ func (c *OrganizationsApprovalRequestsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/approvalRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2907,12 +2888,11 @@ func (c *ProjectsDeleteAccessApprovalSettingsCall) Header() http.Header { func (c *ProjectsDeleteAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3016,12 +2996,11 @@ func (c *ProjectsGetAccessApprovalSettingsCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3125,12 +3104,11 @@ func (c *ProjectsGetServiceAccountCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3242,8 +3220,7 @@ func (c *ProjectsUpdateAccessApprovalSettingsCall) Header() http.Header { func (c *ProjectsUpdateAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessapprovalsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessapprovalsettings) if err != nil { return nil, err } @@ -3346,8 +3323,7 @@ func (c *ProjectsApprovalRequestsApproveCall) Header() http.Header { func (c *ProjectsApprovalRequestsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approveapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approveapprovalrequestmessage) if err != nil { return nil, err } @@ -3452,8 +3428,7 @@ func (c *ProjectsApprovalRequestsDismissCall) Header() http.Header { func (c *ProjectsApprovalRequestsDismissCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dismissapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dismissapprovalrequestmessage) if err != nil { return nil, err } @@ -3566,12 +3541,11 @@ func (c *ProjectsApprovalRequestsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3668,8 +3642,7 @@ func (c *ProjectsApprovalRequestsInvalidateCall) Header() http.Header { func (c *ProjectsApprovalRequestsInvalidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.invalidateapprovalrequestmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.invalidateapprovalrequestmessage) if err != nil { return nil, err } @@ -3809,12 +3782,11 @@ func (c *ProjectsApprovalRequestsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/approvalRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/accesscontextmanager/v1/accesscontextmanager-gen.go b/accesscontextmanager/v1/accesscontextmanager-gen.go index 99539a86362..612bdabb984 100644 --- a/accesscontextmanager/v1/accesscontextmanager-gen.go +++ b/accesscontextmanager/v1/accesscontextmanager-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AccessPolicies = NewAccessPoliciesService(s) + s.Operations = NewOperationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AccessPolicies = NewAccessPoliciesService(s) - s.Operations = NewOperationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2531,8 +2530,7 @@ func (c *AccessPoliciesCreateCall) Header() http.Header { func (c *AccessPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accesspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accesspolicy) if err != nil { return nil, err } @@ -2630,12 +2628,11 @@ func (c *AccessPoliciesDeleteCall) Header() http.Header { func (c *AccessPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2738,12 +2735,11 @@ func (c *AccessPoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2838,8 +2834,7 @@ func (c *AccessPoliciesGetIamPolicyCall) Header() http.Header { func (c *AccessPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2967,12 +2962,11 @@ func (c *AccessPoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accessPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3093,8 +3087,7 @@ func (c *AccessPoliciesPatchCall) Header() http.Header { func (c *AccessPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accesspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accesspolicy) if err != nil { return nil, err } @@ -3199,8 +3192,7 @@ func (c *AccessPoliciesSetIamPolicyCall) Header() http.Header { func (c *AccessPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3306,8 +3298,7 @@ func (c *AccessPoliciesTestIamPermissionsCall) Header() http.Header { func (c *AccessPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3412,8 +3403,7 @@ func (c *AccessPoliciesAccessLevelsCreateCall) Header() http.Header { func (c *AccessPoliciesAccessLevelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accesslevel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accesslevel) if err != nil { return nil, err } @@ -3514,12 +3504,11 @@ func (c *AccessPoliciesAccessLevelsDeleteCall) Header() http.Header { func (c *AccessPoliciesAccessLevelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3644,12 +3633,11 @@ func (c *AccessPoliciesAccessLevelsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3786,12 +3774,11 @@ func (c *AccessPoliciesAccessLevelsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/accessLevels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3919,8 +3906,7 @@ func (c *AccessPoliciesAccessLevelsPatchCall) Header() http.Header { func (c *AccessPoliciesAccessLevelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accesslevel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accesslevel) if err != nil { return nil, err } @@ -4028,8 +4014,7 @@ func (c *AccessPoliciesAccessLevelsReplaceAllCall) Header() http.Header { func (c *AccessPoliciesAccessLevelsReplaceAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replaceaccesslevelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replaceaccesslevelsrequest) if err != nil { return nil, err } @@ -4135,8 +4120,7 @@ func (c *AccessPoliciesAccessLevelsTestIamPermissionsCall) Header() http.Header func (c *AccessPoliciesAccessLevelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4242,8 +4226,7 @@ func (c *AccessPoliciesAuthorizedOrgsDescsCreateCall) Header() http.Header { func (c *AccessPoliciesAuthorizedOrgsDescsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedorgsdesc) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedorgsdesc) if err != nil { return nil, err } @@ -4344,12 +4327,11 @@ func (c *AccessPoliciesAuthorizedOrgsDescsDeleteCall) Header() http.Header { func (c *AccessPoliciesAuthorizedOrgsDescsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4452,12 +4434,11 @@ func (c *AccessPoliciesAuthorizedOrgsDescsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4576,12 +4557,11 @@ func (c *AccessPoliciesAuthorizedOrgsDescsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authorizedOrgsDescs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4711,8 +4691,7 @@ func (c *AccessPoliciesAuthorizedOrgsDescsPatchCall) Header() http.Header { func (c *AccessPoliciesAuthorizedOrgsDescsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedorgsdesc) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedorgsdesc) if err != nil { return nil, err } @@ -4824,8 +4803,7 @@ func (c *AccessPoliciesServicePerimetersCommitCall) Header() http.Header { func (c *AccessPoliciesServicePerimetersCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitserviceperimetersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitserviceperimetersrequest) if err != nil { return nil, err } @@ -4929,8 +4907,7 @@ func (c *AccessPoliciesServicePerimetersCreateCall) Header() http.Header { func (c *AccessPoliciesServicePerimetersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceperimeter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceperimeter) if err != nil { return nil, err } @@ -5031,12 +5008,11 @@ func (c *AccessPoliciesServicePerimetersDeleteCall) Header() http.Header { func (c *AccessPoliciesServicePerimetersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5139,12 +5115,11 @@ func (c *AccessPoliciesServicePerimetersGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5263,12 +5238,11 @@ func (c *AccessPoliciesServicePerimetersListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/servicePerimeters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5396,8 +5370,7 @@ func (c *AccessPoliciesServicePerimetersPatchCall) Header() http.Header { func (c *AccessPoliciesServicePerimetersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceperimeter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceperimeter) if err != nil { return nil, err } @@ -5504,8 +5477,7 @@ func (c *AccessPoliciesServicePerimetersReplaceAllCall) Header() http.Header { func (c *AccessPoliciesServicePerimetersReplaceAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replaceserviceperimetersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replaceserviceperimetersrequest) if err != nil { return nil, err } @@ -5611,8 +5583,7 @@ func (c *AccessPoliciesServicePerimetersTestIamPermissionsCall) Header() http.He func (c *AccessPoliciesServicePerimetersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5721,8 +5692,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5823,12 +5793,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5932,12 +5901,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6060,12 +6028,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6183,8 +6150,7 @@ func (c *OrganizationsGcpUserAccessBindingsCreateCall) Header() http.Header { func (c *OrganizationsGcpUserAccessBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gcpuseraccessbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gcpuseraccessbinding) if err != nil { return nil, err } @@ -6284,12 +6250,11 @@ func (c *OrganizationsGcpUserAccessBindingsDeleteCall) Header() http.Header { func (c *OrganizationsGcpUserAccessBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6391,12 +6356,11 @@ func (c *OrganizationsGcpUserAccessBindingsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6515,12 +6479,11 @@ func (c *OrganizationsGcpUserAccessBindingsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gcpUserAccessBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6667,8 +6630,7 @@ func (c *OrganizationsGcpUserAccessBindingsPatchCall) Header() http.Header { func (c *OrganizationsGcpUserAccessBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gcpuseraccessbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gcpuseraccessbinding) if err != nil { return nil, err } @@ -6780,12 +6742,11 @@ func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6898,12 +6859,11 @@ func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/acmedns/v1/acmedns-gen.go b/acmedns/v1/acmedns-gen.go index 8abde05bde5..09f34db7f78 100644 --- a/acmedns/v1/acmedns-gen.go +++ b/acmedns/v1/acmedns-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AcmeChallengeSets = NewAcmeChallengeSetsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AcmeChallengeSets = NewAcmeChallengeSetsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -306,12 +305,11 @@ func (c *AcmeChallengeSetsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/acmeChallengeSets/{rootDomain}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -408,8 +406,7 @@ func (c *AcmeChallengeSetsRotateChallengesCall) Header() http.Header { func (c *AcmeChallengeSetsRotateChallengesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rotatechallengesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rotatechallengesrequest) if err != nil { return nil, err } diff --git a/addressvalidation/v1/addressvalidation-gen.go b/addressvalidation/v1/addressvalidation-gen.go index 0b636f26ae7..8573808e715 100644 --- a/addressvalidation/v1/addressvalidation-gen.go +++ b/addressvalidation/v1/addressvalidation-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1245,8 +1244,7 @@ func (c *V1ProvideValidationFeedbackCall) Header() http.Header { func (c *V1ProvideValidationFeedbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsaddressvalidationv1providevalidationfeedbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlemapsaddressvalidationv1providevalidationfeedbackrequest) if err != nil { return nil, err } @@ -1340,8 +1338,7 @@ func (c *V1ValidateAddressCall) Header() http.Header { func (c *V1ValidateAddressCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsaddressvalidationv1validateaddressrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlemapsaddressvalidationv1validateaddressrequest) if err != nil { return nil, err } diff --git a/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go b/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go index 54e1d5e5aa6..d1e60c71ac3 100644 --- a/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go +++ b/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go @@ -114,7 +114,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Bidders = NewBiddersService(s) + s.Buyers = NewBuyersService(s) if err != nil { return nil, err } @@ -133,11 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Bidders = NewBiddersService(s) - s.Buyers = NewBuyersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4851,8 +4850,7 @@ func (c *AccountsClientsCreateCall) Header() http.Header { func (c *AccountsClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client) if err != nil { return nil, err } @@ -4966,12 +4964,11 @@ func (c *AccountsClientsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5101,12 +5098,11 @@ func (c *AccountsClientsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5225,8 +5221,7 @@ func (c *AccountsClientsUpdateCall) Header() http.Header { func (c *AccountsClientsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client) if err != nil { return nil, err } @@ -5332,8 +5327,7 @@ func (c *AccountsClientsInvitationsCreateCall) Header() http.Header { func (c *AccountsClientsInvitationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuserinvitation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientuserinvitation) if err != nil { return nil, err } @@ -5453,12 +5447,11 @@ func (c *AccountsClientsInvitationsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5587,12 +5580,11 @@ func (c *AccountsClientsInvitationsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5724,12 +5716,11 @@ func (c *AccountsClientsUsersGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5858,12 +5849,11 @@ func (c *AccountsClientsUsersListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5986,8 +5976,7 @@ func (c *AccountsClientsUsersUpdateCall) Header() http.Header { func (c *AccountsClientsUsersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientuser) if err != nil { return nil, err } @@ -6112,8 +6101,7 @@ func (c *AccountsCreativesCreateCall) Header() http.Header { func (c *AccountsCreativesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -6226,12 +6214,11 @@ func (c *AccountsCreativesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6368,12 +6355,11 @@ func (c *AccountsCreativesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6492,8 +6478,7 @@ func (c *AccountsCreativesStopWatchingCall) Header() http.Header { func (c *AccountsCreativesStopWatchingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopwatchingcreativerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopwatchingcreativerequest) if err != nil { return nil, err } @@ -6599,8 +6584,7 @@ func (c *AccountsCreativesUpdateCall) Header() http.Header { func (c *AccountsCreativesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -6708,8 +6692,7 @@ func (c *AccountsCreativesWatchCall) Header() http.Header { func (c *AccountsCreativesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchcreativerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.watchcreativerequest) if err != nil { return nil, err } @@ -6813,8 +6796,7 @@ func (c *AccountsCreativesDealAssociationsAddCall) Header() http.Header { func (c *AccountsCreativesDealAssociationsAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adddealassociationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adddealassociationrequest) if err != nil { return nil, err } @@ -6959,12 +6941,11 @@ func (c *AccountsCreativesDealAssociationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7082,8 +7063,7 @@ func (c *AccountsCreativesDealAssociationsRemoveCall) Header() http.Header { func (c *AccountsCreativesDealAssociationsRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removedealassociationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removedealassociationrequest) if err != nil { return nil, err } @@ -7242,12 +7222,11 @@ func (c *AccountsFinalizedProposalsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/finalizedProposals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7370,8 +7349,7 @@ func (c *AccountsFinalizedProposalsPauseCall) Header() http.Header { func (c *AccountsFinalizedProposalsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pauseproposaldealsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pauseproposaldealsrequest) if err != nil { return nil, err } @@ -7481,8 +7459,7 @@ func (c *AccountsFinalizedProposalsResumeCall) Header() http.Header { func (c *AccountsFinalizedProposalsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumeproposaldealsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumeproposaldealsrequest) if err != nil { return nil, err } @@ -7596,12 +7573,11 @@ func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/products/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7730,12 +7706,11 @@ func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7857,8 +7832,7 @@ func (c *AccountsProposalsAcceptCall) Header() http.Header { func (c *AccountsProposalsAcceptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acceptproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acceptproposalrequest) if err != nil { return nil, err } @@ -7964,8 +7938,7 @@ func (c *AccountsProposalsAddNoteCall) Header() http.Header { func (c *AccountsProposalsAddNoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addnoterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addnoterequest) if err != nil { return nil, err } @@ -8071,8 +8044,7 @@ func (c *AccountsProposalsCancelNegotiationCall) Header() http.Header { func (c *AccountsProposalsCancelNegotiationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelnegotiationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelnegotiationrequest) if err != nil { return nil, err } @@ -8184,8 +8156,7 @@ func (c *AccountsProposalsCompleteSetupCall) Header() http.Header { func (c *AccountsProposalsCompleteSetupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completesetuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completesetuprequest) if err != nil { return nil, err } @@ -8287,8 +8258,7 @@ func (c *AccountsProposalsCreateCall) Header() http.Header { func (c *AccountsProposalsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.proposal) if err != nil { return nil, err } @@ -8402,12 +8372,11 @@ func (c *AccountsProposalsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8561,12 +8530,11 @@ func (c *AccountsProposalsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8687,8 +8655,7 @@ func (c *AccountsProposalsPauseCall) Header() http.Header { func (c *AccountsProposalsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pauseproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pauseproposalrequest) if err != nil { return nil, err } @@ -8797,8 +8764,7 @@ func (c *AccountsProposalsResumeCall) Header() http.Header { func (c *AccountsProposalsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumeproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumeproposalrequest) if err != nil { return nil, err } @@ -8911,8 +8877,7 @@ func (c *AccountsProposalsUpdateCall) Header() http.Header { func (c *AccountsProposalsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.proposal) if err != nil { return nil, err } @@ -9026,12 +8991,11 @@ func (c *AccountsPublisherProfilesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/publisherProfiles/{publisherProfileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9149,12 +9113,11 @@ func (c *AccountsPublisherProfilesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/publisherProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9283,8 +9246,7 @@ func (c *BiddersAccountsFilterSetsCreateCall) Header() http.Header { func (c *BiddersAccountsFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filterset) if err != nil { return nil, err } @@ -9388,12 +9350,11 @@ func (c *BiddersAccountsFilterSetsDeleteCall) Header() http.Header { func (c *BiddersAccountsFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9501,12 +9462,11 @@ func (c *BiddersAccountsFilterSetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9630,12 +9590,11 @@ func (c *BiddersAccountsFilterSetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9782,12 +9741,11 @@ func (c *BiddersAccountsFilterSetsBidMetricsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9935,12 +9893,11 @@ func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10088,12 +10045,11 @@ func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10241,12 +10197,11 @@ func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10394,12 +10349,11 @@ func (c *BiddersAccountsFilterSetsFilteredBidsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10552,12 +10506,11 @@ func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10713,12 +10666,11 @@ func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10866,12 +10818,11 @@ func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11019,12 +10970,11 @@ func (c *BiddersAccountsFilterSetsLosingBidsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11172,12 +11122,11 @@ func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11306,8 +11255,7 @@ func (c *BiddersFilterSetsCreateCall) Header() http.Header { func (c *BiddersFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filterset) if err != nil { return nil, err } @@ -11411,12 +11359,11 @@ func (c *BiddersFilterSetsDeleteCall) Header() http.Header { func (c *BiddersFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11524,12 +11471,11 @@ func (c *BiddersFilterSetsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11653,12 +11599,11 @@ func (c *BiddersFilterSetsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11805,12 +11750,11 @@ func (c *BiddersFilterSetsBidMetricsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11958,12 +11902,11 @@ func (c *BiddersFilterSetsBidResponseErrorsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12111,12 +12054,11 @@ func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12264,12 +12206,11 @@ func (c *BiddersFilterSetsFilteredBidRequestsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12417,12 +12358,11 @@ func (c *BiddersFilterSetsFilteredBidsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12575,12 +12515,11 @@ func (c *BiddersFilterSetsFilteredBidsCreativesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12736,12 +12675,11 @@ func (c *BiddersFilterSetsFilteredBidsDetailsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12889,12 +12827,11 @@ func (c *BiddersFilterSetsImpressionMetricsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13042,12 +12979,11 @@ func (c *BiddersFilterSetsLosingBidsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13195,12 +13131,11 @@ func (c *BiddersFilterSetsNonBillableWinningBidsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13329,8 +13264,7 @@ func (c *BuyersFilterSetsCreateCall) Header() http.Header { func (c *BuyersFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filterset) if err != nil { return nil, err } @@ -13434,12 +13368,11 @@ func (c *BuyersFilterSetsDeleteCall) Header() http.Header { func (c *BuyersFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13547,12 +13480,11 @@ func (c *BuyersFilterSetsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13676,12 +13608,11 @@ func (c *BuyersFilterSetsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13828,12 +13759,11 @@ func (c *BuyersFilterSetsBidMetricsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13981,12 +13911,11 @@ func (c *BuyersFilterSetsBidResponseErrorsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14134,12 +14063,11 @@ func (c *BuyersFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14287,12 +14215,11 @@ func (c *BuyersFilterSetsFilteredBidRequestsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14440,12 +14367,11 @@ func (c *BuyersFilterSetsFilteredBidsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14598,12 +14524,11 @@ func (c *BuyersFilterSetsFilteredBidsCreativesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14759,12 +14684,11 @@ func (c *BuyersFilterSetsFilteredBidsDetailsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14912,12 +14836,11 @@ func (c *BuyersFilterSetsImpressionMetricsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15065,12 +14988,11 @@ func (c *BuyersFilterSetsLosingBidsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15218,12 +15140,11 @@ func (c *BuyersFilterSetsNonBillableWinningBidsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/adexperiencereport/v1/adexperiencereport-gen.go b/adexperiencereport/v1/adexperiencereport-gen.go index 08d09dc7fb3..6f8854fe397 100644 --- a/adexperiencereport/v1/adexperiencereport-gen.go +++ b/adexperiencereport/v1/adexperiencereport-gen.go @@ -103,7 +103,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Sites = NewSitesService(s) + s.ViolatingSites = NewViolatingSitesService(s) if err != nil { return nil, err } @@ -122,10 +124,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Sites = NewSitesService(s) - s.ViolatingSites = NewViolatingSitesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -335,12 +334,11 @@ func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -440,12 +438,11 @@ func (c *ViolatingSitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/violatingSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/admin/datatransfer/v1/admin-gen.go b/admin/datatransfer/v1/admin-gen.go index 199fa9cb745..158f1191f18 100644 --- a/admin/datatransfer/v1/admin-gen.go +++ b/admin/datatransfer/v1/admin-gen.go @@ -123,7 +123,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Applications = NewApplicationsService(s) + s.Transfers = NewTransfersService(s) if err != nil { return nil, err } @@ -142,10 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Applications = NewApplicationsService(s) - s.Transfers = NewTransfersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -438,12 +437,11 @@ func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/datatransfer/v1/applications/{applicationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -562,12 +560,11 @@ func (c *ApplicationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/datatransfer/v1/applications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -689,12 +686,11 @@ func (c *TransfersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/datatransfer/v1/transfers/{dataTransferId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -784,8 +780,7 @@ func (c *TransfersInsertCall) Header() http.Header { func (c *TransfersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datatransfer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datatransfer) if err != nil { return nil, err } @@ -930,12 +925,11 @@ func (c *TransfersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/datatransfer/v1/transfers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/admin/directory/v1/admin-gen.go b/admin/directory/v1/admin-gen.go index c31d5ad27c9..ccf67c184ea 100644 --- a/admin/directory/v1/admin-gen.go +++ b/admin/directory/v1/admin-gen.go @@ -233,25 +233,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.Asps = NewAspsService(s) s.Channels = NewChannelsService(s) @@ -273,9 +254,27 @@ func New(client *http.Client) (*Service, error) { s.TwoStepVerification = NewTwoStepVerificationService(s) s.Users = NewUsersService(s) s.VerificationCodes = NewVerificationCodesService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL @@ -5440,12 +5439,11 @@ func (c *AspsDeleteCall) Header() http.Header { func (c *AspsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps/{codeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5529,12 +5527,11 @@ func (c *AspsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps/{codeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5638,12 +5635,11 @@ func (c *AspsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5731,8 +5727,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -5825,8 +5820,7 @@ func (c *ChromeosdevicesActionCall) Header() http.Header { func (c *ChromeosdevicesActionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdeviceaction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.chromeosdeviceaction) if err != nil { return nil, err } @@ -5937,12 +5931,11 @@ func (c *ChromeosdevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6140,12 +6133,11 @@ func (c *ChromeosdevicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6262,8 +6254,7 @@ func (c *ChromeosdevicesMoveDevicesToOuCall) Header() http.Header { func (c *ChromeosdevicesMoveDevicesToOuCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosmovedevicestoou) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.chromeosmovedevicestoou) if err != nil { return nil, err } @@ -6366,8 +6357,7 @@ func (c *ChromeosdevicesPatchCall) Header() http.Header { func (c *ChromeosdevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.chromeosdevice) if err != nil { return nil, err } @@ -6492,8 +6482,7 @@ func (c *ChromeosdevicesUpdateCall) Header() http.Header { func (c *ChromeosdevicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.chromeosdevice) if err != nil { return nil, err } @@ -6597,8 +6586,7 @@ func (c *CustomerDevicesChromeosBatchChangeStatusCall) Header() http.Header { func (c *CustomerDevicesChromeosBatchChangeStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchchangechromeosdevicestatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchchangechromeosdevicestatusrequest) if err != nil { return nil, err } @@ -6702,8 +6690,7 @@ func (c *CustomerDevicesChromeosIssueCommandCall) Header() http.Header { func (c *CustomerDevicesChromeosIssueCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorychromeosdevicesissuecommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.directorychromeosdevicesissuecommandrequest) if err != nil { return nil, err } @@ -6821,12 +6808,11 @@ func (c *CustomerDevicesChromeosCommandsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6931,12 +6917,11 @@ func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7028,8 +7013,7 @@ func (c *CustomersPatchCall) Header() http.Header { func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -7129,8 +7113,7 @@ func (c *CustomersUpdateCall) Header() http.Header { func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -7232,8 +7215,7 @@ func (c *CustomersChromePrintServersBatchCreatePrintServersCall) Header() http.H func (c *CustomersChromePrintServersBatchCreatePrintServersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateprintserversrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateprintserversrequest) if err != nil { return nil, err } @@ -7337,8 +7319,7 @@ func (c *CustomersChromePrintServersBatchDeletePrintServersCall) Header() http.H func (c *CustomersChromePrintServersBatchDeletePrintServersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleteprintserversrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeleteprintserversrequest) if err != nil { return nil, err } @@ -7441,8 +7422,7 @@ func (c *CustomersChromePrintServersCreateCall) Header() http.Header { func (c *CustomersChromePrintServersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.printserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.printserver) if err != nil { return nil, err } @@ -7541,12 +7521,11 @@ func (c *CustomersChromePrintServersDeleteCall) Header() http.Header { func (c *CustomersChromePrintServersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7650,12 +7629,11 @@ func (c *CustomersChromePrintServersGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7805,12 +7783,11 @@ func (c *CustomersChromePrintServersListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printServers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7933,8 +7910,7 @@ func (c *CustomersChromePrintServersPatchCall) Header() http.Header { func (c *CustomersChromePrintServersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.printserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.printserver) if err != nil { return nil, err } @@ -8034,8 +8010,7 @@ func (c *CustomersChromePrintersBatchCreatePrintersCall) Header() http.Header { func (c *CustomersChromePrintersBatchCreatePrintersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateprintersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateprintersrequest) if err != nil { return nil, err } @@ -8136,8 +8111,7 @@ func (c *CustomersChromePrintersBatchDeletePrintersCall) Header() http.Header { func (c *CustomersChromePrintersBatchDeletePrintersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleteprintersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeleteprintersrequest) if err != nil { return nil, err } @@ -8238,8 +8212,7 @@ func (c *CustomersChromePrintersCreateCall) Header() http.Header { func (c *CustomersChromePrintersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.printer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.printer) if err != nil { return nil, err } @@ -8338,12 +8311,11 @@ func (c *CustomersChromePrintersDeleteCall) Header() http.Header { func (c *CustomersChromePrintersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8446,12 +8418,11 @@ func (c *CustomersChromePrintersGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8596,12 +8567,11 @@ func (c *CustomersChromePrintersListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8748,12 +8718,11 @@ func (c *CustomersChromePrintersListPrinterModelsCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers:listPrinterModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8885,8 +8854,7 @@ func (c *CustomersChromePrintersPatchCall) Header() http.Header { func (c *CustomersChromePrintersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.printer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.printer) if err != nil { return nil, err } @@ -8987,12 +8955,11 @@ func (c *DomainAliasesDeleteCall) Header() http.Header { func (c *DomainAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9081,12 +9048,11 @@ func (c *DomainAliasesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9179,8 +9145,7 @@ func (c *DomainAliasesInsertCall) Header() http.Header { func (c *DomainAliasesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainalias) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainalias) if err != nil { return nil, err } @@ -9303,12 +9268,11 @@ func (c *DomainAliasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9401,12 +9365,11 @@ func (c *DomainsDeleteCall) Header() http.Header { func (c *DomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains/{domainName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9495,12 +9458,11 @@ func (c *DomainsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains/{domainName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9593,8 +9555,7 @@ func (c *DomainsInsertCall) Header() http.Header { func (c *DomainsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domains) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domains) if err != nil { return nil, err } @@ -9710,12 +9671,11 @@ func (c *DomainsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9806,12 +9766,11 @@ func (c *GroupsDeleteCall) Header() http.Header { func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9891,12 +9850,11 @@ func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9984,8 +9942,7 @@ func (c *GroupsInsertCall) Header() http.Header { func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -10163,12 +10120,11 @@ func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10280,8 +10236,7 @@ func (c *GroupsPatchCall) Header() http.Header { func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -10382,8 +10337,7 @@ func (c *GroupsUpdateCall) Header() http.Header { func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -10485,12 +10439,11 @@ func (c *GroupsAliasesDeleteCall) Header() http.Header { func (c *GroupsAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases/{alias}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10561,8 +10514,7 @@ func (c *GroupsAliasesInsertCall) Header() http.Header { func (c *GroupsAliasesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.alias) if err != nil { return nil, err } @@ -10673,12 +10625,11 @@ func (c *GroupsAliasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10774,12 +10725,11 @@ func (c *MembersDeleteCall) Header() http.Header { func (c *MembersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10865,12 +10815,11 @@ func (c *MembersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10984,12 +10933,11 @@ func (c *MembersHasMemberCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11084,8 +11032,7 @@ func (c *MembersInsertCall) Header() http.Header { func (c *MembersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.member) if err != nil { return nil, err } @@ -11229,12 +11176,11 @@ func (c *MembersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11355,8 +11301,7 @@ func (c *MembersPatchCall) Header() http.Header { func (c *MembersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.member) if err != nil { return nil, err } @@ -11463,8 +11408,7 @@ func (c *MembersUpdateCall) Header() http.Header { func (c *MembersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.member) if err != nil { return nil, err } @@ -11573,8 +11517,7 @@ func (c *MobiledevicesActionCall) Header() http.Header { func (c *MobiledevicesActionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mobiledeviceaction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mobiledeviceaction) if err != nil { return nil, err } @@ -11657,12 +11600,11 @@ func (c *MobiledevicesDeleteCall) Header() http.Header { func (c *MobiledevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11764,12 +11706,11 @@ func (c *MobiledevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11950,12 +11891,11 @@ func (c *MobiledevicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12073,12 +12013,11 @@ func (c *OrgunitsDeleteCall) Header() http.Header { func (c *OrgunitsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12165,12 +12104,11 @@ func (c *OrgunitsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12266,8 +12204,7 @@ func (c *OrgunitsInsertCall) Header() http.Header { func (c *OrgunitsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.orgunit) if err != nil { return nil, err } @@ -12403,12 +12340,11 @@ func (c *OrgunitsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12508,8 +12444,7 @@ func (c *OrgunitsPatchCall) Header() http.Header { func (c *OrgunitsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.orgunit) if err != nil { return nil, err } @@ -12617,8 +12552,7 @@ func (c *OrgunitsUpdateCall) Header() http.Header { func (c *OrgunitsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.orgunit) if err != nil { return nil, err } @@ -12735,12 +12669,11 @@ func (c *PrivilegesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/ALL/privileges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12835,12 +12768,11 @@ func (c *ResourcesBuildingsDeleteCall) Header() http.Header { func (c *ResourcesBuildingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12925,12 +12857,11 @@ func (c *ResourcesBuildingsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13047,8 +12978,7 @@ func (c *ResourcesBuildingsInsertCall) Header() http.Header { func (c *ResourcesBuildingsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.building) if err != nil { return nil, err } @@ -13174,12 +13104,11 @@ func (c *ResourcesBuildingsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13319,8 +13248,7 @@ func (c *ResourcesBuildingsPatchCall) Header() http.Header { func (c *ResourcesBuildingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.building) if err != nil { return nil, err } @@ -13448,8 +13376,7 @@ func (c *ResourcesBuildingsUpdateCall) Header() http.Header { func (c *ResourcesBuildingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.building) if err != nil { return nil, err } @@ -13553,12 +13480,11 @@ func (c *ResourcesCalendarsDeleteCall) Header() http.Header { func (c *ResourcesCalendarsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13643,12 +13569,11 @@ func (c *ResourcesCalendarsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13744,8 +13669,7 @@ func (c *ResourcesCalendarsInsertCall) Header() http.Header { func (c *ResourcesCalendarsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendarresource) if err != nil { return nil, err } @@ -13899,12 +13823,11 @@ func (c *ResourcesCalendarsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14023,8 +13946,7 @@ func (c *ResourcesCalendarsPatchCall) Header() http.Header { func (c *ResourcesCalendarsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendarresource) if err != nil { return nil, err } @@ -14133,8 +14055,7 @@ func (c *ResourcesCalendarsUpdateCall) Header() http.Header { func (c *ResourcesCalendarsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendarresource) if err != nil { return nil, err } @@ -14239,12 +14160,11 @@ func (c *ResourcesFeaturesDeleteCall) Header() http.Header { func (c *ResourcesFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14329,12 +14249,11 @@ func (c *ResourcesFeaturesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14429,8 +14348,7 @@ func (c *ResourcesFeaturesInsertCall) Header() http.Header { func (c *ResourcesFeaturesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -14556,12 +14474,11 @@ func (c *ResourcesFeaturesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14679,8 +14596,7 @@ func (c *ResourcesFeaturesPatchCall) Header() http.Header { func (c *ResourcesFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -14786,8 +14702,7 @@ func (c *ResourcesFeaturesRenameCall) Header() http.Header { func (c *ResourcesFeaturesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.featurerename) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.featurerename) if err != nil { return nil, err } @@ -14870,8 +14785,7 @@ func (c *ResourcesFeaturesUpdateCall) Header() http.Header { func (c *ResourcesFeaturesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -14973,12 +14887,11 @@ func (c *RoleAssignmentsDeleteCall) Header() http.Header { func (c *RoleAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15067,12 +14980,11 @@ func (c *RoleAssignmentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15165,8 +15077,7 @@ func (c *RoleAssignmentsInsertCall) Header() http.Header { func (c *RoleAssignmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.roleassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.roleassignment) if err != nil { return nil, err } @@ -15322,12 +15233,11 @@ func (c *RoleAssignmentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15442,12 +15352,11 @@ func (c *RolesDeleteCall) Header() http.Header { func (c *RolesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15536,12 +15445,11 @@ func (c *RolesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15634,8 +15542,7 @@ func (c *RolesInsertCall) Header() http.Header { func (c *RolesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.role) if err != nil { return nil, err } @@ -15765,12 +15672,11 @@ func (c *RolesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15886,8 +15792,7 @@ func (c *RolesPatchCall) Header() http.Header { func (c *RolesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.role) if err != nil { return nil, err } @@ -15991,8 +15896,7 @@ func (c *RolesUpdateCall) Header() http.Header { func (c *RolesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.role) if err != nil { return nil, err } @@ -16094,12 +15998,11 @@ func (c *SchemasDeleteCall) Header() http.Header { func (c *SchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16188,12 +16091,11 @@ func (c *SchemasGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16286,8 +16188,7 @@ func (c *SchemasInsertCall) Header() http.Header { func (c *SchemasInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.schema) if err != nil { return nil, err } @@ -16403,12 +16304,11 @@ func (c *SchemasListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16503,8 +16403,7 @@ func (c *SchemasPatchCall) Header() http.Header { func (c *SchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.schema) if err != nil { return nil, err } @@ -16608,8 +16507,7 @@ func (c *SchemasUpdateCall) Header() http.Header { func (c *SchemasUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.schema) if err != nil { return nil, err } @@ -16712,12 +16610,11 @@ func (c *TokensDeleteCall) Header() http.Header { func (c *TokensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens/{clientId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16801,12 +16698,11 @@ func (c *TokensGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens/{clientId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16911,12 +16807,11 @@ func (c *TokensListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17007,12 +16902,11 @@ func (c *TwoStepVerificationTurnOffCall) Header() http.Header { func (c *TwoStepVerificationTurnOffCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17080,12 +16974,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17208,12 +17101,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17318,8 +17210,7 @@ func (c *UsersInsertCall) Header() http.Header { func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -17556,12 +17447,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17672,8 +17562,7 @@ func (c *UsersMakeAdminCall) Header() http.Header { func (c *UsersMakeAdminCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.usermakeadmin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.usermakeadmin) if err != nil { return nil, err } @@ -17758,8 +17647,7 @@ func (c *UsersPatchCall) Header() http.Header { func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -17859,12 +17747,11 @@ func (c *UsersSignOutCall) Header() http.Header { func (c *UsersSignOutCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/signOut") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17933,8 +17820,7 @@ func (c *UsersUndeleteCall) Header() http.Header { func (c *UsersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userundelete) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userundelete) if err != nil { return nil, err } @@ -18019,8 +17905,7 @@ func (c *UsersUpdateCall) Header() http.Header { func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -18243,8 +18128,7 @@ func (c *UsersWatchCall) Header() http.Header { func (c *UsersWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -18343,12 +18227,11 @@ func (c *UsersAliasesDeleteCall) Header() http.Header { func (c *UsersAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases/{alias}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18419,8 +18302,7 @@ func (c *UsersAliasesInsertCall) Header() http.Header { func (c *UsersAliasesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.alias) if err != nil { return nil, err } @@ -18542,12 +18424,11 @@ func (c *UsersAliasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18650,8 +18531,7 @@ func (c *UsersAliasesWatchCall) Header() http.Header { func (c *UsersAliasesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -18750,12 +18630,11 @@ func (c *UsersPhotosDeleteCall) Header() http.Header { func (c *UsersPhotosDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18835,12 +18714,11 @@ func (c *UsersPhotosGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18934,8 +18812,7 @@ func (c *UsersPhotosPatchCall) Header() http.Header { func (c *UsersPhotosPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userphoto) if err != nil { return nil, err } @@ -19036,8 +18913,7 @@ func (c *UsersPhotosUpdateCall) Header() http.Header { func (c *UsersPhotosUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userphoto) if err != nil { return nil, err } @@ -19135,12 +19011,11 @@ func (c *VerificationCodesGenerateCall) Header() http.Header { func (c *VerificationCodesGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes/generate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19207,12 +19082,11 @@ func (c *VerificationCodesInvalidateCall) Header() http.Header { func (c *VerificationCodesInvalidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes/invalidate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19293,12 +19167,11 @@ func (c *VerificationCodesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/admin/reports/v1/admin-gen.go b/admin/reports/v1/admin-gen.go index 13275304cea..cf43e9cd648 100644 --- a/admin/reports/v1/admin-gen.go +++ b/admin/reports/v1/admin-gen.go @@ -123,7 +123,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Activities = NewActivitiesService(s) + s.Channels = NewChannelsService(s) + s.CustomerUsageReports = NewCustomerUsageReportsService(s) + s.EntityUsageReports = NewEntityUsageReportsService(s) + s.UserUsageReport = NewUserUsageReportService(s) if err != nil { return nil, err } @@ -142,13 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Activities = NewActivitiesService(s) - s.Channels = NewChannelsService(s) - s.CustomerUsageReports = NewCustomerUsageReportsService(s) - s.EntityUsageReports = NewEntityUsageReportsService(s) - s.UserUsageReport = NewUserUsageReportService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -957,12 +956,11 @@ func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1224,8 +1222,7 @@ func (c *ActivitiesWatchCall) Header() http.Header { func (c *ActivitiesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -1322,8 +1319,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -1448,12 +1444,11 @@ func (c *CustomerUsageReportsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/usage/dates/{date}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1657,12 +1652,11 @@ func (c *EntityUsageReportsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1886,12 +1880,11 @@ func (c *UserUsageReportGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/usage/users/{userKey}/dates/{date}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/admob/v1/admob-gen.go b/admob/v1/admob-gen.go index ac2592e3b7c..89a7b87beda 100644 --- a/admob/v1/admob-gen.go +++ b/admob/v1/admob-gen.go @@ -123,7 +123,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -142,9 +143,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1539,12 +1538,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1661,12 +1659,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1805,12 +1802,11 @@ func (c *AccountsAdUnitsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/adUnits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1951,12 +1947,11 @@ func (c *AccountsAppsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2073,8 +2068,7 @@ func (c *AccountsMediationReportGenerateCall) Header() http.Header { func (c *AccountsMediationReportGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatemediationreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatemediationreportrequest) if err != nil { return nil, err } @@ -2178,8 +2172,7 @@ func (c *AccountsNetworkReportGenerateCall) Header() http.Header { func (c *AccountsNetworkReportGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatenetworkreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatenetworkreportrequest) if err != nil { return nil, err } diff --git a/admob/v1beta/admob-gen.go b/admob/v1beta/admob-gen.go index c29809cf9c0..adf7633cdca 100644 --- a/admob/v1beta/admob-gen.go +++ b/admob/v1beta/admob-gen.go @@ -123,7 +123,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -142,9 +143,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2458,12 +2457,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2580,12 +2578,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2724,12 +2721,11 @@ func (c *AccountsAdSourcesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2871,12 +2867,11 @@ func (c *AccountsAdSourcesAdaptersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adapters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2996,8 +2991,7 @@ func (c *AccountsAdUnitMappingsBatchCreateCall) Header() http.Header { func (c *AccountsAdUnitMappingsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateadunitmappingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateadunitmappingsrequest) if err != nil { return nil, err } @@ -3101,8 +3095,7 @@ func (c *AccountsAdUnitsCreateCall) Header() http.Header { func (c *AccountsAdUnitsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunit) if err != nil { return nil, err } @@ -3230,12 +3223,11 @@ func (c *AccountsAdUnitsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3352,8 +3344,7 @@ func (c *AccountsAdUnitsAdUnitMappingsCreateCall) Header() http.Header { func (c *AccountsAdUnitsAdUnitMappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunitmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunitmapping) if err != nil { return nil, err } @@ -3495,12 +3486,11 @@ func (c *AccountsAdUnitsAdUnitMappingsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnitMappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3617,8 +3607,7 @@ func (c *AccountsAppsCreateCall) Header() http.Header { func (c *AccountsAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.app) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.app) if err != nil { return nil, err } @@ -3745,12 +3734,11 @@ func (c *AccountsAppsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3865,8 +3853,7 @@ func (c *AccountsCampaignReportGenerateCall) Header() http.Header { func (c *AccountsCampaignReportGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatecampaignreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatecampaignreportrequest) if err != nil { return nil, err } @@ -3970,8 +3957,7 @@ func (c *AccountsMediationGroupsCreateCall) Header() http.Header { func (c *AccountsMediationGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mediationgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mediationgroup) if err != nil { return nil, err } @@ -4120,12 +4106,11 @@ func (c *AccountsMediationGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/mediationGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4264,8 +4249,7 @@ func (c *AccountsMediationGroupsPatchCall) Header() http.Header { func (c *AccountsMediationGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mediationgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mediationgroup) if err != nil { return nil, err } @@ -4368,8 +4352,7 @@ func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) Header() http. func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mediationabexperiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mediationabexperiment) if err != nil { return nil, err } @@ -4475,8 +4458,7 @@ func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) Header() http.He func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopmediationabexperimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopmediationabexperimentrequest) if err != nil { return nil, err } @@ -4580,8 +4562,7 @@ func (c *AccountsMediationReportGenerateCall) Header() http.Header { func (c *AccountsMediationReportGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatemediationreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatemediationreportrequest) if err != nil { return nil, err } @@ -4685,8 +4666,7 @@ func (c *AccountsNetworkReportGenerateCall) Header() http.Header { func (c *AccountsNetworkReportGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatenetworkreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatenetworkreportrequest) if err != nil { return nil, err } diff --git a/adsense/v2/adsense-gen.go b/adsense/v2/adsense-gen.go index f7a31951a5c..97aee3182ac 100644 --- a/adsense/v2/adsense-gen.go +++ b/adsense/v2/adsense-gen.go @@ -123,7 +123,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -142,9 +143,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1587,12 +1586,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1695,12 +1693,11 @@ func (c *AccountsGetAdBlockingRecoveryTagCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adBlockingRecoveryTag") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1817,12 +1814,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1963,12 +1959,11 @@ func (c *AccountsListChildAccountsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listChildAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2093,12 +2088,11 @@ func (c *AccountsAdclientsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2204,12 +2198,11 @@ func (c *AccountsAdclientsGetAdcodeCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adcode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2330,12 +2323,11 @@ func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adclients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2458,8 +2450,7 @@ func (c *AccountsAdclientsAdunitsCreateCall) Header() http.Header { func (c *AccountsAdclientsAdunitsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunit) if err != nil { return nil, err } @@ -2570,12 +2561,11 @@ func (c *AccountsAdclientsAdunitsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2681,12 +2671,11 @@ func (c *AccountsAdclientsAdunitsGetAdcodeCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adcode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2807,12 +2796,11 @@ func (c *AccountsAdclientsAdunitsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adunits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2956,12 +2944,11 @@ func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listLinkedCustomChannels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3088,8 +3075,7 @@ func (c *AccountsAdclientsAdunitsPatchCall) Header() http.Header { func (c *AccountsAdclientsAdunitsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunit) if err != nil { return nil, err } @@ -3193,8 +3179,7 @@ func (c *AccountsAdclientsCustomchannelsCreateCall) Header() http.Header { func (c *AccountsAdclientsCustomchannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customchannel) if err != nil { return nil, err } @@ -3296,12 +3281,11 @@ func (c *AccountsAdclientsCustomchannelsDeleteCall) Header() http.Header { func (c *AccountsAdclientsCustomchannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3404,12 +3388,11 @@ func (c *AccountsAdclientsCustomchannelsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3530,12 +3513,11 @@ func (c *AccountsAdclientsCustomchannelsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/customchannels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3678,12 +3660,11 @@ func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listLinkedAdUnits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3808,8 +3789,7 @@ func (c *AccountsAdclientsCustomchannelsPatchCall) Header() http.Header { func (c *AccountsAdclientsCustomchannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customchannel) if err != nil { return nil, err } @@ -3920,12 +3900,11 @@ func (c *AccountsAdclientsUrlchannelsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4046,12 +4025,11 @@ func (c *AccountsAdclientsUrlchannelsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/urlchannels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4186,12 +4164,11 @@ func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/alerts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4295,12 +4272,11 @@ func (c *AccountsPaymentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/payments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4404,12 +4380,11 @@ func (c *AccountsPolicyIssuesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4531,12 +4506,11 @@ func (c *AccountsPolicyIssuesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/policyIssues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5138,12 +5112,11 @@ func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+account}/reports:generate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5723,12 +5696,11 @@ func (c *AccountsReportsGenerateCsvCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+account}/reports:generateCsv") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5831,12 +5803,11 @@ func (c *AccountsReportsGetSavedCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6047,12 +6018,11 @@ func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved:generate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6263,12 +6233,11 @@ func (c *AccountsReportsSavedGenerateCsvCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved:generateCsv") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6389,12 +6358,11 @@ func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/reports/saved") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6518,12 +6486,11 @@ func (c *AccountsSitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6644,12 +6611,11 @@ func (c *AccountsSitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/adsensehost/v4.1/adsensehost-gen.go b/adsensehost/v4.1/adsensehost-gen.go index c199a854996..0889369d551 100644 --- a/adsensehost/v4.1/adsensehost-gen.go +++ b/adsensehost/v4.1/adsensehost-gen.go @@ -112,7 +112,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Associationsessions = NewAssociationsessionsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Reports = NewReportsService(s) + s.Urlchannels = NewUrlchannelsService(s) if err != nil { return nil, err } @@ -131,14 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Adclients = NewAdclientsService(s) - s.Associationsessions = NewAssociationsessionsService(s) - s.Customchannels = NewCustomchannelsService(s) - s.Reports = NewReportsService(s) - s.Urlchannels = NewUrlchannelsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -961,12 +960,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1068,12 +1066,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1176,12 +1173,11 @@ func (c *AccountsAdclientsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1299,12 +1295,11 @@ func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1422,12 +1417,11 @@ func (c *AccountsAdunitsDeleteCall) Header() http.Header { func (c *AccountsAdunitsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1537,12 +1531,11 @@ func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1660,12 +1653,11 @@ func (c *AccountsAdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1763,8 +1755,7 @@ func (c *AccountsAdunitsInsertCall) Header() http.Header { func (c *AccountsAdunitsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunit) if err != nil { return nil, err } @@ -1900,12 +1891,11 @@ func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2025,8 +2015,7 @@ func (c *AccountsAdunitsPatchCall) Header() http.Header { func (c *AccountsAdunitsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunit) if err != nil { return nil, err } @@ -2131,8 +2120,7 @@ func (c *AccountsAdunitsUpdateCall) Header() http.Header { func (c *AccountsAdunitsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adunit) if err != nil { return nil, err } @@ -2303,12 +2291,11 @@ func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2411,12 +2398,11 @@ func (c *AdclientsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2529,12 +2515,11 @@ func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2678,12 +2663,11 @@ func (c *AssociationsessionsStartCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "associationsessions/start") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2783,12 +2767,11 @@ func (c *AssociationsessionsVerifyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "associationsessions/verify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2879,12 +2862,11 @@ func (c *CustomchannelsDeleteCall) Header() http.Header { func (c *CustomchannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2990,12 +2972,11 @@ func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3088,8 +3069,7 @@ func (c *CustomchannelsInsertCall) Header() http.Header { func (c *CustomchannelsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customchannel) if err != nil { return nil, err } @@ -3214,12 +3194,11 @@ func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3335,8 +3314,7 @@ func (c *CustomchannelsPatchCall) Header() http.Header { func (c *CustomchannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customchannel) if err != nil { return nil, err } @@ -3436,8 +3414,7 @@ func (c *CustomchannelsUpdateCall) Header() http.Header { func (c *CustomchannelsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customchannel) if err != nil { return nil, err } @@ -3604,12 +3581,11 @@ func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3699,12 +3675,11 @@ func (c *UrlchannelsDeleteCall) Header() http.Header { func (c *UrlchannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels/{urlChannelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3797,8 +3772,7 @@ func (c *UrlchannelsInsertCall) Header() http.Header { func (c *UrlchannelsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlchannel) if err != nil { return nil, err } @@ -3923,12 +3897,11 @@ func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/advisorynotifications/v1/advisorynotifications-gen.go b/advisorynotifications/v1/advisorynotifications-gen.go index 19d1b325297..3927ecee8f2 100644 --- a/advisorynotifications/v1/advisorynotifications-gen.go +++ b/advisorynotifications/v1/advisorynotifications-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -602,12 +601,11 @@ func (c *OrganizationsLocationsGetSettingsCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -702,8 +700,7 @@ func (c *OrganizationsLocationsUpdateSettingsCall) Header() http.Header { func (c *OrganizationsLocationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudadvisorynotificationsv1settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudadvisorynotificationsv1settings) if err != nil { return nil, err } @@ -828,12 +825,11 @@ func (c *OrganizationsLocationsNotificationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -984,12 +980,11 @@ func (c *OrganizationsLocationsNotificationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notifications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1115,12 +1110,11 @@ func (c *ProjectsLocationsGetSettingsCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1215,8 +1209,7 @@ func (c *ProjectsLocationsUpdateSettingsCall) Header() http.Header { func (c *ProjectsLocationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudadvisorynotificationsv1settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudadvisorynotificationsv1settings) if err != nil { return nil, err } @@ -1341,12 +1334,11 @@ func (c *ProjectsLocationsNotificationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1497,12 +1489,11 @@ func (c *ProjectsLocationsNotificationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notifications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/aiplatform/v1/aiplatform-gen.go b/aiplatform/v1/aiplatform-gen.go index c4076a8c31c..a09a9378143 100644 --- a/aiplatform/v1/aiplatform-gen.go +++ b/aiplatform/v1/aiplatform-gen.go @@ -125,7 +125,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Datasets = NewDatasetsService(s) + s.Endpoints = NewEndpointsService(s) + s.Media = NewMediaService(s) + s.Projects = NewProjectsService(s) + s.Publishers = NewPublishersService(s) if err != nil { return nil, err } @@ -144,13 +149,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Datasets = NewDatasetsService(s) - s.Endpoints = NewEndpointsService(s) - s.Media = NewMediaService(s) - s.Projects = NewProjectsService(s) - s.Publishers = NewPublishersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -38596,8 +38595,7 @@ func (c *DatasetsCreateCall) Header() http.Header { func (c *DatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1dataset) if err != nil { return nil, err } @@ -38694,12 +38692,11 @@ func (c *DatasetsDeleteCall) Header() http.Header { func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38809,12 +38806,11 @@ func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38962,12 +38958,11 @@ func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39087,8 +39082,7 @@ func (c *DatasetsPatchCall) Header() http.Header { func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1dataset) if err != nil { return nil, err } @@ -39190,8 +39184,7 @@ func (c *DatasetsDatasetVersionsCreateCall) Header() http.Header { func (c *DatasetsDatasetVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1datasetversion) if err != nil { return nil, err } @@ -39292,12 +39285,11 @@ func (c *DatasetsDatasetVersionsDeleteCall) Header() http.Header { func (c *DatasetsDatasetVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39409,12 +39401,11 @@ func (c *DatasetsDatasetVersionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39553,12 +39544,11 @@ func (c *DatasetsDatasetVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/datasetVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39680,8 +39670,7 @@ func (c *DatasetsDatasetVersionsPatchCall) Header() http.Header { func (c *DatasetsDatasetVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1datasetversion) if err != nil { return nil, err } @@ -39794,12 +39783,11 @@ func (c *DatasetsDatasetVersionsRestoreCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39893,8 +39881,7 @@ func (c *EndpointsComputeTokensCall) Header() http.Header { func (c *EndpointsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1computetokensrequest) if err != nil { return nil, err } @@ -39996,8 +39983,7 @@ func (c *EndpointsCountTokensCall) Header() http.Header { func (c *EndpointsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1counttokensrequest) if err != nil { return nil, err } @@ -40102,8 +40088,7 @@ func (c *EndpointsGenerateContentCall) Header() http.Header { func (c *EndpointsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -40209,8 +40194,7 @@ func (c *EndpointsStreamGenerateContentCall) Header() http.Header { func (c *EndpointsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -40351,8 +40335,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1uploadragfilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1uploadragfilerequest) if err != nil { return nil, err } @@ -40363,14 +40346,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/ragFiles:upload") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -40492,12 +40471,11 @@ func (c *ProjectsGetCacheConfigCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40591,8 +40569,7 @@ func (c *ProjectsUpdateCacheConfigCall) Header() http.Header { func (c *ProjectsUpdateCacheConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cacheconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cacheconfig) if err != nil { return nil, err } @@ -40696,8 +40673,7 @@ func (c *ProjectsLocationsAugmentPromptCall) Header() http.Header { func (c *ProjectsLocationsAugmentPromptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1augmentpromptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1augmentpromptrequest) if err != nil { return nil, err } @@ -40802,8 +40778,7 @@ func (c *ProjectsLocationsCorroborateContentCall) Header() http.Header { func (c *ProjectsLocationsCorroborateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1corroboratecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1corroboratecontentrequest) if err != nil { return nil, err } @@ -40905,8 +40880,7 @@ func (c *ProjectsLocationsEvaluateInstancesCall) Header() http.Header { func (c *ProjectsLocationsEvaluateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1evaluateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1evaluateinstancesrequest) if err != nil { return nil, err } @@ -41017,12 +40991,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41149,12 +41122,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41270,8 +41242,7 @@ func (c *ProjectsLocationsRetrieveContextsCall) Header() http.Header { func (c *ProjectsLocationsRetrieveContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1retrievecontextsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1retrievecontextsrequest) if err != nil { return nil, err } @@ -41381,8 +41352,7 @@ func (c *ProjectsLocationsBatchPredictionJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsBatchPredictionJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cancelbatchpredictionjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cancelbatchpredictionjobrequest) if err != nil { return nil, err } @@ -41485,8 +41455,7 @@ func (c *ProjectsLocationsBatchPredictionJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsBatchPredictionJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchpredictionjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchpredictionjob) if err != nil { return nil, err } @@ -41588,12 +41557,11 @@ func (c *ProjectsLocationsBatchPredictionJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBatchPredictionJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41698,12 +41666,11 @@ func (c *ProjectsLocationsBatchPredictionJobsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41846,12 +41813,11 @@ func (c *ProjectsLocationsBatchPredictionJobsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/batchPredictionJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41968,8 +41934,7 @@ func (c *ProjectsLocationsCachedContentsCreateCall) Header() http.Header { func (c *ProjectsLocationsCachedContentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cachedcontent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cachedcontent) if err != nil { return nil, err } @@ -42068,12 +42033,11 @@ func (c *ProjectsLocationsCachedContentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCachedContentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42176,12 +42140,11 @@ func (c *ProjectsLocationsCachedContentsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42302,12 +42265,11 @@ func (c *ProjectsLocationsCachedContentsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cachedContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42430,8 +42392,7 @@ func (c *ProjectsLocationsCachedContentsPatchCall) Header() http.Header { func (c *ProjectsLocationsCachedContentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cachedcontent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cachedcontent) if err != nil { return nil, err } @@ -42540,8 +42501,7 @@ func (c *ProjectsLocationsCustomJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cancelcustomjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cancelcustomjobrequest) if err != nil { return nil, err } @@ -42644,8 +42604,7 @@ func (c *ProjectsLocationsCustomJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1customjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1customjob) if err != nil { return nil, err } @@ -42745,12 +42704,11 @@ func (c *ProjectsLocationsCustomJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42854,12 +42812,11 @@ func (c *ProjectsLocationsCustomJobsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43001,12 +42958,11 @@ func (c *ProjectsLocationsCustomJobsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43126,12 +43082,11 @@ func (c *ProjectsLocationsCustomJobsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -43225,12 +43180,11 @@ func (c *ProjectsLocationsCustomJobsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43335,12 +43289,11 @@ func (c *ProjectsLocationsCustomJobsOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43464,12 +43417,11 @@ func (c *ProjectsLocationsCustomJobsOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43598,12 +43550,11 @@ func (c *ProjectsLocationsCustomJobsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -43699,8 +43650,7 @@ func (c *ProjectsLocationsDataLabelingJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsDataLabelingJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1canceldatalabelingjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1canceldatalabelingjobrequest) if err != nil { return nil, err } @@ -43802,8 +43752,7 @@ func (c *ProjectsLocationsDataLabelingJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataLabelingJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1datalabelingjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1datalabelingjob) if err != nil { return nil, err } @@ -43904,12 +43853,11 @@ func (c *ProjectsLocationsDataLabelingJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataLabelingJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44014,12 +43962,11 @@ func (c *ProjectsLocationsDataLabelingJobsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44171,12 +44118,11 @@ func (c *ProjectsLocationsDataLabelingJobsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataLabelingJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44296,12 +44242,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsCancelCall) Header() http.He func (c *ProjectsLocationsDataLabelingJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -44395,12 +44340,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsDeleteCall) Header() http.He func (c *ProjectsLocationsDataLabelingJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44505,12 +44449,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44634,12 +44577,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44768,12 +44710,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsWaitCall) Header() http.Head func (c *ProjectsLocationsDataLabelingJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -44867,8 +44808,7 @@ func (c *ProjectsLocationsDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1dataset) if err != nil { return nil, err } @@ -44968,12 +44908,11 @@ func (c *ProjectsLocationsDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45067,8 +45006,7 @@ func (c *ProjectsLocationsDatasetsExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1exportdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1exportdatarequest) if err != nil { return nil, err } @@ -45186,12 +45124,11 @@ func (c *ProjectsLocationsDatasetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45285,8 +45222,7 @@ func (c *ProjectsLocationsDatasetsImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1importdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1importdatarequest) if err != nil { return nil, err } @@ -45440,12 +45376,11 @@ func (c *ProjectsLocationsDatasetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45568,8 +45503,7 @@ func (c *ProjectsLocationsDatasetsPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1dataset) if err != nil { return nil, err } @@ -45794,12 +45728,11 @@ func (c *ProjectsLocationsDatasetsSearchDataItemsCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+dataset}:searchDataItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45932,12 +45865,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46036,12 +45968,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsCancelCall) Header() func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -46135,12 +46066,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsDeleteCall) Header() func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46245,12 +46175,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46374,12 +46303,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46508,12 +46436,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsWaitCall) Header() ht func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -46652,12 +46579,11 @@ func (c *ProjectsLocationsDatasetsDataItemsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46821,12 +46747,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/annotations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46946,12 +46871,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsCancelCall) Head func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47045,12 +46969,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsDeleteCall) Head func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47155,12 +47078,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47284,12 +47206,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47418,12 +47339,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsWaitCall) Header func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47522,12 +47442,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsCancelCall) Header() http.H func (c *ProjectsLocationsDatasetsDataItemsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47621,12 +47540,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsDeleteCall) Header() http.H func (c *ProjectsLocationsDatasetsDataItemsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47731,12 +47649,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47860,12 +47777,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47994,12 +47910,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsWaitCall) Header() http.Hea func (c *ProjectsLocationsDatasetsDataItemsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -48093,8 +48008,7 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsCreateCall) Header() http.Heade func (c *ProjectsLocationsDatasetsDatasetVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1datasetversion) if err != nil { return nil, err } @@ -48195,12 +48109,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDatasetsDatasetVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48312,12 +48225,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48456,12 +48368,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/datasetVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48583,8 +48494,7 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsPatchCall) Header() http.Header func (c *ProjectsLocationsDatasetsDatasetVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1datasetversion) if err != nil { return nil, err } @@ -48697,12 +48607,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsRestoreCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48801,12 +48710,11 @@ func (c *ProjectsLocationsDatasetsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -48900,12 +48808,11 @@ func (c *ProjectsLocationsDatasetsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49010,12 +48917,11 @@ func (c *ProjectsLocationsDatasetsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49139,12 +49045,11 @@ func (c *ProjectsLocationsDatasetsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49273,12 +49178,11 @@ func (c *ProjectsLocationsDatasetsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49371,12 +49275,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49515,12 +49418,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49640,12 +49542,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsCancelCall) Header() htt func (c *ProjectsLocationsDatasetsSavedQueriesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49739,12 +49640,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsDeleteCall) Header() htt func (c *ProjectsLocationsDatasetsSavedQueriesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49849,12 +49749,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49978,12 +49877,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50112,12 +50010,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsWaitCall) Header() http. func (c *ProjectsLocationsDatasetsSavedQueriesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -50211,8 +50108,7 @@ func (c *ProjectsLocationsDeploymentResourcePoolsCreateCall) Header() http.Heade func (c *ProjectsLocationsDeploymentResourcePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1createdeploymentresourcepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1createdeploymentresourcepoolrequest) if err != nil { return nil, err } @@ -50313,12 +50209,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDeploymentResourcePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50423,12 +50318,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50550,12 +50444,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deploymentResourcePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50678,8 +50571,7 @@ func (c *ProjectsLocationsDeploymentResourcePoolsPatchCall) Header() http.Header func (c *ProjectsLocationsDeploymentResourcePoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1deploymentresourcepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1deploymentresourcepool) if err != nil { return nil, err } @@ -50810,12 +50702,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsQueryDeployedModelsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+deploymentResourcePool}:queryDeployedModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50935,12 +50826,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsCancelCall) Header() func (c *ProjectsLocationsDeploymentResourcePoolsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -51034,12 +50924,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsDeleteCall) Header() func (c *ProjectsLocationsDeploymentResourcePoolsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -51144,12 +51033,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51273,12 +51161,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51407,12 +51294,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsWaitCall) Header() ht func (c *ProjectsLocationsDeploymentResourcePoolsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -51506,8 +51392,7 @@ func (c *ProjectsLocationsEndpointsComputeTokensCall) Header() http.Header { func (c *ProjectsLocationsEndpointsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1computetokensrequest) if err != nil { return nil, err } @@ -51609,8 +51494,7 @@ func (c *ProjectsLocationsEndpointsCountTokensCall) Header() http.Header { func (c *ProjectsLocationsEndpointsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1counttokensrequest) if err != nil { return nil, err } @@ -51727,8 +51611,7 @@ func (c *ProjectsLocationsEndpointsCreateCall) Header() http.Header { func (c *ProjectsLocationsEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1endpoint) if err != nil { return nil, err } @@ -51828,12 +51711,11 @@ func (c *ProjectsLocationsEndpointsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -51928,8 +51810,7 @@ func (c *ProjectsLocationsEndpointsDeployModelCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDeployModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1deploymodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1deploymodelrequest) if err != nil { return nil, err } @@ -52032,8 +51913,7 @@ func (c *ProjectsLocationsEndpointsDirectPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDirectPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1directpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1directpredictrequest) if err != nil { return nil, err } @@ -52136,8 +52016,7 @@ func (c *ProjectsLocationsEndpointsDirectRawPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDirectRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1directrawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1directrawpredictrequest) if err != nil { return nil, err } @@ -52242,8 +52121,7 @@ func (c *ProjectsLocationsEndpointsExplainCall) Header() http.Header { func (c *ProjectsLocationsEndpointsExplainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1explainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1explainrequest) if err != nil { return nil, err } @@ -52347,8 +52225,7 @@ func (c *ProjectsLocationsEndpointsFetchPredictOperationCall) Header() http.Head func (c *ProjectsLocationsEndpointsFetchPredictOperationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1fetchpredictoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1fetchpredictoperationrequest) if err != nil { return nil, err } @@ -52453,8 +52330,7 @@ func (c *ProjectsLocationsEndpointsGenerateContentCall) Header() http.Header { func (c *ProjectsLocationsEndpointsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -52566,12 +52442,11 @@ func (c *ProjectsLocationsEndpointsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52721,12 +52596,11 @@ func (c *ProjectsLocationsEndpointsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52845,8 +52719,7 @@ func (c *ProjectsLocationsEndpointsMutateDeployedModelCall) Header() http.Header func (c *ProjectsLocationsEndpointsMutateDeployedModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1mutatedeployedmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1mutatedeployedmodelrequest) if err != nil { return nil, err } @@ -52954,8 +52827,7 @@ func (c *ProjectsLocationsEndpointsPatchCall) Header() http.Header { func (c *ProjectsLocationsEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1endpoint) if err != nil { return nil, err } @@ -53057,8 +52929,7 @@ func (c *ProjectsLocationsEndpointsPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1predictrequest) if err != nil { return nil, err } @@ -53162,8 +53033,7 @@ func (c *ProjectsLocationsEndpointsPredictLongRunningCall) Header() http.Header func (c *ProjectsLocationsEndpointsPredictLongRunningCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1predictlongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1predictlongrunningrequest) if err != nil { return nil, err } @@ -53269,8 +53139,7 @@ func (c *ProjectsLocationsEndpointsRawPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1rawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1rawpredictrequest) if err != nil { return nil, err } @@ -53373,8 +53242,7 @@ func (c *ProjectsLocationsEndpointsServerStreamingPredictCall) Header() http.Hea func (c *ProjectsLocationsEndpointsServerStreamingPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1streamingpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1streamingpredictrequest) if err != nil { return nil, err } @@ -53480,8 +53348,7 @@ func (c *ProjectsLocationsEndpointsStreamGenerateContentCall) Header() http.Head func (c *ProjectsLocationsEndpointsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -53584,8 +53451,7 @@ func (c *ProjectsLocationsEndpointsStreamRawPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsStreamRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1streamrawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1streamrawpredictrequest) if err != nil { return nil, err } @@ -53689,8 +53555,7 @@ func (c *ProjectsLocationsEndpointsUndeployModelCall) Header() http.Header { func (c *ProjectsLocationsEndpointsUndeployModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1undeploymodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1undeploymodelrequest) if err != nil { return nil, err } @@ -53791,8 +53656,7 @@ func (c *ProjectsLocationsEndpointsUpdateCall) Header() http.Header { func (c *ProjectsLocationsEndpointsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1updateendpointlongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1updateendpointlongrunningrequest) if err != nil { return nil, err } @@ -53894,8 +53758,7 @@ func (c *ProjectsLocationsEndpointsChatCompletionsCall) Header() http.Header { func (c *ProjectsLocationsEndpointsChatCompletionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -54002,12 +53865,11 @@ func (c *ProjectsLocationsEndpointsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsEndpointsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -54101,12 +53963,11 @@ func (c *ProjectsLocationsEndpointsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -54211,12 +54072,11 @@ func (c *ProjectsLocationsEndpointsOperationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54340,12 +54200,11 @@ func (c *ProjectsLocationsEndpointsOperationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54474,12 +54333,11 @@ func (c *ProjectsLocationsEndpointsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsEndpointsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -54583,8 +54441,7 @@ func (c *ProjectsLocationsFeatureGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featuregroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featuregroup) if err != nil { return nil, err } @@ -54692,12 +54549,11 @@ func (c *ProjectsLocationsFeatureGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -54800,12 +54656,11 @@ func (c *ProjectsLocationsFeatureGroupsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54950,12 +54805,11 @@ func (c *ProjectsLocationsFeatureGroupsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/featureGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55083,8 +54937,7 @@ func (c *ProjectsLocationsFeatureGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featuregroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featuregroup) if err != nil { return nil, err } @@ -55189,8 +55042,7 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesBatchCreateCall) Header() http.He func (c *ProjectsLocationsFeatureGroupsFeaturesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchcreatefeaturesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchcreatefeaturesrequest) if err != nil { return nil, err } @@ -55305,8 +55157,7 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesCreateCall) Header() http.Header func (c *ProjectsLocationsFeatureGroupsFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1feature) if err != nil { return nil, err } @@ -55409,12 +55260,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesDeleteCall) Header() http.Header func (c *ProjectsLocationsFeatureGroupsFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55520,12 +55370,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55695,12 +55544,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55835,8 +55683,7 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesPatchCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1feature) if err != nil { return nil, err } @@ -55938,12 +55785,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsDeleteCall) Header() ht func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56048,12 +55894,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56177,12 +56022,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsListWaitCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56311,12 +56155,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsWaitCall) Header() http func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -56410,12 +56253,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsFeatureGroupsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56520,12 +56362,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56649,12 +56490,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsListWaitCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56783,12 +56623,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsFeatureGroupsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -56893,8 +56732,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsFeatureOnlineStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featureonlinestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featureonlinestore) if err != nil { return nil, err } @@ -57004,12 +56842,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeatureOnlineStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -57112,12 +56949,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57228,12 +57064,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresGetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsFeatureOnlineStoresGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57379,12 +57214,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/featureOnlineStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57516,8 +57350,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsFeatureOnlineStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featureonlinestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featureonlinestore) if err != nil { return nil, err } @@ -57622,8 +57455,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsFeatureOnlineStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -57738,12 +57570,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsFeatureOnlineStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57857,8 +57688,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsCreateCall) Header() ht func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featureview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featureview) if err != nil { return nil, err } @@ -57959,12 +57789,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsDeleteCall) Header() ht func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -58059,8 +57888,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFetchFeatureValuesCall) func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFetchFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1fetchfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1fetchfeaturevaluesrequest) if err != nil { return nil, err } @@ -58173,12 +58001,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58289,12 +58116,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsGetIamPolicyCall) Heade func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -58444,12 +58270,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/featureViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58581,8 +58406,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsPatchCall) Header() htt func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featureview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featureview) if err != nil { return nil, err } @@ -58687,8 +58511,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSearchNearestEntitiesCa func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSearchNearestEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1searchnearestentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1searchnearestentitiesrequest) if err != nil { return nil, err } @@ -58793,8 +58616,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSetIamPolicyCall) Heade func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -58897,8 +58719,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSyncCall) Header() http func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1syncfeatureviewrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1syncfeatureviewrequest) if err != nil { return nil, err } @@ -59013,12 +58834,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsTestIamPermissionsCall) func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -59123,12 +58943,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFeatureViewSyncsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59272,12 +59091,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFeatureViewSyncsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/featureViewSyncs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59392,12 +59210,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsDeleteCall) H func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -59502,12 +59319,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59631,12 +59447,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsListWaitCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59765,12 +59580,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsWaitCall) Hea func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -59864,12 +59678,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsDeleteCall) Header() http func (c *ProjectsLocationsFeatureOnlineStoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -59974,12 +59787,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60103,12 +59915,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsListWaitCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60237,12 +60048,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsWaitCall) Header() http.H func (c *ProjectsLocationsFeatureOnlineStoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -60341,8 +60151,7 @@ func (c *ProjectsLocationsFeaturestoresBatchReadFeatureValuesCall) Header() http func (c *ProjectsLocationsFeaturestoresBatchReadFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchreadfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchreadfeaturevaluesrequest) if err != nil { return nil, err } @@ -60454,8 +60263,7 @@ func (c *ProjectsLocationsFeaturestoresCreateCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featurestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featurestore) if err != nil { return nil, err } @@ -60564,12 +60372,11 @@ func (c *ProjectsLocationsFeaturestoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -60672,12 +60479,11 @@ func (c *ProjectsLocationsFeaturestoresGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60788,12 +60594,11 @@ func (c *ProjectsLocationsFeaturestoresGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -60947,12 +60752,11 @@ func (c *ProjectsLocationsFeaturestoresListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/featurestores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61081,8 +60885,7 @@ func (c *ProjectsLocationsFeaturestoresPatchCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1featurestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1featurestore) if err != nil { return nil, err } @@ -61252,12 +61055,11 @@ func (c *ProjectsLocationsFeaturestoresSearchFeaturesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/featurestores:searchFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61375,8 +61177,7 @@ func (c *ProjectsLocationsFeaturestoresSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -61491,12 +61292,11 @@ func (c *ProjectsLocationsFeaturestoresTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsFeaturestoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -61601,8 +61401,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesCreateCall) Header() http.Head func (c *ProjectsLocationsFeaturestoresEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1entitytype) if err != nil { return nil, err } @@ -61712,12 +61511,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteCall) Header() http.Head func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -61820,8 +61618,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteFeatureValuesCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1deletefeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1deletefeaturevaluesrequest) if err != nil { return nil, err } @@ -61926,8 +61723,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesExportFeatureValuesCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesExportFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1exportfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1exportfeaturevaluesrequest) if err != nil { return nil, err } @@ -62040,12 +61836,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62156,12 +61951,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesGetIamPolicyCall) Header() htt func (c *ProjectsLocationsFeaturestoresEntityTypesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62270,8 +62064,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesImportFeatureValuesCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesImportFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1importfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1importfeaturevaluesrequest) if err != nil { return nil, err } @@ -62434,12 +62227,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62578,8 +62370,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesPatchCall) Header() http.Heade func (c *ProjectsLocationsFeaturestoresEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1entitytype) if err != nil { return nil, err } @@ -62686,8 +62477,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesReadFeatureValuesCall) Header( func (c *ProjectsLocationsFeaturestoresEntityTypesReadFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1readfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1readfeaturevaluesrequest) if err != nil { return nil, err } @@ -62792,8 +62582,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesSetIamPolicyCall) Header() htt func (c *ProjectsLocationsFeaturestoresEntityTypesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -62899,8 +62688,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesStreamingReadFeatureValuesCall func (c *ProjectsLocationsFeaturestoresEntityTypesStreamingReadFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1streamingreadfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1streamingreadfeaturevaluesrequest) if err != nil { return nil, err } @@ -63015,12 +62803,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesTestIamPermissionsCall) Header func (c *ProjectsLocationsFeaturestoresEntityTypesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -63121,8 +62908,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesWriteFeatureValuesCall) Header func (c *ProjectsLocationsFeaturestoresEntityTypesWriteFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1writefeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1writefeaturevaluesrequest) if err != nil { return nil, err } @@ -63227,8 +63013,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchcreatefeaturesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchcreatefeaturesrequest) if err != nil { return nil, err } @@ -63343,8 +63128,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesCreateCall) Header() h func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1feature) if err != nil { return nil, err } @@ -63447,12 +63231,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesDeleteCall) Header() h func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -63558,12 +63341,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63733,12 +63515,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63873,8 +63654,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesPatchCall) Header() ht func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1feature) if err != nil { return nil, err } @@ -63981,12 +63761,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsCancelCall) func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64080,12 +63859,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsDeleteCall) func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -64190,12 +63968,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsGetCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64319,12 +64096,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsListCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64453,12 +64229,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsWaitCall) He func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64557,12 +64332,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsCancelCall) Header() func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64656,12 +64430,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsDeleteCall) Header() func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -64766,12 +64539,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64895,12 +64667,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65029,12 +64800,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsWaitCall) Header() h func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -65133,12 +64903,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsCancelCall) Header() http.Heade func (c *ProjectsLocationsFeaturestoresOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -65232,12 +65001,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsFeaturestoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -65342,12 +65110,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65471,12 +65238,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65605,12 +65371,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsFeaturestoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -65713,8 +65478,7 @@ func (c *ProjectsLocationsHyperparameterTuningJobsCancelCall) Header() http.Head func (c *ProjectsLocationsHyperparameterTuningJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cancelhyperparametertuningjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cancelhyperparametertuningjobrequest) if err != nil { return nil, err } @@ -65817,8 +65581,7 @@ func (c *ProjectsLocationsHyperparameterTuningJobsCreateCall) Header() http.Head func (c *ProjectsLocationsHyperparameterTuningJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1hyperparametertuningjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1hyperparametertuningjob) if err != nil { return nil, err } @@ -65920,12 +65683,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsDeleteCall) Header() http.Head func (c *ProjectsLocationsHyperparameterTuningJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -66030,12 +65792,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66179,12 +65940,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/hyperparameterTuningJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66304,12 +66064,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsCancelCall) Header() func (c *ProjectsLocationsHyperparameterTuningJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -66403,12 +66162,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsDeleteCall) Header() func (c *ProjectsLocationsHyperparameterTuningJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -66513,12 +66271,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66642,12 +66399,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66776,12 +66532,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsWaitCall) Header() h func (c *ProjectsLocationsHyperparameterTuningJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -66875,8 +66630,7 @@ func (c *ProjectsLocationsIndexEndpointsCreateCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1indexendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1indexendpoint) if err != nil { return nil, err } @@ -66976,12 +66730,11 @@ func (c *ProjectsLocationsIndexEndpointsDeleteCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -67077,8 +66830,7 @@ func (c *ProjectsLocationsIndexEndpointsDeployIndexCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsDeployIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1deployindexrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1deployindexrequest) if err != nil { return nil, err } @@ -67181,8 +66933,7 @@ func (c *ProjectsLocationsIndexEndpointsFindNeighborsCall) Header() http.Header func (c *ProjectsLocationsIndexEndpointsFindNeighborsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1findneighborsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1findneighborsrequest) if err != nil { return nil, err } @@ -67294,12 +67045,11 @@ func (c *ProjectsLocationsIndexEndpointsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67441,12 +67191,11 @@ func (c *ProjectsLocationsIndexEndpointsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/indexEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67563,8 +67312,7 @@ func (c *ProjectsLocationsIndexEndpointsMutateDeployedIndexCall) Header() http.H func (c *ProjectsLocationsIndexEndpointsMutateDeployedIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1deployedindex) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1deployedindex) if err != nil { return nil, err } @@ -67672,8 +67420,7 @@ func (c *ProjectsLocationsIndexEndpointsPatchCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1indexendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1indexendpoint) if err != nil { return nil, err } @@ -67776,8 +67523,7 @@ func (c *ProjectsLocationsIndexEndpointsReadIndexDatapointsCall) Header() http.H func (c *ProjectsLocationsIndexEndpointsReadIndexDatapointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1readindexdatapointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1readindexdatapointsrequest) if err != nil { return nil, err } @@ -67881,8 +67627,7 @@ func (c *ProjectsLocationsIndexEndpointsUndeployIndexCall) Header() http.Header func (c *ProjectsLocationsIndexEndpointsUndeployIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1undeployindexrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1undeployindexrequest) if err != nil { return nil, err } @@ -67989,12 +67734,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsCancelCall) Header() http.Head func (c *ProjectsLocationsIndexEndpointsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -68088,12 +67832,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsDeleteCall) Header() http.Head func (c *ProjectsLocationsIndexEndpointsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -68198,12 +67941,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68327,12 +68069,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68461,12 +68202,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsIndexEndpointsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -68560,8 +68300,7 @@ func (c *ProjectsLocationsIndexesCreateCall) Header() http.Header { func (c *ProjectsLocationsIndexesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1index) if err != nil { return nil, err } @@ -68662,12 +68401,11 @@ func (c *ProjectsLocationsIndexesDeleteCall) Header() http.Header { func (c *ProjectsLocationsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -68771,12 +68509,11 @@ func (c *ProjectsLocationsIndexesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68908,12 +68645,11 @@ func (c *ProjectsLocationsIndexesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -69035,8 +68771,7 @@ func (c *ProjectsLocationsIndexesPatchCall) Header() http.Header { func (c *ProjectsLocationsIndexesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1index) if err != nil { return nil, err } @@ -69138,8 +68873,7 @@ func (c *ProjectsLocationsIndexesRemoveDatapointsCall) Header() http.Header { func (c *ProjectsLocationsIndexesRemoveDatapointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1removedatapointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1removedatapointsrequest) if err != nil { return nil, err } @@ -69241,8 +68975,7 @@ func (c *ProjectsLocationsIndexesUpsertDatapointsCall) Header() http.Header { func (c *ProjectsLocationsIndexesUpsertDatapointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1upsertdatapointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1upsertdatapointsrequest) if err != nil { return nil, err } @@ -69349,12 +69082,11 @@ func (c *ProjectsLocationsIndexesOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsIndexesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -69448,12 +69180,11 @@ func (c *ProjectsLocationsIndexesOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsIndexesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -69558,12 +69289,11 @@ func (c *ProjectsLocationsIndexesOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -69687,12 +69417,11 @@ func (c *ProjectsLocationsIndexesOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -69821,12 +69550,11 @@ func (c *ProjectsLocationsIndexesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsIndexesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -69933,8 +69661,7 @@ func (c *ProjectsLocationsMetadataStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsMetadataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1metadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1metadatastore) if err != nil { return nil, err } @@ -70042,12 +69769,11 @@ func (c *ProjectsLocationsMetadataStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsMetadataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -70151,12 +69877,11 @@ func (c *ProjectsLocationsMetadataStoresGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70278,12 +70003,11 @@ func (c *ProjectsLocationsMetadataStoresListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/metadataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70412,8 +70136,7 @@ func (c *ProjectsLocationsMetadataStoresArtifactsCreateCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1artifact) if err != nil { return nil, err } @@ -70522,12 +70245,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsDeleteCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -70632,12 +70354,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70795,12 +70516,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70928,8 +70648,7 @@ func (c *ProjectsLocationsMetadataStoresArtifactsPatchCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresArtifactsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1artifact) if err != nil { return nil, err } @@ -71031,8 +70750,7 @@ func (c *ProjectsLocationsMetadataStoresArtifactsPurgeCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresArtifactsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1purgeartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1purgeartifactsrequest) if err != nil { return nil, err } @@ -71182,12 +70900,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsQueryArtifactLineageSubgraphCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+artifact}:queryArtifactLineageSubgraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71286,12 +71003,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsCancelCall) Header() func (c *ProjectsLocationsMetadataStoresArtifactsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -71385,12 +71101,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsDeleteCall) Header() func (c *ProjectsLocationsMetadataStoresArtifactsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -71495,12 +71210,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71624,12 +71338,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71758,12 +71471,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsWaitCall) Header() ht func (c *ProjectsLocationsMetadataStoresArtifactsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -71861,8 +71573,7 @@ func (c *ProjectsLocationsMetadataStoresContextsAddContextArtifactsAndExecutions func (c *ProjectsLocationsMetadataStoresContextsAddContextArtifactsAndExecutionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1addcontextartifactsandexecutionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1addcontextartifactsandexecutionsrequest) if err != nil { return nil, err } @@ -71969,8 +71680,7 @@ func (c *ProjectsLocationsMetadataStoresContextsAddContextChildrenCall) Header() func (c *ProjectsLocationsMetadataStoresContextsAddContextChildrenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1addcontextchildrenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1addcontextchildrenrequest) if err != nil { return nil, err } @@ -72086,8 +71796,7 @@ func (c *ProjectsLocationsMetadataStoresContextsCreateCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1context) if err != nil { return nil, err } @@ -72203,12 +71912,11 @@ func (c *ProjectsLocationsMetadataStoresContextsDeleteCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -72313,12 +72021,11 @@ func (c *ProjectsLocationsMetadataStoresContextsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72475,12 +72182,11 @@ func (c *ProjectsLocationsMetadataStoresContextsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72608,8 +72314,7 @@ func (c *ProjectsLocationsMetadataStoresContextsPatchCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1context) if err != nil { return nil, err } @@ -72711,8 +72416,7 @@ func (c *ProjectsLocationsMetadataStoresContextsPurgeCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1purgecontextsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1purgecontextsrequest) if err != nil { return nil, err } @@ -72830,12 +72534,11 @@ func (c *ProjectsLocationsMetadataStoresContextsQueryContextLineageSubgraphCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+context}:queryContextLineageSubgraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72932,8 +72635,7 @@ func (c *ProjectsLocationsMetadataStoresContextsRemoveContextChildrenCall) Heade func (c *ProjectsLocationsMetadataStoresContextsRemoveContextChildrenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1removecontextchildrenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1removecontextchildrenrequest) if err != nil { return nil, err } @@ -73040,12 +72742,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsCancelCall) Header() h func (c *ProjectsLocationsMetadataStoresContextsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -73139,12 +72840,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsDeleteCall) Header() h func (c *ProjectsLocationsMetadataStoresContextsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -73249,12 +72949,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -73378,12 +73077,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -73512,12 +73210,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsWaitCall) Header() htt func (c *ProjectsLocationsMetadataStoresContextsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -73616,8 +73313,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsAddExecutionEventsCall) Header func (c *ProjectsLocationsMetadataStoresExecutionsAddExecutionEventsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1addexecutioneventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1addexecutioneventsrequest) if err != nil { return nil, err } @@ -73733,8 +73429,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsCreateCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresExecutionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1execution) if err != nil { return nil, err } @@ -73843,12 +73538,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsDeleteCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -73953,12 +73647,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -74116,12 +73809,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -74249,8 +73941,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsPatchCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresExecutionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1execution) if err != nil { return nil, err } @@ -74352,8 +74043,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsPurgeCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresExecutionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1purgeexecutionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1purgeexecutionsrequest) if err != nil { return nil, err } @@ -74469,12 +74159,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsQueryExecutionInputsAndOutputs if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+execution}:queryExecutionInputsAndOutputs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -74573,12 +74262,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsCancelCall) Header() func (c *ProjectsLocationsMetadataStoresExecutionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -74672,12 +74360,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsDeleteCall) Header() func (c *ProjectsLocationsMetadataStoresExecutionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -74782,12 +74469,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -74911,12 +74597,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75045,12 +74730,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsWaitCall) Header() h func (c *ProjectsLocationsMetadataStoresExecutionsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -75158,8 +74842,7 @@ func (c *ProjectsLocationsMetadataStoresMetadataSchemasCreateCall) Header() http func (c *ProjectsLocationsMetadataStoresMetadataSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1metadataschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1metadataschema) if err != nil { return nil, err } @@ -75272,12 +74955,11 @@ func (c *ProjectsLocationsMetadataStoresMetadataSchemasGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75406,12 +75088,11 @@ func (c *ProjectsLocationsMetadataStoresMetadataSchemasListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/metadataSchemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75531,12 +75212,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsCancelCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -75630,12 +75310,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsDeleteCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -75740,12 +75419,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75869,12 +75547,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -76003,12 +75680,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76103,8 +75779,7 @@ func (c *ProjectsLocationsMigratableResourcesBatchMigrateCall) Header() http.Hea func (c *ProjectsLocationsMigratableResourcesBatchMigrateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchmigrateresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchmigrateresourcesrequest) if err != nil { return nil, err } @@ -76210,8 +75885,7 @@ func (c *ProjectsLocationsMigratableResourcesSearchCall) Header() http.Header { func (c *ProjectsLocationsMigratableResourcesSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1searchmigratableresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1searchmigratableresourcesrequest) if err != nil { return nil, err } @@ -76339,12 +76013,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsCancelCall) Header() http func (c *ProjectsLocationsMigratableResourcesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76438,12 +76111,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsDeleteCall) Header() http func (c *ProjectsLocationsMigratableResourcesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -76548,12 +76220,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -76677,12 +76348,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -76811,12 +76481,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsWaitCall) Header() http.H func (c *ProjectsLocationsMigratableResourcesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76911,8 +76580,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsCreateCall) Header() http func (c *ProjectsLocationsModelDeploymentMonitoringJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1modeldeploymentmonitoringjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1modeldeploymentmonitoringjob) if err != nil { return nil, err } @@ -77013,12 +76681,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsDeleteCall) Header() http func (c *ProjectsLocationsModelDeploymentMonitoringJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -77123,12 +76790,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -77269,12 +76935,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/modelDeploymentMonitoringJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -77415,8 +77080,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsPatchCall) Header() http. func (c *ProjectsLocationsModelDeploymentMonitoringJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1modeldeploymentmonitoringjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1modeldeploymentmonitoringjob) if err != nil { return nil, err } @@ -77522,8 +77186,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsPauseCall) Header() http. func (c *ProjectsLocationsModelDeploymentMonitoringJobsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1pausemodeldeploymentmonitoringjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1pausemodeldeploymentmonitoringjobrequest) if err != nil { return nil, err } @@ -77629,8 +77292,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsResumeCall) Header() http func (c *ProjectsLocationsModelDeploymentMonitoringJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1resumemodeldeploymentmonitoringjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1resumemodeldeploymentmonitoringjobrequest) if err != nil { return nil, err } @@ -77735,8 +77397,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsSearchModelDeploymentMoni func (c *ProjectsLocationsModelDeploymentMonitoringJobsSearchModelDeploymentMonitoringStatsAnomaliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1searchmodeldeploymentmonitoringstatsanomaliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1searchmodeldeploymentmonitoringstatsanomaliesrequest) if err != nil { return nil, err } @@ -77866,12 +77527,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsCancelCall) Hea func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -77965,12 +77625,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsDeleteCall) Hea func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -78075,12 +77734,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsGetCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -78204,12 +77862,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -78338,12 +77995,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsWaitCall) Heade func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -78441,8 +78097,7 @@ func (c *ProjectsLocationsModelsCopyCall) Header() http.Header { func (c *ProjectsLocationsModelsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1copymodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1copymodelrequest) if err != nil { return nil, err } @@ -78543,12 +78198,11 @@ func (c *ProjectsLocationsModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -78643,12 +78297,11 @@ func (c *ProjectsLocationsModelsDeleteVersionCall) Header() http.Header { func (c *ProjectsLocationsModelsDeleteVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteVersion") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -78745,8 +78398,7 @@ func (c *ProjectsLocationsModelsExportCall) Header() http.Header { func (c *ProjectsLocationsModelsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1exportmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1exportmodelrequest) if err != nil { return nil, err } @@ -78866,12 +78518,11 @@ func (c *ProjectsLocationsModelsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -78982,12 +78633,11 @@ func (c *ProjectsLocationsModelsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsModelsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -79137,12 +78787,11 @@ func (c *ProjectsLocationsModelsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -79308,12 +78957,11 @@ func (c *ProjectsLocationsModelsListVersionsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -79429,8 +79077,7 @@ func (c *ProjectsLocationsModelsMergeVersionAliasesCall) Header() http.Header { func (c *ProjectsLocationsModelsMergeVersionAliasesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1mergeversionaliasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1mergeversionaliasesrequest) if err != nil { return nil, err } @@ -79539,8 +79186,7 @@ func (c *ProjectsLocationsModelsPatchCall) Header() http.Header { func (c *ProjectsLocationsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1model) if err != nil { return nil, err } @@ -79645,8 +79291,7 @@ func (c *ProjectsLocationsModelsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsModelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -79761,12 +79406,11 @@ func (c *ProjectsLocationsModelsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsModelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -79861,8 +79505,7 @@ func (c *ProjectsLocationsModelsUpdateExplanationDatasetCall) Header() http.Head func (c *ProjectsLocationsModelsUpdateExplanationDatasetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1updateexplanationdatasetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1updateexplanationdatasetrequest) if err != nil { return nil, err } @@ -79964,8 +79607,7 @@ func (c *ProjectsLocationsModelsUploadCall) Header() http.Header { func (c *ProjectsLocationsModelsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1uploadmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1uploadmodelrequest) if err != nil { return nil, err } @@ -80078,12 +79720,11 @@ func (c *ProjectsLocationsModelsEvaluationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80177,8 +79818,7 @@ func (c *ProjectsLocationsModelsEvaluationsImportCall) Header() http.Header { func (c *ProjectsLocationsModelsEvaluationsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1importmodelevaluationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1importmodelevaluationrequest) if err != nil { return nil, err } @@ -80318,12 +79958,11 @@ func (c *ProjectsLocationsModelsEvaluationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80443,12 +80082,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsCancelCall) Header() http.H func (c *ProjectsLocationsModelsEvaluationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -80542,12 +80180,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsDeleteCall) Header() http.H func (c *ProjectsLocationsModelsEvaluationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -80652,12 +80289,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80781,12 +80417,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80915,12 +80550,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsWaitCall) Header() http.Hea func (c *ProjectsLocationsModelsEvaluationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -81015,8 +80649,7 @@ func (c *ProjectsLocationsModelsEvaluationsSlicesBatchImportCall) Header() http. func (c *ProjectsLocationsModelsEvaluationsSlicesBatchImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchimportevaluatedannotationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchimportevaluatedannotationsrequest) if err != nil { return nil, err } @@ -81129,12 +80762,11 @@ func (c *ProjectsLocationsModelsEvaluationsSlicesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81270,12 +80902,11 @@ func (c *ProjectsLocationsModelsEvaluationsSlicesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/slices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81395,12 +81026,11 @@ func (c *ProjectsLocationsModelsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsModelsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -81494,12 +81124,11 @@ func (c *ProjectsLocationsModelsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsModelsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -81604,12 +81233,11 @@ func (c *ProjectsLocationsModelsOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81733,12 +81361,11 @@ func (c *ProjectsLocationsModelsOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81867,12 +81494,11 @@ func (c *ProjectsLocationsModelsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsModelsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -81973,8 +81599,7 @@ func (c *ProjectsLocationsNasJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsNasJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cancelnasjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cancelnasjobrequest) if err != nil { return nil, err } @@ -82076,8 +81701,7 @@ func (c *ProjectsLocationsNasJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsNasJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1nasjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1nasjob) if err != nil { return nil, err } @@ -82177,12 +81801,11 @@ func (c *ProjectsLocationsNasJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsNasJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -82286,12 +81909,11 @@ func (c *ProjectsLocationsNasJobsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82433,12 +82055,11 @@ func (c *ProjectsLocationsNasJobsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nasJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82564,12 +82185,11 @@ func (c *ProjectsLocationsNasJobsNasTrialDetailsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82688,12 +82308,11 @@ func (c *ProjectsLocationsNasJobsNasTrialDetailsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nasTrialDetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82815,8 +82434,7 @@ func (c *ProjectsLocationsNotebookExecutionJobsCreateCall) Header() http.Header func (c *ProjectsLocationsNotebookExecutionJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1notebookexecutionjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1notebookexecutionjob) if err != nil { return nil, err } @@ -82915,12 +82533,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsDeleteCall) Header() http.Header func (c *ProjectsLocationsNotebookExecutionJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -83042,12 +82659,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -83208,12 +82824,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookExecutionJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -83333,12 +82948,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Header() ht func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -83432,12 +83046,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Header() ht func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -83542,12 +83155,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -83671,12 +83283,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -83805,12 +83416,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Header() http func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -83912,8 +83522,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Header() http.Head func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1notebookruntimetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1notebookruntimetemplate) if err != nil { return nil, err } @@ -84015,12 +83624,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Header() http.Head func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -84125,12 +83733,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -84241,12 +83848,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesGetIamPolicyCall) Header() htt func (c *ProjectsLocationsNotebookRuntimeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -84403,12 +84009,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -84531,8 +84136,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesPatchCall) Header() http.Heade func (c *ProjectsLocationsNotebookRuntimeTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1notebookruntimetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1notebookruntimetemplate) if err != nil { return nil, err } @@ -84637,8 +84241,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesSetIamPolicyCall) Header() htt func (c *ProjectsLocationsNotebookRuntimeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -84753,12 +84356,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesTestIamPermissionsCall) Header func (c *ProjectsLocationsNotebookRuntimeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -84857,12 +84459,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Header() func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -84956,12 +84557,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Header() func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -85066,12 +84666,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85195,12 +84794,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85329,12 +84927,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Header() h func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -85430,8 +85027,7 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1assignnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1assignnotebookruntimerequest) if err != nil { return nil, err } @@ -85533,12 +85129,11 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -85644,12 +85239,11 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85814,12 +85408,11 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85936,8 +85529,7 @@ func (c *ProjectsLocationsNotebookRuntimesStartCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1startnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1startnotebookruntimerequest) if err != nil { return nil, err } @@ -86041,8 +85633,7 @@ func (c *ProjectsLocationsNotebookRuntimesStopCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1stopnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1stopnotebookruntimerequest) if err != nil { return nil, err } @@ -86146,8 +85737,7 @@ func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1upgradenotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1upgradenotebookruntimerequest) if err != nil { return nil, err } @@ -86254,12 +85844,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Header() http.He func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -86353,12 +85942,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Header() http.He func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -86463,12 +86051,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -86592,12 +86179,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -86726,12 +86312,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Header() http.Head func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -86830,12 +86415,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -86929,12 +86513,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -87039,12 +86622,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87168,12 +86750,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87302,12 +86883,11 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -87411,8 +86991,7 @@ func (c *ProjectsLocationsPersistentResourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1persistentresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1persistentresource) if err != nil { return nil, err } @@ -87513,12 +87092,11 @@ func (c *ProjectsLocationsPersistentResourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -87623,12 +87201,11 @@ func (c *ProjectsLocationsPersistentResourcesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87748,12 +87325,11 @@ func (c *ProjectsLocationsPersistentResourcesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/persistentResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87876,8 +87452,7 @@ func (c *ProjectsLocationsPersistentResourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1persistentresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1persistentresource) if err != nil { return nil, err } @@ -87980,8 +87555,7 @@ func (c *ProjectsLocationsPersistentResourcesRebootCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesRebootCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1rebootpersistentresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1rebootpersistentresourcerequest) if err != nil { return nil, err } @@ -88088,12 +87662,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsCancelCall) Header() http func (c *ProjectsLocationsPersistentResourcesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -88187,12 +87760,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsDeleteCall) Header() http func (c *ProjectsLocationsPersistentResourcesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -88297,12 +87869,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -88426,12 +87997,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -88560,12 +88130,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsWaitCall) Header() http.H func (c *ProjectsLocationsPersistentResourcesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -88664,8 +88233,7 @@ func (c *ProjectsLocationsPipelineJobsBatchCancelCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsBatchCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchcancelpipelinejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchcancelpipelinejobsrequest) if err != nil { return nil, err } @@ -88769,8 +88337,7 @@ func (c *ProjectsLocationsPipelineJobsBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchdeletepipelinejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchdeletepipelinejobsrequest) if err != nil { return nil, err } @@ -88879,8 +88446,7 @@ func (c *ProjectsLocationsPipelineJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1cancelpipelinejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1cancelpipelinejobrequest) if err != nil { return nil, err } @@ -88992,8 +88558,7 @@ func (c *ProjectsLocationsPipelineJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1pipelinejob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1pipelinejob) if err != nil { return nil, err } @@ -89093,12 +88658,11 @@ func (c *ProjectsLocationsPipelineJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -89202,12 +88766,11 @@ func (c *ProjectsLocationsPipelineJobsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89374,12 +88937,11 @@ func (c *ProjectsLocationsPipelineJobsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pipelineJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89499,12 +89061,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsCancelCall) Header() http.Header func (c *ProjectsLocationsPipelineJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -89598,12 +89159,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsDeleteCall) Header() http.Header func (c *ProjectsLocationsPipelineJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -89708,12 +89268,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89837,12 +89396,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89971,12 +89529,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -90070,8 +89627,7 @@ func (c *ProjectsLocationsPublishersModelsComputeTokensCall) Header() http.Heade func (c *ProjectsLocationsPublishersModelsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1computetokensrequest) if err != nil { return nil, err } @@ -90173,8 +89729,7 @@ func (c *ProjectsLocationsPublishersModelsCountTokensCall) Header() http.Header func (c *ProjectsLocationsPublishersModelsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1counttokensrequest) if err != nil { return nil, err } @@ -90278,8 +89833,7 @@ func (c *ProjectsLocationsPublishersModelsFetchPredictOperationCall) Header() ht func (c *ProjectsLocationsPublishersModelsFetchPredictOperationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1fetchpredictoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1fetchpredictoperationrequest) if err != nil { return nil, err } @@ -90384,8 +89938,7 @@ func (c *ProjectsLocationsPublishersModelsGenerateContentCall) Header() http.Hea func (c *ProjectsLocationsPublishersModelsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -90487,8 +90040,7 @@ func (c *ProjectsLocationsPublishersModelsPredictCall) Header() http.Header { func (c *ProjectsLocationsPublishersModelsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1predictrequest) if err != nil { return nil, err } @@ -90592,8 +90144,7 @@ func (c *ProjectsLocationsPublishersModelsPredictLongRunningCall) Header() http. func (c *ProjectsLocationsPublishersModelsPredictLongRunningCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1predictlongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1predictlongrunningrequest) if err != nil { return nil, err } @@ -90699,8 +90250,7 @@ func (c *ProjectsLocationsPublishersModelsRawPredictCall) Header() http.Header { func (c *ProjectsLocationsPublishersModelsRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1rawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1rawpredictrequest) if err != nil { return nil, err } @@ -90803,8 +90353,7 @@ func (c *ProjectsLocationsPublishersModelsServerStreamingPredictCall) Header() h func (c *ProjectsLocationsPublishersModelsServerStreamingPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1streamingpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1streamingpredictrequest) if err != nil { return nil, err } @@ -90910,8 +90459,7 @@ func (c *ProjectsLocationsPublishersModelsStreamGenerateContentCall) Header() ht func (c *ProjectsLocationsPublishersModelsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -91014,8 +90562,7 @@ func (c *ProjectsLocationsPublishersModelsStreamRawPredictCall) Header() http.He func (c *ProjectsLocationsPublishersModelsStreamRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1streamrawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1streamrawpredictrequest) if err != nil { return nil, err } @@ -91117,8 +90664,7 @@ func (c *ProjectsLocationsRagCorporaCreateCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1ragcorpus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1ragcorpus) if err != nil { return nil, err } @@ -91226,12 +90772,11 @@ func (c *ProjectsLocationsRagCorporaDeleteCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -91335,12 +90880,11 @@ func (c *ProjectsLocationsRagCorporaGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -91459,12 +91003,11 @@ func (c *ProjectsLocationsRagCorporaListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/ragCorpora") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -91578,8 +91121,7 @@ func (c *ProjectsLocationsRagCorporaPatchCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1ragcorpus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1ragcorpus) if err != nil { return nil, err } @@ -91686,12 +91228,11 @@ func (c *ProjectsLocationsRagCorporaOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -91785,12 +91326,11 @@ func (c *ProjectsLocationsRagCorporaOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -91895,12 +91435,11 @@ func (c *ProjectsLocationsRagCorporaOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92024,12 +91563,11 @@ func (c *ProjectsLocationsRagCorporaOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92158,12 +91696,11 @@ func (c *ProjectsLocationsRagCorporaOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -92256,12 +91793,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaRagFilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -92366,12 +91902,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92466,8 +92001,7 @@ func (c *ProjectsLocationsRagCorporaRagFilesImportCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaRagFilesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1importragfilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1importragfilesrequest) if err != nil { return nil, err } @@ -92595,12 +92129,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/ragFiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92720,12 +92253,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsCancelCall) Header() http. func (c *ProjectsLocationsRagCorporaRagFilesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -92819,12 +92351,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsDeleteCall) Header() http. func (c *ProjectsLocationsRagCorporaRagFilesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -92929,12 +92460,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -93058,12 +92588,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -93192,12 +92721,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsWaitCall) Header() http.He func (c *ProjectsLocationsRagCorporaRagFilesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -93291,8 +92819,7 @@ func (c *ProjectsLocationsReasoningEnginesCreateCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1reasoningengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1reasoningengine) if err != nil { return nil, err } @@ -93393,12 +92920,11 @@ func (c *ProjectsLocationsReasoningEnginesDeleteCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -93503,12 +93029,11 @@ func (c *ProjectsLocationsReasoningEnginesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -93633,12 +93158,11 @@ func (c *ProjectsLocationsReasoningEnginesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reasoningEngines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -93759,8 +93283,7 @@ func (c *ProjectsLocationsReasoningEnginesPatchCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1reasoningengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1reasoningengine) if err != nil { return nil, err } @@ -93863,8 +93386,7 @@ func (c *ProjectsLocationsReasoningEnginesQueryCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1queryreasoningenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1queryreasoningenginerequest) if err != nil { return nil, err } @@ -93971,12 +93493,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsCancelCall) Header() http.He func (c *ProjectsLocationsReasoningEnginesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -94070,12 +93591,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsDeleteCall) Header() http.He func (c *ProjectsLocationsReasoningEnginesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -94180,12 +93700,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94309,12 +93828,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94443,12 +93961,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsWaitCall) Header() http.Head func (c *ProjectsLocationsReasoningEnginesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -94542,8 +94059,7 @@ func (c *ProjectsLocationsSchedulesCreateCall) Header() http.Header { func (c *ProjectsLocationsSchedulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1schedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1schedule) if err != nil { return nil, err } @@ -94643,12 +94159,11 @@ func (c *ProjectsLocationsSchedulesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSchedulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -94752,12 +94267,11 @@ func (c *ProjectsLocationsSchedulesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94913,12 +94427,11 @@ func (c *ProjectsLocationsSchedulesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schedules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -95043,8 +94556,7 @@ func (c *ProjectsLocationsSchedulesPatchCall) Header() http.Header { func (c *ProjectsLocationsSchedulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1schedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1schedule) if err != nil { return nil, err } @@ -95148,8 +94660,7 @@ func (c *ProjectsLocationsSchedulesPauseCall) Header() http.Header { func (c *ProjectsLocationsSchedulesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1pauseschedulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1pauseschedulerequest) if err != nil { return nil, err } @@ -95256,8 +94767,7 @@ func (c *ProjectsLocationsSchedulesResumeCall) Header() http.Header { func (c *ProjectsLocationsSchedulesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1resumeschedulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1resumeschedulerequest) if err != nil { return nil, err } @@ -95364,12 +94874,11 @@ func (c *ProjectsLocationsSchedulesOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsSchedulesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -95463,12 +94972,11 @@ func (c *ProjectsLocationsSchedulesOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSchedulesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -95573,12 +95081,11 @@ func (c *ProjectsLocationsSchedulesOperationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -95702,12 +95209,11 @@ func (c *ProjectsLocationsSchedulesOperationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -95836,12 +95342,11 @@ func (c *ProjectsLocationsSchedulesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsSchedulesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -95935,8 +95440,7 @@ func (c *ProjectsLocationsSpecialistPoolsCreateCall) Header() http.Header { func (c *ProjectsLocationsSpecialistPoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1specialistpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1specialistpool) if err != nil { return nil, err } @@ -96044,12 +95548,11 @@ func (c *ProjectsLocationsSpecialistPoolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSpecialistPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -96154,12 +95657,11 @@ func (c *ProjectsLocationsSpecialistPoolsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96286,12 +95788,11 @@ func (c *ProjectsLocationsSpecialistPoolsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/specialistPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96412,8 +95913,7 @@ func (c *ProjectsLocationsSpecialistPoolsPatchCall) Header() http.Header { func (c *ProjectsLocationsSpecialistPoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1specialistpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1specialistpool) if err != nil { return nil, err } @@ -96520,12 +96020,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsCancelCall) Header() http.Hea func (c *ProjectsLocationsSpecialistPoolsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -96619,12 +96118,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsDeleteCall) Header() http.Hea func (c *ProjectsLocationsSpecialistPoolsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -96729,12 +96227,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96858,12 +96355,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96992,12 +96488,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsWaitCall) Header() http.Heade func (c *ProjectsLocationsSpecialistPoolsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -97092,8 +96587,7 @@ func (c *ProjectsLocationsStudiesCreateCall) Header() http.Header { func (c *ProjectsLocationsStudiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1study) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1study) if err != nil { return nil, err } @@ -97193,12 +96687,11 @@ func (c *ProjectsLocationsStudiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -97302,12 +96795,11 @@ func (c *ProjectsLocationsStudiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -97426,12 +96918,11 @@ func (c *ProjectsLocationsStudiesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/studies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -97547,8 +97038,7 @@ func (c *ProjectsLocationsStudiesLookupCall) Header() http.Header { func (c *ProjectsLocationsStudiesLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1lookupstudyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1lookupstudyrequest) if err != nil { return nil, err } @@ -97655,12 +97145,11 @@ func (c *ProjectsLocationsStudiesOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsStudiesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -97754,12 +97243,11 @@ func (c *ProjectsLocationsStudiesOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -97864,12 +97352,11 @@ func (c *ProjectsLocationsStudiesOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -97993,12 +97480,11 @@ func (c *ProjectsLocationsStudiesOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -98127,12 +97613,11 @@ func (c *ProjectsLocationsStudiesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsStudiesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -98227,8 +97712,7 @@ func (c *ProjectsLocationsStudiesTrialsAddTrialMeasurementCall) Header() http.He func (c *ProjectsLocationsStudiesTrialsAddTrialMeasurementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1addtrialmeasurementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1addtrialmeasurementrequest) if err != nil { return nil, err } @@ -98332,8 +97816,7 @@ func (c *ProjectsLocationsStudiesTrialsCheckTrialEarlyStoppingStateCall) Header( func (c *ProjectsLocationsStudiesTrialsCheckTrialEarlyStoppingStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1checktrialearlystoppingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1checktrialearlystoppingstaterequest) if err != nil { return nil, err } @@ -98435,8 +97918,7 @@ func (c *ProjectsLocationsStudiesTrialsCompleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1completetrialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1completetrialrequest) if err != nil { return nil, err } @@ -98538,8 +98020,7 @@ func (c *ProjectsLocationsStudiesTrialsCreateCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1trial) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1trial) if err != nil { return nil, err } @@ -98639,12 +98120,11 @@ func (c *ProjectsLocationsStudiesTrialsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -98748,12 +98228,11 @@ func (c *ProjectsLocationsStudiesTrialsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -98872,12 +98351,11 @@ func (c *ProjectsLocationsStudiesTrialsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/trials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -98994,8 +98472,7 @@ func (c *ProjectsLocationsStudiesTrialsListOptimalTrialsCall) Header() http.Head func (c *ProjectsLocationsStudiesTrialsListOptimalTrialsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1listoptimaltrialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1listoptimaltrialsrequest) if err != nil { return nil, err } @@ -99097,8 +98574,7 @@ func (c *ProjectsLocationsStudiesTrialsStopCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1stoptrialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1stoptrialrequest) if err != nil { return nil, err } @@ -99203,8 +98679,7 @@ func (c *ProjectsLocationsStudiesTrialsSuggestCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsSuggestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1suggesttrialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1suggesttrialsrequest) if err != nil { return nil, err } @@ -99311,12 +98786,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsCancelCall) Header() http.Heade func (c *ProjectsLocationsStudiesTrialsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -99410,12 +98884,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsStudiesTrialsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -99520,12 +98993,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -99649,12 +99121,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -99783,12 +99254,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsStudiesTrialsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -99908,12 +99378,11 @@ func (c *ProjectsLocationsTensorboardsBatchReadCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+tensorboard}:batchRead") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100007,8 +99476,7 @@ func (c *ProjectsLocationsTensorboardsCreateCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboard) if err != nil { return nil, err } @@ -100108,12 +99576,11 @@ func (c *ProjectsLocationsTensorboardsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -100217,12 +99684,11 @@ func (c *ProjectsLocationsTensorboardsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100366,12 +99832,11 @@ func (c *ProjectsLocationsTensorboardsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tensorboards") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100497,8 +99962,7 @@ func (c *ProjectsLocationsTensorboardsPatchCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboard) if err != nil { return nil, err } @@ -100610,12 +100074,11 @@ func (c *ProjectsLocationsTensorboardsReadSizeCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+tensorboard}:readSize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100720,12 +100183,11 @@ func (c *ProjectsLocationsTensorboardsReadUsageCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+tensorboard}:readUsage") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100824,8 +100286,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsBatchCreateCall) Header() http. func (c *ProjectsLocationsTensorboardsExperimentsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchcreatetensorboardtimeseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchcreatetensorboardtimeseriesrequest) if err != nil { return nil, err } @@ -100938,8 +100399,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsCreateCall) Header() http.Heade func (c *ProjectsLocationsTensorboardsExperimentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboardexperiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboardexperiment) if err != nil { return nil, err } @@ -101040,12 +100500,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsDeleteCall) Header() http.Heade func (c *ProjectsLocationsTensorboardsExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -101150,12 +100609,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101300,12 +100758,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/experiments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101432,8 +100889,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsPatchCall) Header() http.Header func (c *ProjectsLocationsTensorboardsExperimentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboardexperiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboardexperiment) if err != nil { return nil, err } @@ -101539,8 +100995,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsWriteCall) Header() http.Header func (c *ProjectsLocationsTensorboardsExperimentsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1writetensorboardexperimentdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1writetensorboardexperimentdatarequest) if err != nil { return nil, err } @@ -101647,12 +101102,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsCancelCall) Header() func (c *ProjectsLocationsTensorboardsExperimentsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -101746,12 +101200,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsDeleteCall) Header() func (c *ProjectsLocationsTensorboardsExperimentsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -101856,12 +101309,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101985,12 +101437,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -102119,12 +101570,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsWaitCall) Header() ht func (c *ProjectsLocationsTensorboardsExperimentsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -102221,8 +101671,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsBatchCreateCall) Header() h func (c *ProjectsLocationsTensorboardsExperimentsRunsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1batchcreatetensorboardrunsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1batchcreatetensorboardrunsrequest) if err != nil { return nil, err } @@ -102335,8 +101784,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsCreateCall) Header() http.H func (c *ProjectsLocationsTensorboardsExperimentsRunsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboardrun) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboardrun) if err != nil { return nil, err } @@ -102437,12 +101885,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsDeleteCall) Header() http.H func (c *ProjectsLocationsTensorboardsExperimentsRunsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -102547,12 +101994,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -102698,12 +102144,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -102830,8 +102275,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsPatchCall) Header() http.He func (c *ProjectsLocationsTensorboardsExperimentsRunsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboardrun) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboardrun) if err != nil { return nil, err } @@ -102937,8 +102381,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsWriteCall) Header() http.He func (c *ProjectsLocationsTensorboardsExperimentsRunsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1writetensorboardrundatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1writetensorboardrundatarequest) if err != nil { return nil, err } @@ -103047,12 +102490,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsCancelCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -103146,12 +102588,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsDeleteCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -103256,12 +102697,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -103385,12 +102825,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -103519,12 +102958,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsWaitCall) Header( func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -103630,8 +103068,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesCreateCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboardtimeseries) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboardtimeseries) if err != nil { return nil, err } @@ -103732,12 +103169,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesDeleteCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -103834,8 +103270,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesExportTensorboard func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesExportTensorboardTimeSeriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1exporttensorboardtimeseriesdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1exporttensorboardtimeseriesdatarequest) if err != nil { return nil, err } @@ -103969,12 +103404,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -104120,12 +103554,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/timeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -104250,8 +103683,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesPatchCall) Header func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tensorboardtimeseries) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tensorboardtimeseries) if err != nil { return nil, err } @@ -104383,12 +103815,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesReadCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+tensorboardTimeSeries}:read") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -104502,12 +103933,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesReadBlobDataCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+timeSeries}:readBlobData") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -104608,12 +104038,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsCancelC func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -104707,12 +104136,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsDeleteC func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -104817,12 +104245,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -104946,12 +104373,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -105080,12 +104506,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsWaitCal func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -105184,12 +104609,11 @@ func (c *ProjectsLocationsTensorboardsOperationsCancelCall) Header() http.Header func (c *ProjectsLocationsTensorboardsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -105283,12 +104707,11 @@ func (c *ProjectsLocationsTensorboardsOperationsDeleteCall) Header() http.Header func (c *ProjectsLocationsTensorboardsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -105393,12 +104816,11 @@ func (c *ProjectsLocationsTensorboardsOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -105522,12 +104944,11 @@ func (c *ProjectsLocationsTensorboardsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -105656,12 +105077,11 @@ func (c *ProjectsLocationsTensorboardsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -105764,8 +105184,7 @@ func (c *ProjectsLocationsTrainingPipelinesCancelCall) Header() http.Header { func (c *ProjectsLocationsTrainingPipelinesCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1canceltrainingpipelinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1canceltrainingpipelinerequest) if err != nil { return nil, err } @@ -105868,8 +105287,7 @@ func (c *ProjectsLocationsTrainingPipelinesCreateCall) Header() http.Header { func (c *ProjectsLocationsTrainingPipelinesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1trainingpipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1trainingpipeline) if err != nil { return nil, err } @@ -105970,12 +105388,11 @@ func (c *ProjectsLocationsTrainingPipelinesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTrainingPipelinesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -106080,12 +105497,11 @@ func (c *ProjectsLocationsTrainingPipelinesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106228,12 +105644,11 @@ func (c *ProjectsLocationsTrainingPipelinesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/trainingPipelines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106353,12 +105768,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsCancelCall) Header() http.H func (c *ProjectsLocationsTrainingPipelinesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -106452,12 +105866,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsDeleteCall) Header() http.H func (c *ProjectsLocationsTrainingPipelinesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -106562,12 +105975,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106691,12 +106103,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106825,12 +106236,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsWaitCall) Header() http.Hea func (c *ProjectsLocationsTrainingPipelinesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -106931,8 +106341,7 @@ func (c *ProjectsLocationsTuningJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1canceltuningjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1canceltuningjobrequest) if err != nil { return nil, err } @@ -107035,8 +106444,7 @@ func (c *ProjectsLocationsTuningJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1tuningjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1tuningjob) if err != nil { return nil, err } @@ -107148,12 +106556,11 @@ func (c *ProjectsLocationsTuningJobsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107278,12 +106685,11 @@ func (c *ProjectsLocationsTuningJobsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tuningJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107398,8 +106804,7 @@ func (c *ProjectsLocationsTuningJobsRebaseTunedModelCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsRebaseTunedModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1rebasetunedmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1rebasetunedmodelrequest) if err != nil { return nil, err } @@ -107506,12 +106911,11 @@ func (c *ProjectsLocationsTuningJobsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -107605,12 +107009,11 @@ func (c *ProjectsLocationsTuningJobsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -107715,12 +107118,11 @@ func (c *ProjectsLocationsTuningJobsOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107844,12 +107246,11 @@ func (c *ProjectsLocationsTuningJobsOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107964,8 +107365,7 @@ func (c *PublishersModelsComputeTokensCall) Header() http.Header { func (c *PublishersModelsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1computetokensrequest) if err != nil { return nil, err } @@ -108067,8 +107467,7 @@ func (c *PublishersModelsCountTokensCall) Header() http.Header { func (c *PublishersModelsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1counttokensrequest) if err != nil { return nil, err } @@ -108173,8 +107572,7 @@ func (c *PublishersModelsGenerateContentCall) Header() http.Header { func (c *PublishersModelsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } @@ -108330,12 +107728,11 @@ func (c *PublishersModelsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -108433,8 +107830,7 @@ func (c *PublishersModelsStreamGenerateContentCall) Header() http.Header { func (c *PublishersModelsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1generatecontentrequest) if err != nil { return nil, err } diff --git a/aiplatform/v1beta1/aiplatform-gen.go b/aiplatform/v1beta1/aiplatform-gen.go index 02af4f316af..3e770ebd80b 100644 --- a/aiplatform/v1beta1/aiplatform-gen.go +++ b/aiplatform/v1beta1/aiplatform-gen.go @@ -125,7 +125,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Datasets = NewDatasetsService(s) + s.Endpoints = NewEndpointsService(s) + s.Media = NewMediaService(s) + s.Projects = NewProjectsService(s) + s.Publishers = NewPublishersService(s) if err != nil { return nil, err } @@ -144,13 +149,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Datasets = NewDatasetsService(s) - s.Endpoints = NewEndpointsService(s) - s.Media = NewMediaService(s) - s.Projects = NewProjectsService(s) - s.Publishers = NewPublishersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -43536,8 +43535,7 @@ func (c *DatasetsCreateCall) Header() http.Header { func (c *DatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1dataset) if err != nil { return nil, err } @@ -43634,12 +43632,11 @@ func (c *DatasetsDeleteCall) Header() http.Header { func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43749,12 +43746,11 @@ func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43902,12 +43898,11 @@ func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44027,8 +44022,7 @@ func (c *DatasetsPatchCall) Header() http.Header { func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1dataset) if err != nil { return nil, err } @@ -44130,8 +44124,7 @@ func (c *DatasetsDatasetVersionsCreateCall) Header() http.Header { func (c *DatasetsDatasetVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1datasetversion) if err != nil { return nil, err } @@ -44232,12 +44225,11 @@ func (c *DatasetsDatasetVersionsDeleteCall) Header() http.Header { func (c *DatasetsDatasetVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44349,12 +44341,11 @@ func (c *DatasetsDatasetVersionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44493,12 +44484,11 @@ func (c *DatasetsDatasetVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/datasetVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44620,8 +44610,7 @@ func (c *DatasetsDatasetVersionsPatchCall) Header() http.Header { func (c *DatasetsDatasetVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1datasetversion) if err != nil { return nil, err } @@ -44734,12 +44723,11 @@ func (c *DatasetsDatasetVersionsRestoreCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44833,8 +44821,7 @@ func (c *EndpointsComputeTokensCall) Header() http.Header { func (c *EndpointsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1computetokensrequest) if err != nil { return nil, err } @@ -44936,8 +44923,7 @@ func (c *EndpointsCountTokensCall) Header() http.Header { func (c *EndpointsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1counttokensrequest) if err != nil { return nil, err } @@ -45042,8 +45028,7 @@ func (c *EndpointsGenerateContentCall) Header() http.Header { func (c *EndpointsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -45149,8 +45134,7 @@ func (c *EndpointsStreamGenerateContentCall) Header() http.Header { func (c *EndpointsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -45291,8 +45275,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1uploadragfilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1uploadragfilerequest) if err != nil { return nil, err } @@ -45303,14 +45286,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1beta1/{+parent}/ragFiles:upload") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -45432,12 +45411,11 @@ func (c *ProjectsGetCacheConfigCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45531,8 +45509,7 @@ func (c *ProjectsUpdateCacheConfigCall) Header() http.Header { func (c *ProjectsUpdateCacheConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cacheconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cacheconfig) if err != nil { return nil, err } @@ -45636,8 +45613,7 @@ func (c *ProjectsLocationsAugmentPromptCall) Header() http.Header { func (c *ProjectsLocationsAugmentPromptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1augmentpromptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1augmentpromptrequest) if err != nil { return nil, err } @@ -45742,8 +45718,7 @@ func (c *ProjectsLocationsCorroborateContentCall) Header() http.Header { func (c *ProjectsLocationsCorroborateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1corroboratecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1corroboratecontentrequest) if err != nil { return nil, err } @@ -45847,8 +45822,7 @@ func (c *ProjectsLocationsDeployCall) Header() http.Header { func (c *ProjectsLocationsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1deploypublishermodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1deploypublishermodelrequest) if err != nil { return nil, err } @@ -45950,8 +45924,7 @@ func (c *ProjectsLocationsEvaluateInstancesCall) Header() http.Header { func (c *ProjectsLocationsEvaluateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1evaluateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1evaluateinstancesrequest) if err != nil { return nil, err } @@ -46062,12 +46035,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46194,12 +46166,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46315,8 +46286,7 @@ func (c *ProjectsLocationsRetrieveContextsCall) Header() http.Header { func (c *ProjectsLocationsRetrieveContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1retrievecontextsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1retrievecontextsrequest) if err != nil { return nil, err } @@ -46423,12 +46393,11 @@ func (c *ProjectsLocationsAgentsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsAgentsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -46522,12 +46491,11 @@ func (c *ProjectsLocationsAgentsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46632,12 +46600,11 @@ func (c *ProjectsLocationsAgentsOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46761,12 +46728,11 @@ func (c *ProjectsLocationsAgentsOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46895,12 +46861,11 @@ func (c *ProjectsLocationsAgentsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsAgentsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -46999,12 +46964,11 @@ func (c *ProjectsLocationsAppsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsAppsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47098,12 +47062,11 @@ func (c *ProjectsLocationsAppsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47208,12 +47171,11 @@ func (c *ProjectsLocationsAppsOperationsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47337,12 +47299,11 @@ func (c *ProjectsLocationsAppsOperationsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47471,12 +47432,11 @@ func (c *ProjectsLocationsAppsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsAppsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47578,8 +47538,7 @@ func (c *ProjectsLocationsBatchPredictionJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsBatchPredictionJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cancelbatchpredictionjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cancelbatchpredictionjobrequest) if err != nil { return nil, err } @@ -47682,8 +47641,7 @@ func (c *ProjectsLocationsBatchPredictionJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsBatchPredictionJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchpredictionjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchpredictionjob) if err != nil { return nil, err } @@ -47785,12 +47743,11 @@ func (c *ProjectsLocationsBatchPredictionJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBatchPredictionJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47895,12 +47852,11 @@ func (c *ProjectsLocationsBatchPredictionJobsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48043,12 +47999,11 @@ func (c *ProjectsLocationsBatchPredictionJobsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/batchPredictionJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48163,8 +48118,7 @@ func (c *ProjectsLocationsCachedContentsCreateCall) Header() http.Header { func (c *ProjectsLocationsCachedContentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cachedcontent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cachedcontent) if err != nil { return nil, err } @@ -48263,12 +48217,11 @@ func (c *ProjectsLocationsCachedContentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCachedContentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48371,12 +48324,11 @@ func (c *ProjectsLocationsCachedContentsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48497,12 +48449,11 @@ func (c *ProjectsLocationsCachedContentsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/cachedContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48627,8 +48578,7 @@ func (c *ProjectsLocationsCachedContentsPatchCall) Header() http.Header { func (c *ProjectsLocationsCachedContentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cachedcontent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cachedcontent) if err != nil { return nil, err } @@ -48737,8 +48687,7 @@ func (c *ProjectsLocationsCustomJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cancelcustomjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cancelcustomjobrequest) if err != nil { return nil, err } @@ -48841,8 +48790,7 @@ func (c *ProjectsLocationsCustomJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1customjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1customjob) if err != nil { return nil, err } @@ -48942,12 +48890,11 @@ func (c *ProjectsLocationsCustomJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49051,12 +48998,11 @@ func (c *ProjectsLocationsCustomJobsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49198,12 +49144,11 @@ func (c *ProjectsLocationsCustomJobsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/customJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49323,12 +49268,11 @@ func (c *ProjectsLocationsCustomJobsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49422,12 +49366,11 @@ func (c *ProjectsLocationsCustomJobsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49532,12 +49475,11 @@ func (c *ProjectsLocationsCustomJobsOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49661,12 +49603,11 @@ func (c *ProjectsLocationsCustomJobsOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49795,12 +49736,11 @@ func (c *ProjectsLocationsCustomJobsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsCustomJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49896,8 +49836,7 @@ func (c *ProjectsLocationsDataLabelingJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsDataLabelingJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1canceldatalabelingjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1canceldatalabelingjobrequest) if err != nil { return nil, err } @@ -49999,8 +49938,7 @@ func (c *ProjectsLocationsDataLabelingJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataLabelingJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1datalabelingjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1datalabelingjob) if err != nil { return nil, err } @@ -50101,12 +50039,11 @@ func (c *ProjectsLocationsDataLabelingJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataLabelingJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50211,12 +50148,11 @@ func (c *ProjectsLocationsDataLabelingJobsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50368,12 +50304,11 @@ func (c *ProjectsLocationsDataLabelingJobsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataLabelingJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50493,12 +50428,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsCancelCall) Header() http.He func (c *ProjectsLocationsDataLabelingJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -50592,12 +50526,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsDeleteCall) Header() http.He func (c *ProjectsLocationsDataLabelingJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50702,12 +50635,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50831,12 +50763,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50965,12 +50896,11 @@ func (c *ProjectsLocationsDataLabelingJobsOperationsWaitCall) Header() http.Head func (c *ProjectsLocationsDataLabelingJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -51064,8 +50994,7 @@ func (c *ProjectsLocationsDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1dataset) if err != nil { return nil, err } @@ -51165,12 +51094,11 @@ func (c *ProjectsLocationsDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -51264,8 +51192,7 @@ func (c *ProjectsLocationsDatasetsExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1exportdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1exportdatarequest) if err != nil { return nil, err } @@ -51383,12 +51310,11 @@ func (c *ProjectsLocationsDatasetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51482,8 +51408,7 @@ func (c *ProjectsLocationsDatasetsImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1importdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1importdatarequest) if err != nil { return nil, err } @@ -51637,12 +51562,11 @@ func (c *ProjectsLocationsDatasetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51765,8 +51689,7 @@ func (c *ProjectsLocationsDatasetsPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1dataset) if err != nil { return nil, err } @@ -51991,12 +51914,11 @@ func (c *ProjectsLocationsDatasetsSearchDataItemsCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+dataset}:searchDataItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52129,12 +52051,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52233,12 +52154,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsCancelCall) Header() func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -52332,12 +52252,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsDeleteCall) Header() func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -52442,12 +52361,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52571,12 +52489,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52705,12 +52622,11 @@ func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsWaitCall) Header() ht func (c *ProjectsLocationsDatasetsAnnotationSpecsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -52849,12 +52765,11 @@ func (c *ProjectsLocationsDatasetsDataItemsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53018,12 +52933,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/annotations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53143,12 +53057,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsCancelCall) Head func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -53242,12 +53155,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsDeleteCall) Head func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -53352,12 +53264,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53481,12 +53392,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53615,12 +53525,11 @@ func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsWaitCall) Header func (c *ProjectsLocationsDatasetsDataItemsAnnotationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -53719,12 +53628,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsCancelCall) Header() http.H func (c *ProjectsLocationsDatasetsDataItemsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -53818,12 +53726,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsDeleteCall) Header() http.H func (c *ProjectsLocationsDatasetsDataItemsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -53928,12 +53835,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54057,12 +53963,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54191,12 +54096,11 @@ func (c *ProjectsLocationsDatasetsDataItemsOperationsWaitCall) Header() http.Hea func (c *ProjectsLocationsDatasetsDataItemsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -54290,8 +54194,7 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsCreateCall) Header() http.Heade func (c *ProjectsLocationsDatasetsDatasetVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1datasetversion) if err != nil { return nil, err } @@ -54392,12 +54295,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDatasetsDatasetVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -54509,12 +54411,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54653,12 +54554,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/datasetVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54780,8 +54680,7 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsPatchCall) Header() http.Header func (c *ProjectsLocationsDatasetsDatasetVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1datasetversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1datasetversion) if err != nil { return nil, err } @@ -54894,12 +54793,11 @@ func (c *ProjectsLocationsDatasetsDatasetVersionsRestoreCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54998,12 +54896,11 @@ func (c *ProjectsLocationsDatasetsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -55097,12 +54994,11 @@ func (c *ProjectsLocationsDatasetsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55207,12 +55103,11 @@ func (c *ProjectsLocationsDatasetsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55336,12 +55231,11 @@ func (c *ProjectsLocationsDatasetsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55470,12 +55364,11 @@ func (c *ProjectsLocationsDatasetsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -55568,12 +55461,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55712,12 +55604,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55837,12 +55728,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsCancelCall) Header() htt func (c *ProjectsLocationsDatasetsSavedQueriesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -55936,12 +55826,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsDeleteCall) Header() htt func (c *ProjectsLocationsDatasetsSavedQueriesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56046,12 +55935,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56175,12 +56063,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56309,12 +56196,11 @@ func (c *ProjectsLocationsDatasetsSavedQueriesOperationsWaitCall) Header() http. func (c *ProjectsLocationsDatasetsSavedQueriesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -56408,8 +56294,7 @@ func (c *ProjectsLocationsDeploymentResourcePoolsCreateCall) Header() http.Heade func (c *ProjectsLocationsDeploymentResourcePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1createdeploymentresourcepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1createdeploymentresourcepoolrequest) if err != nil { return nil, err } @@ -56510,12 +56395,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDeploymentResourcePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56620,12 +56504,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56747,12 +56630,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/deploymentResourcePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56875,8 +56757,7 @@ func (c *ProjectsLocationsDeploymentResourcePoolsPatchCall) Header() http.Header func (c *ProjectsLocationsDeploymentResourcePoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1deploymentresourcepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1deploymentresourcepool) if err != nil { return nil, err } @@ -57007,12 +56888,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsQueryDeployedModelsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+deploymentResourcePool}:queryDeployedModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57132,12 +57012,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsCancelCall) Header() func (c *ProjectsLocationsDeploymentResourcePoolsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57231,12 +57110,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsDeleteCall) Header() func (c *ProjectsLocationsDeploymentResourcePoolsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -57341,12 +57219,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57470,12 +57347,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57604,12 +57480,11 @@ func (c *ProjectsLocationsDeploymentResourcePoolsOperationsWaitCall) Header() ht func (c *ProjectsLocationsDeploymentResourcePoolsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57708,12 +57583,11 @@ func (c *ProjectsLocationsEdgeDevicesOperationsCancelCall) Header() http.Header func (c *ProjectsLocationsEdgeDevicesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57807,12 +57681,11 @@ func (c *ProjectsLocationsEdgeDevicesOperationsDeleteCall) Header() http.Header func (c *ProjectsLocationsEdgeDevicesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -57917,12 +57790,11 @@ func (c *ProjectsLocationsEdgeDevicesOperationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58046,12 +57918,11 @@ func (c *ProjectsLocationsEdgeDevicesOperationsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58180,12 +58051,11 @@ func (c *ProjectsLocationsEdgeDevicesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsEdgeDevicesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -58279,8 +58149,7 @@ func (c *ProjectsLocationsEndpointsComputeTokensCall) Header() http.Header { func (c *ProjectsLocationsEndpointsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1computetokensrequest) if err != nil { return nil, err } @@ -58382,8 +58251,7 @@ func (c *ProjectsLocationsEndpointsCountTokensCall) Header() http.Header { func (c *ProjectsLocationsEndpointsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1counttokensrequest) if err != nil { return nil, err } @@ -58500,8 +58368,7 @@ func (c *ProjectsLocationsEndpointsCreateCall) Header() http.Header { func (c *ProjectsLocationsEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1endpoint) if err != nil { return nil, err } @@ -58601,12 +58468,11 @@ func (c *ProjectsLocationsEndpointsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -58701,8 +58567,7 @@ func (c *ProjectsLocationsEndpointsDeployModelCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDeployModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1deploymodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1deploymodelrequest) if err != nil { return nil, err } @@ -58805,8 +58670,7 @@ func (c *ProjectsLocationsEndpointsDirectPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDirectPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1directpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1directpredictrequest) if err != nil { return nil, err } @@ -58909,8 +58773,7 @@ func (c *ProjectsLocationsEndpointsDirectRawPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDirectRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1directrawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1directrawpredictrequest) if err != nil { return nil, err } @@ -59015,8 +58878,7 @@ func (c *ProjectsLocationsEndpointsExplainCall) Header() http.Header { func (c *ProjectsLocationsEndpointsExplainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1explainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1explainrequest) if err != nil { return nil, err } @@ -59120,8 +58982,7 @@ func (c *ProjectsLocationsEndpointsFetchPredictOperationCall) Header() http.Head func (c *ProjectsLocationsEndpointsFetchPredictOperationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1fetchpredictoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1fetchpredictoperationrequest) if err != nil { return nil, err } @@ -59226,8 +59087,7 @@ func (c *ProjectsLocationsEndpointsGenerateContentCall) Header() http.Header { func (c *ProjectsLocationsEndpointsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -59339,12 +59199,11 @@ func (c *ProjectsLocationsEndpointsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59455,12 +59314,11 @@ func (c *ProjectsLocationsEndpointsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEndpointsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -59601,12 +59459,11 @@ func (c *ProjectsLocationsEndpointsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59725,8 +59582,7 @@ func (c *ProjectsLocationsEndpointsMutateDeployedModelCall) Header() http.Header func (c *ProjectsLocationsEndpointsMutateDeployedModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1mutatedeployedmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1mutatedeployedmodelrequest) if err != nil { return nil, err } @@ -59834,8 +59690,7 @@ func (c *ProjectsLocationsEndpointsPatchCall) Header() http.Header { func (c *ProjectsLocationsEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1endpoint) if err != nil { return nil, err } @@ -59937,8 +59792,7 @@ func (c *ProjectsLocationsEndpointsPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1predictrequest) if err != nil { return nil, err } @@ -60042,8 +59896,7 @@ func (c *ProjectsLocationsEndpointsPredictLongRunningCall) Header() http.Header func (c *ProjectsLocationsEndpointsPredictLongRunningCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1predictlongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1predictlongrunningrequest) if err != nil { return nil, err } @@ -60149,8 +60002,7 @@ func (c *ProjectsLocationsEndpointsRawPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1rawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1rawpredictrequest) if err != nil { return nil, err } @@ -60253,8 +60105,7 @@ func (c *ProjectsLocationsEndpointsServerStreamingPredictCall) Header() http.Hea func (c *ProjectsLocationsEndpointsServerStreamingPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamingpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamingpredictrequest) if err != nil { return nil, err } @@ -60359,8 +60210,7 @@ func (c *ProjectsLocationsEndpointsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEndpointsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -60466,8 +60316,7 @@ func (c *ProjectsLocationsEndpointsStreamGenerateContentCall) Header() http.Head func (c *ProjectsLocationsEndpointsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -60570,8 +60419,7 @@ func (c *ProjectsLocationsEndpointsStreamRawPredictCall) Header() http.Header { func (c *ProjectsLocationsEndpointsStreamRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamrawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamrawpredictrequest) if err != nil { return nil, err } @@ -60686,12 +60534,11 @@ func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -60787,8 +60634,7 @@ func (c *ProjectsLocationsEndpointsUndeployModelCall) Header() http.Header { func (c *ProjectsLocationsEndpointsUndeployModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1undeploymodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1undeploymodelrequest) if err != nil { return nil, err } @@ -60889,8 +60735,7 @@ func (c *ProjectsLocationsEndpointsUpdateCall) Header() http.Header { func (c *ProjectsLocationsEndpointsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1updateendpointlongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1updateendpointlongrunningrequest) if err != nil { return nil, err } @@ -60992,8 +60837,7 @@ func (c *ProjectsLocationsEndpointsChatCompletionsCall) Header() http.Header { func (c *ProjectsLocationsEndpointsChatCompletionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -61100,12 +60944,11 @@ func (c *ProjectsLocationsEndpointsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsEndpointsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -61199,12 +61042,11 @@ func (c *ProjectsLocationsEndpointsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -61309,12 +61151,11 @@ func (c *ProjectsLocationsEndpointsOperationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61438,12 +61279,11 @@ func (c *ProjectsLocationsEndpointsOperationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61572,12 +61412,11 @@ func (c *ProjectsLocationsEndpointsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsEndpointsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -61671,12 +61510,11 @@ func (c *ProjectsLocationsEvaluationTasksOperationsDeleteCall) Header() http.Hea func (c *ProjectsLocationsEvaluationTasksOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -61781,12 +61619,11 @@ func (c *ProjectsLocationsEvaluationTasksOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61910,12 +61747,11 @@ func (c *ProjectsLocationsEvaluationTasksOperationsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62044,12 +61880,11 @@ func (c *ProjectsLocationsEvaluationTasksOperationsWaitCall) Header() http.Heade func (c *ProjectsLocationsEvaluationTasksOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62148,12 +61983,11 @@ func (c *ProjectsLocationsExampleStoresOperationsCancelCall) Header() http.Heade func (c *ProjectsLocationsExampleStoresOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62247,12 +62081,11 @@ func (c *ProjectsLocationsExampleStoresOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsExampleStoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -62357,12 +62190,11 @@ func (c *ProjectsLocationsExampleStoresOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62486,12 +62318,11 @@ func (c *ProjectsLocationsExampleStoresOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62620,12 +62451,11 @@ func (c *ProjectsLocationsExampleStoresOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsExampleStoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62724,12 +62554,11 @@ func (c *ProjectsLocationsExtensionControllersOperationsCancelCall) Header() htt func (c *ProjectsLocationsExtensionControllersOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62823,12 +62652,11 @@ func (c *ProjectsLocationsExtensionControllersOperationsDeleteCall) Header() htt func (c *ProjectsLocationsExtensionControllersOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -62933,12 +62761,11 @@ func (c *ProjectsLocationsExtensionControllersOperationsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63062,12 +62889,11 @@ func (c *ProjectsLocationsExtensionControllersOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63196,12 +63022,11 @@ func (c *ProjectsLocationsExtensionControllersOperationsWaitCall) Header() http. func (c *ProjectsLocationsExtensionControllersOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -63293,12 +63118,11 @@ func (c *ProjectsLocationsExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -63392,8 +63216,7 @@ func (c *ProjectsLocationsExtensionsExecuteCall) Header() http.Header { func (c *ProjectsLocationsExtensionsExecuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1executeextensionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1executeextensionrequest) if err != nil { return nil, err } @@ -63505,12 +63328,11 @@ func (c *ProjectsLocationsExtensionsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63604,8 +63426,7 @@ func (c *ProjectsLocationsExtensionsImportCall) Header() http.Header { func (c *ProjectsLocationsExtensionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1extension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1extension) if err != nil { return nil, err } @@ -63748,12 +63569,11 @@ func (c *ProjectsLocationsExtensionsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/extensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63876,8 +63696,7 @@ func (c *ProjectsLocationsExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1extension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1extension) if err != nil { return nil, err } @@ -63979,8 +63798,7 @@ func (c *ProjectsLocationsExtensionsQueryCall) Header() http.Header { func (c *ProjectsLocationsExtensionsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1queryextensionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1queryextensionrequest) if err != nil { return nil, err } @@ -64087,12 +63905,11 @@ func (c *ProjectsLocationsExtensionsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsExtensionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64186,12 +64003,11 @@ func (c *ProjectsLocationsExtensionsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsExtensionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -64296,12 +64112,11 @@ func (c *ProjectsLocationsExtensionsOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64425,12 +64240,11 @@ func (c *ProjectsLocationsExtensionsOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64559,12 +64373,11 @@ func (c *ProjectsLocationsExtensionsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsExtensionsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64668,8 +64481,7 @@ func (c *ProjectsLocationsFeatureGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featuregroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featuregroup) if err != nil { return nil, err } @@ -64777,12 +64589,11 @@ func (c *ProjectsLocationsFeatureGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -64885,12 +64696,11 @@ func (c *ProjectsLocationsFeatureGroupsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65035,12 +64845,11 @@ func (c *ProjectsLocationsFeatureGroupsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featureGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65168,8 +64977,7 @@ func (c *ProjectsLocationsFeatureGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featuregroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featuregroup) if err != nil { return nil, err } @@ -65283,8 +65091,7 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsCreateCall) Header() http. func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featuremonitor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featuremonitor) if err != nil { return nil, err } @@ -65385,12 +65192,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsDeleteCall) Header() http. func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -65493,12 +65299,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65644,12 +65449,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featureMonitors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65773,8 +65577,7 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsFeatureMonitorJobsCreateCa func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsFeatureMonitorJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featuremonitorjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featuremonitorjob) if err != nil { return nil, err } @@ -65887,12 +65690,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsFeatureMonitorJobsGetCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66035,12 +65837,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsFeatureMonitorJobsListCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featureMonitorJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66155,12 +65956,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsOperationsDeleteCall) Head func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -66265,12 +66065,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsOperationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66394,12 +66193,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsOperationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66528,12 +66326,11 @@ func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsOperationsWaitCall) Header func (c *ProjectsLocationsFeatureGroupsFeatureMonitorsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -66630,8 +66427,7 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesBatchCreateCall) Header() http.He func (c *ProjectsLocationsFeatureGroupsFeaturesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchcreatefeaturesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchcreatefeaturesrequest) if err != nil { return nil, err } @@ -66746,8 +66542,7 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesCreateCall) Header() http.Header func (c *ProjectsLocationsFeatureGroupsFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1feature) if err != nil { return nil, err } @@ -66850,12 +66645,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesDeleteCall) Header() http.Header func (c *ProjectsLocationsFeatureGroupsFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -66988,12 +66782,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67163,12 +66956,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67303,8 +67095,7 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesPatchCall) Header() http.Header { func (c *ProjectsLocationsFeatureGroupsFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1feature) if err != nil { return nil, err } @@ -67406,12 +67197,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsDeleteCall) Header() ht func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -67516,12 +67306,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67645,12 +67434,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67779,12 +67567,11 @@ func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsWaitCall) Header() http func (c *ProjectsLocationsFeatureGroupsFeaturesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -67878,12 +67665,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsFeatureGroupsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -67988,12 +67774,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68117,12 +67902,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68251,12 +68035,11 @@ func (c *ProjectsLocationsFeatureGroupsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsFeatureGroupsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -68361,8 +68144,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsFeatureOnlineStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featureonlinestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featureonlinestore) if err != nil { return nil, err } @@ -68472,12 +68254,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeatureOnlineStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -68580,12 +68361,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68696,12 +68476,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresGetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsFeatureOnlineStoresGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -68847,12 +68626,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featureOnlineStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68982,8 +68760,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsFeatureOnlineStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featureonlinestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featureonlinestore) if err != nil { return nil, err } @@ -69088,8 +68865,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsFeatureOnlineStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -69204,12 +68980,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsFeatureOnlineStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -69323,8 +69098,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsCreateCall) Header() ht func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featureview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featureview) if err != nil { return nil, err } @@ -69425,12 +69199,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsDeleteCall) Header() ht func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -69525,8 +69298,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFetchFeatureValuesCall) func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFetchFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1fetchfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1fetchfeaturevaluesrequest) if err != nil { return nil, err } @@ -69641,12 +69413,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -69757,12 +69528,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsGetIamPolicyCall) Heade func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -69912,12 +69682,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featureViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70049,8 +69818,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsPatchCall) Header() htt func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featureview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featureview) if err != nil { return nil, err } @@ -70155,8 +69923,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSearchNearestEntitiesCa func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSearchNearestEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1searchnearestentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1searchnearestentitiesrequest) if err != nil { return nil, err } @@ -70261,8 +70028,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSetIamPolicyCall) Heade func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -70367,8 +70133,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsStreamingFetchFeatureVa func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsStreamingFetchFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamingfetchfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamingfetchfeaturevaluesrequest) if err != nil { return nil, err } @@ -70471,8 +70236,7 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSyncCall) Header() http func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1syncfeatureviewrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1syncfeatureviewrequest) if err != nil { return nil, err } @@ -70587,12 +70351,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsTestIamPermissionsCall) func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -70697,12 +70460,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFeatureViewSyncsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70846,12 +70608,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsFeatureViewSyncsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featureViewSyncs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70966,12 +70727,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsDeleteCall) H func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -71076,12 +70836,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71205,12 +70964,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71339,12 +71097,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsWaitCall) Hea func (c *ProjectsLocationsFeatureOnlineStoresFeatureViewsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -71438,12 +71195,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsDeleteCall) Header() http func (c *ProjectsLocationsFeatureOnlineStoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -71548,12 +71304,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71677,12 +71432,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71811,12 +71565,11 @@ func (c *ProjectsLocationsFeatureOnlineStoresOperationsWaitCall) Header() http.H func (c *ProjectsLocationsFeatureOnlineStoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -71915,8 +71668,7 @@ func (c *ProjectsLocationsFeaturestoresBatchReadFeatureValuesCall) Header() http func (c *ProjectsLocationsFeaturestoresBatchReadFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchreadfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchreadfeaturevaluesrequest) if err != nil { return nil, err } @@ -72028,8 +71780,7 @@ func (c *ProjectsLocationsFeaturestoresCreateCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featurestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featurestore) if err != nil { return nil, err } @@ -72138,12 +71889,11 @@ func (c *ProjectsLocationsFeaturestoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -72246,12 +71996,11 @@ func (c *ProjectsLocationsFeaturestoresGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72347,8 +72096,7 @@ func (c *ProjectsLocationsFeaturestoresGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1getiampolicyrequest) if err != nil { return nil, err } @@ -72510,12 +72258,11 @@ func (c *ProjectsLocationsFeaturestoresListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/featurestores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72644,8 +72391,7 @@ func (c *ProjectsLocationsFeaturestoresPatchCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1featurestore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1featurestore) if err != nil { return nil, err } @@ -72815,12 +72561,11 @@ func (c *ProjectsLocationsFeaturestoresSearchFeaturesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+location}/featurestores:searchFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72938,8 +72683,7 @@ func (c *ProjectsLocationsFeaturestoresSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturestoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -73047,8 +72791,7 @@ func (c *ProjectsLocationsFeaturestoresTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsFeaturestoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -73161,8 +72904,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesCreateCall) Header() http.Head func (c *ProjectsLocationsFeaturestoresEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1entitytype) if err != nil { return nil, err } @@ -73272,12 +73014,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteCall) Header() http.Head func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -73380,8 +73121,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteFeatureValuesCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesDeleteFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1deletefeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1deletefeaturevaluesrequest) if err != nil { return nil, err } @@ -73486,8 +73226,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesExportFeatureValuesCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesExportFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1exportfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1exportfeaturevaluesrequest) if err != nil { return nil, err } @@ -73600,12 +73339,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -73716,12 +73454,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesGetIamPolicyCall) Header() htt func (c *ProjectsLocationsFeaturestoresEntityTypesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -73830,8 +73567,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesImportFeatureValuesCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesImportFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1importfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1importfeaturevaluesrequest) if err != nil { return nil, err } @@ -73994,12 +73730,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -74138,8 +73873,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesPatchCall) Header() http.Heade func (c *ProjectsLocationsFeaturestoresEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1entitytype) if err != nil { return nil, err } @@ -74246,8 +73980,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesReadFeatureValuesCall) Header( func (c *ProjectsLocationsFeaturestoresEntityTypesReadFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1readfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1readfeaturevaluesrequest) if err != nil { return nil, err } @@ -74352,8 +74085,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesSetIamPolicyCall) Header() htt func (c *ProjectsLocationsFeaturestoresEntityTypesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -74459,8 +74191,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesStreamingReadFeatureValuesCall func (c *ProjectsLocationsFeaturestoresEntityTypesStreamingReadFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamingreadfeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamingreadfeaturevaluesrequest) if err != nil { return nil, err } @@ -74575,12 +74306,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesTestIamPermissionsCall) Header func (c *ProjectsLocationsFeaturestoresEntityTypesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -74681,8 +74411,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesWriteFeatureValuesCall) Header func (c *ProjectsLocationsFeaturestoresEntityTypesWriteFeatureValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1writefeaturevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1writefeaturevaluesrequest) if err != nil { return nil, err } @@ -74789,8 +74518,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall) Heade func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchcreatefeaturesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchcreatefeaturesrequest) if err != nil { return nil, err } @@ -74905,8 +74633,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesCreateCall) Header() h func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1feature) if err != nil { return nil, err } @@ -75009,12 +74736,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesDeleteCall) Header() h func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -75147,12 +74873,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75322,12 +75047,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75462,8 +75186,7 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesPatchCall) Header() ht func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1feature) if err != nil { return nil, err } @@ -75570,12 +75293,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsCancelCall) func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -75669,12 +75391,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsDeleteCall) func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -75779,12 +75500,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsGetCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -75908,12 +75628,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsListCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -76042,12 +75761,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsWaitCall) He func (c *ProjectsLocationsFeaturestoresEntityTypesFeaturesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76146,12 +75864,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsCancelCall) Header() func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76245,12 +75962,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsDeleteCall) Header() func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -76355,12 +76071,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -76484,12 +76199,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -76618,12 +76332,11 @@ func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsWaitCall) Header() h func (c *ProjectsLocationsFeaturestoresEntityTypesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76722,12 +76435,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsCancelCall) Header() http.Heade func (c *ProjectsLocationsFeaturestoresOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -76821,12 +76533,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsFeaturestoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -76931,12 +76642,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -77060,12 +76770,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -77194,12 +76903,11 @@ func (c *ProjectsLocationsFeaturestoresOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsFeaturestoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -77302,8 +77010,7 @@ func (c *ProjectsLocationsHyperparameterTuningJobsCancelCall) Header() http.Head func (c *ProjectsLocationsHyperparameterTuningJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cancelhyperparametertuningjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cancelhyperparametertuningjobrequest) if err != nil { return nil, err } @@ -77406,8 +77113,7 @@ func (c *ProjectsLocationsHyperparameterTuningJobsCreateCall) Header() http.Head func (c *ProjectsLocationsHyperparameterTuningJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1hyperparametertuningjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1hyperparametertuningjob) if err != nil { return nil, err } @@ -77509,12 +77215,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsDeleteCall) Header() http.Head func (c *ProjectsLocationsHyperparameterTuningJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -77619,12 +77324,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -77768,12 +77472,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/hyperparameterTuningJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -77893,12 +77596,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsCancelCall) Header() func (c *ProjectsLocationsHyperparameterTuningJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -77992,12 +77694,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsDeleteCall) Header() func (c *ProjectsLocationsHyperparameterTuningJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -78102,12 +77803,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -78231,12 +77931,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -78365,12 +78064,11 @@ func (c *ProjectsLocationsHyperparameterTuningJobsOperationsWaitCall) Header() h func (c *ProjectsLocationsHyperparameterTuningJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -78464,8 +78162,7 @@ func (c *ProjectsLocationsIndexEndpointsCreateCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1indexendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1indexendpoint) if err != nil { return nil, err } @@ -78565,12 +78262,11 @@ func (c *ProjectsLocationsIndexEndpointsDeleteCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -78666,8 +78362,7 @@ func (c *ProjectsLocationsIndexEndpointsDeployIndexCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsDeployIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1deployindexrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1deployindexrequest) if err != nil { return nil, err } @@ -78770,8 +78465,7 @@ func (c *ProjectsLocationsIndexEndpointsFindNeighborsCall) Header() http.Header func (c *ProjectsLocationsIndexEndpointsFindNeighborsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1findneighborsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1findneighborsrequest) if err != nil { return nil, err } @@ -78883,12 +78577,11 @@ func (c *ProjectsLocationsIndexEndpointsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -79030,12 +78723,11 @@ func (c *ProjectsLocationsIndexEndpointsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/indexEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -79154,8 +78846,7 @@ func (c *ProjectsLocationsIndexEndpointsMutateDeployedIndexCall) Header() http.H func (c *ProjectsLocationsIndexEndpointsMutateDeployedIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1deployedindex) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1deployedindex) if err != nil { return nil, err } @@ -79263,8 +78954,7 @@ func (c *ProjectsLocationsIndexEndpointsPatchCall) Header() http.Header { func (c *ProjectsLocationsIndexEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1indexendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1indexendpoint) if err != nil { return nil, err } @@ -79367,8 +79057,7 @@ func (c *ProjectsLocationsIndexEndpointsReadIndexDatapointsCall) Header() http.H func (c *ProjectsLocationsIndexEndpointsReadIndexDatapointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1readindexdatapointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1readindexdatapointsrequest) if err != nil { return nil, err } @@ -79472,8 +79161,7 @@ func (c *ProjectsLocationsIndexEndpointsUndeployIndexCall) Header() http.Header func (c *ProjectsLocationsIndexEndpointsUndeployIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1undeployindexrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1undeployindexrequest) if err != nil { return nil, err } @@ -79580,12 +79268,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsCancelCall) Header() http.Head func (c *ProjectsLocationsIndexEndpointsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -79679,12 +79366,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsDeleteCall) Header() http.Head func (c *ProjectsLocationsIndexEndpointsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -79789,12 +79475,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -79918,12 +79603,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80052,12 +79736,11 @@ func (c *ProjectsLocationsIndexEndpointsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsIndexEndpointsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -80151,8 +79834,7 @@ func (c *ProjectsLocationsIndexesCreateCall) Header() http.Header { func (c *ProjectsLocationsIndexesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1index) if err != nil { return nil, err } @@ -80253,12 +79935,11 @@ func (c *ProjectsLocationsIndexesDeleteCall) Header() http.Header { func (c *ProjectsLocationsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -80362,12 +80043,11 @@ func (c *ProjectsLocationsIndexesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80499,12 +80179,11 @@ func (c *ProjectsLocationsIndexesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -80626,8 +80305,7 @@ func (c *ProjectsLocationsIndexesPatchCall) Header() http.Header { func (c *ProjectsLocationsIndexesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1index) if err != nil { return nil, err } @@ -80729,8 +80407,7 @@ func (c *ProjectsLocationsIndexesRemoveDatapointsCall) Header() http.Header { func (c *ProjectsLocationsIndexesRemoveDatapointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1removedatapointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1removedatapointsrequest) if err != nil { return nil, err } @@ -80832,8 +80509,7 @@ func (c *ProjectsLocationsIndexesUpsertDatapointsCall) Header() http.Header { func (c *ProjectsLocationsIndexesUpsertDatapointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1upsertdatapointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1upsertdatapointsrequest) if err != nil { return nil, err } @@ -80940,12 +80616,11 @@ func (c *ProjectsLocationsIndexesOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsIndexesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -81039,12 +80714,11 @@ func (c *ProjectsLocationsIndexesOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsIndexesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -81149,12 +80823,11 @@ func (c *ProjectsLocationsIndexesOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81278,12 +80951,11 @@ func (c *ProjectsLocationsIndexesOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81412,12 +81084,11 @@ func (c *ProjectsLocationsIndexesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsIndexesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -81524,8 +81195,7 @@ func (c *ProjectsLocationsMetadataStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsMetadataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1metadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1metadatastore) if err != nil { return nil, err } @@ -81633,12 +81303,11 @@ func (c *ProjectsLocationsMetadataStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsMetadataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -81742,12 +81411,11 @@ func (c *ProjectsLocationsMetadataStoresGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -81869,12 +81537,11 @@ func (c *ProjectsLocationsMetadataStoresListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/metadataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82005,8 +81672,7 @@ func (c *ProjectsLocationsMetadataStoresArtifactsCreateCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1artifact) if err != nil { return nil, err } @@ -82115,12 +81781,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsDeleteCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -82225,12 +81890,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82388,12 +82052,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82521,8 +82184,7 @@ func (c *ProjectsLocationsMetadataStoresArtifactsPatchCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresArtifactsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1artifact) if err != nil { return nil, err } @@ -82624,8 +82286,7 @@ func (c *ProjectsLocationsMetadataStoresArtifactsPurgeCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresArtifactsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1purgeartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1purgeartifactsrequest) if err != nil { return nil, err } @@ -82775,12 +82436,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsQueryArtifactLineageSubgraphCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+artifact}:queryArtifactLineageSubgraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -82879,12 +82539,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsCancelCall) Header() func (c *ProjectsLocationsMetadataStoresArtifactsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -82978,12 +82637,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsDeleteCall) Header() func (c *ProjectsLocationsMetadataStoresArtifactsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -83088,12 +82746,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -83217,12 +82874,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -83351,12 +83007,11 @@ func (c *ProjectsLocationsMetadataStoresArtifactsOperationsWaitCall) Header() ht func (c *ProjectsLocationsMetadataStoresArtifactsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -83454,8 +83109,7 @@ func (c *ProjectsLocationsMetadataStoresContextsAddContextArtifactsAndExecutions func (c *ProjectsLocationsMetadataStoresContextsAddContextArtifactsAndExecutionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1addcontextartifactsandexecutionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1addcontextartifactsandexecutionsrequest) if err != nil { return nil, err } @@ -83562,8 +83216,7 @@ func (c *ProjectsLocationsMetadataStoresContextsAddContextChildrenCall) Header() func (c *ProjectsLocationsMetadataStoresContextsAddContextChildrenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1addcontextchildrenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1addcontextchildrenrequest) if err != nil { return nil, err } @@ -83681,8 +83334,7 @@ func (c *ProjectsLocationsMetadataStoresContextsCreateCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1context) if err != nil { return nil, err } @@ -83798,12 +83450,11 @@ func (c *ProjectsLocationsMetadataStoresContextsDeleteCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -83908,12 +83559,11 @@ func (c *ProjectsLocationsMetadataStoresContextsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -84070,12 +83720,11 @@ func (c *ProjectsLocationsMetadataStoresContextsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -84203,8 +83852,7 @@ func (c *ProjectsLocationsMetadataStoresContextsPatchCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1context) if err != nil { return nil, err } @@ -84306,8 +83954,7 @@ func (c *ProjectsLocationsMetadataStoresContextsPurgeCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresContextsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1purgecontextsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1purgecontextsrequest) if err != nil { return nil, err } @@ -84425,12 +84072,11 @@ func (c *ProjectsLocationsMetadataStoresContextsQueryContextLineageSubgraphCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+context}:queryContextLineageSubgraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -84527,8 +84173,7 @@ func (c *ProjectsLocationsMetadataStoresContextsRemoveContextChildrenCall) Heade func (c *ProjectsLocationsMetadataStoresContextsRemoveContextChildrenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1removecontextchildrenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1removecontextchildrenrequest) if err != nil { return nil, err } @@ -84635,12 +84280,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsCancelCall) Header() h func (c *ProjectsLocationsMetadataStoresContextsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -84734,12 +84378,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsDeleteCall) Header() h func (c *ProjectsLocationsMetadataStoresContextsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -84844,12 +84487,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -84973,12 +84615,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85107,12 +84748,11 @@ func (c *ProjectsLocationsMetadataStoresContextsOperationsWaitCall) Header() htt func (c *ProjectsLocationsMetadataStoresContextsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -85211,8 +84851,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsAddExecutionEventsCall) Header func (c *ProjectsLocationsMetadataStoresExecutionsAddExecutionEventsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1addexecutioneventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1addexecutioneventsrequest) if err != nil { return nil, err } @@ -85330,8 +84969,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsCreateCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresExecutionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1execution) if err != nil { return nil, err } @@ -85440,12 +85078,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsDeleteCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -85550,12 +85187,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85713,12 +85349,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -85846,8 +85481,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsPatchCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresExecutionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1execution) if err != nil { return nil, err } @@ -85949,8 +85583,7 @@ func (c *ProjectsLocationsMetadataStoresExecutionsPurgeCall) Header() http.Heade func (c *ProjectsLocationsMetadataStoresExecutionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1purgeexecutionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1purgeexecutionsrequest) if err != nil { return nil, err } @@ -86066,12 +85699,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsQueryExecutionInputsAndOutputs if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+execution}:queryExecutionInputsAndOutputs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -86170,12 +85802,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsCancelCall) Header() func (c *ProjectsLocationsMetadataStoresExecutionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -86269,12 +85900,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsDeleteCall) Header() func (c *ProjectsLocationsMetadataStoresExecutionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -86379,12 +86009,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -86508,12 +86137,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -86642,12 +86270,11 @@ func (c *ProjectsLocationsMetadataStoresExecutionsOperationsWaitCall) Header() h func (c *ProjectsLocationsMetadataStoresExecutionsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -86755,8 +86382,7 @@ func (c *ProjectsLocationsMetadataStoresMetadataSchemasCreateCall) Header() http func (c *ProjectsLocationsMetadataStoresMetadataSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1metadataschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1metadataschema) if err != nil { return nil, err } @@ -86869,12 +86495,11 @@ func (c *ProjectsLocationsMetadataStoresMetadataSchemasGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87003,12 +86628,11 @@ func (c *ProjectsLocationsMetadataStoresMetadataSchemasListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/metadataSchemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87128,12 +86752,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsCancelCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -87227,12 +86850,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsDeleteCall) Header() http.Head func (c *ProjectsLocationsMetadataStoresOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -87337,12 +86959,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87466,12 +87087,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -87600,12 +87220,11 @@ func (c *ProjectsLocationsMetadataStoresOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsMetadataStoresOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -87700,8 +87319,7 @@ func (c *ProjectsLocationsMigratableResourcesBatchMigrateCall) Header() http.Hea func (c *ProjectsLocationsMigratableResourcesBatchMigrateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchmigrateresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchmigrateresourcesrequest) if err != nil { return nil, err } @@ -87807,8 +87425,7 @@ func (c *ProjectsLocationsMigratableResourcesSearchCall) Header() http.Header { func (c *ProjectsLocationsMigratableResourcesSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1searchmigratableresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1searchmigratableresourcesrequest) if err != nil { return nil, err } @@ -87936,12 +87553,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsCancelCall) Header() http func (c *ProjectsLocationsMigratableResourcesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -88035,12 +87651,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsDeleteCall) Header() http func (c *ProjectsLocationsMigratableResourcesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -88145,12 +87760,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -88274,12 +87888,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -88408,12 +88021,11 @@ func (c *ProjectsLocationsMigratableResourcesOperationsWaitCall) Header() http.H func (c *ProjectsLocationsMigratableResourcesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -88508,8 +88120,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsCreateCall) Header() http func (c *ProjectsLocationsModelDeploymentMonitoringJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1modeldeploymentmonitoringjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1modeldeploymentmonitoringjob) if err != nil { return nil, err } @@ -88610,12 +88221,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsDeleteCall) Header() http func (c *ProjectsLocationsModelDeploymentMonitoringJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -88720,12 +88330,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -88866,12 +88475,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/modelDeploymentMonitoringJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89012,8 +88620,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsPatchCall) Header() http. func (c *ProjectsLocationsModelDeploymentMonitoringJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1modeldeploymentmonitoringjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1modeldeploymentmonitoringjob) if err != nil { return nil, err } @@ -89119,8 +88726,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsPauseCall) Header() http. func (c *ProjectsLocationsModelDeploymentMonitoringJobsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1pausemodeldeploymentmonitoringjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1pausemodeldeploymentmonitoringjobrequest) if err != nil { return nil, err } @@ -89226,8 +88832,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsResumeCall) Header() http func (c *ProjectsLocationsModelDeploymentMonitoringJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1resumemodeldeploymentmonitoringjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1resumemodeldeploymentmonitoringjobrequest) if err != nil { return nil, err } @@ -89332,8 +88937,7 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsSearchModelDeploymentMoni func (c *ProjectsLocationsModelDeploymentMonitoringJobsSearchModelDeploymentMonitoringStatsAnomaliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1searchmodeldeploymentmonitoringstatsanomaliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1searchmodeldeploymentmonitoringstatsanomaliesrequest) if err != nil { return nil, err } @@ -89463,12 +89067,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsCancelCall) Hea func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -89562,12 +89165,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsDeleteCall) Hea func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -89672,12 +89274,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsGetCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89801,12 +89402,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -89935,12 +89535,11 @@ func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsWaitCall) Heade func (c *ProjectsLocationsModelDeploymentMonitoringJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -90043,8 +89642,7 @@ func (c *ProjectsLocationsModelMonitorsCreateCall) Header() http.Header { func (c *ProjectsLocationsModelMonitorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1modelmonitor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1modelmonitor) if err != nil { return nil, err } @@ -90151,12 +89749,11 @@ func (c *ProjectsLocationsModelMonitorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsModelMonitorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -90260,12 +89857,11 @@ func (c *ProjectsLocationsModelMonitorsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -90397,12 +89993,11 @@ func (c *ProjectsLocationsModelMonitorsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/modelMonitors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -90524,8 +90119,7 @@ func (c *ProjectsLocationsModelMonitorsPatchCall) Header() http.Header { func (c *ProjectsLocationsModelMonitorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1modelmonitor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1modelmonitor) if err != nil { return nil, err } @@ -90627,8 +90221,7 @@ func (c *ProjectsLocationsModelMonitorsSearchModelMonitoringAlertsCall) Header() func (c *ProjectsLocationsModelMonitorsSearchModelMonitoringAlertsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1searchmodelmonitoringalertsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1searchmodelmonitoringalertsrequest) if err != nil { return nil, err } @@ -90752,8 +90345,7 @@ func (c *ProjectsLocationsModelMonitorsSearchModelMonitoringStatsCall) Header() func (c *ProjectsLocationsModelMonitorsSearchModelMonitoringStatsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1searchmodelmonitoringstatsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1searchmodelmonitoringstatsrequest) if err != nil { return nil, err } @@ -90886,8 +90478,7 @@ func (c *ProjectsLocationsModelMonitorsModelMonitoringJobsCreateCall) Header() h func (c *ProjectsLocationsModelMonitorsModelMonitoringJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1modelmonitoringjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1modelmonitoringjob) if err != nil { return nil, err } @@ -90988,12 +90579,11 @@ func (c *ProjectsLocationsModelMonitorsModelMonitoringJobsDeleteCall) Header() h func (c *ProjectsLocationsModelMonitorsModelMonitoringJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -91098,12 +90688,11 @@ func (c *ProjectsLocationsModelMonitorsModelMonitoringJobsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -91240,12 +90829,11 @@ func (c *ProjectsLocationsModelMonitorsModelMonitoringJobsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/modelMonitoringJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -91365,12 +90953,11 @@ func (c *ProjectsLocationsModelMonitorsOperationsCancelCall) Header() http.Heade func (c *ProjectsLocationsModelMonitorsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -91464,12 +91051,11 @@ func (c *ProjectsLocationsModelMonitorsOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsModelMonitorsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -91574,12 +91160,11 @@ func (c *ProjectsLocationsModelMonitorsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -91703,12 +91288,11 @@ func (c *ProjectsLocationsModelMonitorsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -91837,12 +91421,11 @@ func (c *ProjectsLocationsModelMonitorsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsModelMonitorsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -91940,8 +91523,7 @@ func (c *ProjectsLocationsModelsCopyCall) Header() http.Header { func (c *ProjectsLocationsModelsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1copymodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1copymodelrequest) if err != nil { return nil, err } @@ -92042,12 +91624,11 @@ func (c *ProjectsLocationsModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -92142,12 +91723,11 @@ func (c *ProjectsLocationsModelsDeleteVersionCall) Header() http.Header { func (c *ProjectsLocationsModelsDeleteVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:deleteVersion") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -92244,8 +91824,7 @@ func (c *ProjectsLocationsModelsExportCall) Header() http.Header { func (c *ProjectsLocationsModelsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1exportmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1exportmodelrequest) if err != nil { return nil, err } @@ -92365,12 +91944,11 @@ func (c *ProjectsLocationsModelsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92481,12 +92059,11 @@ func (c *ProjectsLocationsModelsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsModelsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -92627,12 +92204,11 @@ func (c *ProjectsLocationsModelsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92798,12 +92374,11 @@ func (c *ProjectsLocationsModelsListVersionsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:listVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -92919,8 +92494,7 @@ func (c *ProjectsLocationsModelsMergeVersionAliasesCall) Header() http.Header { func (c *ProjectsLocationsModelsMergeVersionAliasesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1mergeversionaliasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1mergeversionaliasesrequest) if err != nil { return nil, err } @@ -93029,8 +92603,7 @@ func (c *ProjectsLocationsModelsPatchCall) Header() http.Header { func (c *ProjectsLocationsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1model) if err != nil { return nil, err } @@ -93135,8 +92708,7 @@ func (c *ProjectsLocationsModelsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsModelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -93251,12 +92823,11 @@ func (c *ProjectsLocationsModelsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsModelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -93351,8 +92922,7 @@ func (c *ProjectsLocationsModelsUpdateExplanationDatasetCall) Header() http.Head func (c *ProjectsLocationsModelsUpdateExplanationDatasetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1updateexplanationdatasetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1updateexplanationdatasetrequest) if err != nil { return nil, err } @@ -93454,8 +93024,7 @@ func (c *ProjectsLocationsModelsUploadCall) Header() http.Header { func (c *ProjectsLocationsModelsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1uploadmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1uploadmodelrequest) if err != nil { return nil, err } @@ -93568,12 +93137,11 @@ func (c *ProjectsLocationsModelsEvaluationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -93667,8 +93235,7 @@ func (c *ProjectsLocationsModelsEvaluationsImportCall) Header() http.Header { func (c *ProjectsLocationsModelsEvaluationsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1importmodelevaluationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1importmodelevaluationrequest) if err != nil { return nil, err } @@ -93808,12 +93375,11 @@ func (c *ProjectsLocationsModelsEvaluationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -93933,12 +93499,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsCancelCall) Header() http.H func (c *ProjectsLocationsModelsEvaluationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -94032,12 +93597,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsDeleteCall) Header() http.H func (c *ProjectsLocationsModelsEvaluationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -94142,12 +93706,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94271,12 +93834,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94405,12 +93967,11 @@ func (c *ProjectsLocationsModelsEvaluationsOperationsWaitCall) Header() http.Hea func (c *ProjectsLocationsModelsEvaluationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -94505,8 +94066,7 @@ func (c *ProjectsLocationsModelsEvaluationsSlicesBatchImportCall) Header() http. func (c *ProjectsLocationsModelsEvaluationsSlicesBatchImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchimportevaluatedannotationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchimportevaluatedannotationsrequest) if err != nil { return nil, err } @@ -94619,12 +94179,11 @@ func (c *ProjectsLocationsModelsEvaluationsSlicesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94760,12 +94319,11 @@ func (c *ProjectsLocationsModelsEvaluationsSlicesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/slices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -94885,12 +94443,11 @@ func (c *ProjectsLocationsModelsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsModelsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -94984,12 +94541,11 @@ func (c *ProjectsLocationsModelsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsModelsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -95094,12 +94650,11 @@ func (c *ProjectsLocationsModelsOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -95223,12 +94778,11 @@ func (c *ProjectsLocationsModelsOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -95357,12 +94911,11 @@ func (c *ProjectsLocationsModelsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsModelsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -95463,8 +95016,7 @@ func (c *ProjectsLocationsNasJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsNasJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cancelnasjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cancelnasjobrequest) if err != nil { return nil, err } @@ -95566,8 +95118,7 @@ func (c *ProjectsLocationsNasJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsNasJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1nasjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1nasjob) if err != nil { return nil, err } @@ -95667,12 +95218,11 @@ func (c *ProjectsLocationsNasJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsNasJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -95776,12 +95326,11 @@ func (c *ProjectsLocationsNasJobsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -95923,12 +95472,11 @@ func (c *ProjectsLocationsNasJobsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nasJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96054,12 +95602,11 @@ func (c *ProjectsLocationsNasJobsNasTrialDetailsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96178,12 +95725,11 @@ func (c *ProjectsLocationsNasJobsNasTrialDetailsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nasTrialDetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96305,8 +95851,7 @@ func (c *ProjectsLocationsNotebookExecutionJobsCreateCall) Header() http.Header func (c *ProjectsLocationsNotebookExecutionJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1notebookexecutionjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1notebookexecutionjob) if err != nil { return nil, err } @@ -96405,12 +95950,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsDeleteCall) Header() http.Header func (c *ProjectsLocationsNotebookExecutionJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -96509,8 +96053,7 @@ func (c *ProjectsLocationsNotebookExecutionJobsGenerateAccessTokenCall) Header() func (c *ProjectsLocationsNotebookExecutionJobsGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generateaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generateaccesstokenrequest) if err != nil { return nil, err } @@ -96640,12 +96183,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96806,12 +96348,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookExecutionJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -96927,8 +96468,7 @@ func (c *ProjectsLocationsNotebookExecutionJobsReportEventCall) Header() http.He func (c *ProjectsLocationsNotebookExecutionJobsReportEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1reportexecutioneventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1reportexecutioneventrequest) if err != nil { return nil, err } @@ -97035,12 +96575,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Header() ht func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -97134,12 +96673,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Header() ht func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -97244,12 +96782,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -97373,12 +96910,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -97507,12 +97043,11 @@ func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Header() http func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -97614,8 +97149,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Header() http.Head func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1notebookruntimetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1notebookruntimetemplate) if err != nil { return nil, err } @@ -97717,12 +97251,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Header() http.Head func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -97827,12 +97360,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -97943,12 +97475,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesGetIamPolicyCall) Header() htt func (c *ProjectsLocationsNotebookRuntimeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -98105,12 +97636,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -98233,8 +97763,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesPatchCall) Header() http.Heade func (c *ProjectsLocationsNotebookRuntimeTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1notebookruntimetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1notebookruntimetemplate) if err != nil { return nil, err } @@ -98339,8 +97868,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesSetIamPolicyCall) Header() htt func (c *ProjectsLocationsNotebookRuntimeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -98455,12 +97983,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesTestIamPermissionsCall) Header func (c *ProjectsLocationsNotebookRuntimeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -98559,12 +98086,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Header() func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -98658,12 +98184,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Header() func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -98768,12 +98293,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -98897,12 +98421,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -99031,12 +98554,11 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Header() h func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -99132,8 +98654,7 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1assignnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1assignnotebookruntimerequest) if err != nil { return nil, err } @@ -99235,12 +98756,11 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -99339,8 +98859,7 @@ func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Header() http func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generateaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generateaccesstokenrequest) if err != nil { return nil, err } @@ -99454,12 +98973,11 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -99624,12 +99142,11 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -99745,8 +99262,7 @@ func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Header() http.Header func (c *ProjectsLocationsNotebookRuntimesReportEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1reportruntimeeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1reportruntimeeventrequest) if err != nil { return nil, err } @@ -99852,8 +99368,7 @@ func (c *ProjectsLocationsNotebookRuntimesStartCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1startnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1startnotebookruntimerequest) if err != nil { return nil, err } @@ -99957,8 +99472,7 @@ func (c *ProjectsLocationsNotebookRuntimesStopCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1stopnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1stopnotebookruntimerequest) if err != nil { return nil, err } @@ -100062,8 +99576,7 @@ func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1upgradenotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1upgradenotebookruntimerequest) if err != nil { return nil, err } @@ -100170,12 +99683,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Header() http.He func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -100269,12 +99781,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Header() http.He func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -100379,12 +99890,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100508,12 +100018,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -100642,12 +100151,11 @@ func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Header() http.Head func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -100746,12 +100254,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -100845,12 +100352,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -100955,12 +100461,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101084,12 +100589,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101218,12 +100722,11 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -101327,8 +100830,7 @@ func (c *ProjectsLocationsPersistentResourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1persistentresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1persistentresource) if err != nil { return nil, err } @@ -101429,12 +100931,11 @@ func (c *ProjectsLocationsPersistentResourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -101539,12 +101040,11 @@ func (c *ProjectsLocationsPersistentResourcesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101664,12 +101164,11 @@ func (c *ProjectsLocationsPersistentResourcesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/persistentResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -101790,8 +101289,7 @@ func (c *ProjectsLocationsPersistentResourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1persistentresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1persistentresource) if err != nil { return nil, err } @@ -101894,8 +101392,7 @@ func (c *ProjectsLocationsPersistentResourcesRebootCall) Header() http.Header { func (c *ProjectsLocationsPersistentResourcesRebootCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1rebootpersistentresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1rebootpersistentresourcerequest) if err != nil { return nil, err } @@ -102002,12 +101499,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsCancelCall) Header() http func (c *ProjectsLocationsPersistentResourcesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -102101,12 +101597,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsDeleteCall) Header() http func (c *ProjectsLocationsPersistentResourcesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -102211,12 +101706,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -102340,12 +101834,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -102474,12 +101967,11 @@ func (c *ProjectsLocationsPersistentResourcesOperationsWaitCall) Header() http.H func (c *ProjectsLocationsPersistentResourcesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -102578,8 +102070,7 @@ func (c *ProjectsLocationsPipelineJobsBatchCancelCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsBatchCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchcancelpipelinejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchcancelpipelinejobsrequest) if err != nil { return nil, err } @@ -102683,8 +102174,7 @@ func (c *ProjectsLocationsPipelineJobsBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchdeletepipelinejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchdeletepipelinejobsrequest) if err != nil { return nil, err } @@ -102793,8 +102283,7 @@ func (c *ProjectsLocationsPipelineJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1cancelpipelinejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1cancelpipelinejobrequest) if err != nil { return nil, err } @@ -102906,8 +102395,7 @@ func (c *ProjectsLocationsPipelineJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1pipelinejob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1pipelinejob) if err != nil { return nil, err } @@ -103007,12 +102495,11 @@ func (c *ProjectsLocationsPipelineJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -103116,12 +102603,11 @@ func (c *ProjectsLocationsPipelineJobsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -103288,12 +102774,11 @@ func (c *ProjectsLocationsPipelineJobsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/pipelineJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -103413,12 +102898,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsCancelCall) Header() http.Header func (c *ProjectsLocationsPipelineJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -103512,12 +102996,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsDeleteCall) Header() http.Header func (c *ProjectsLocationsPipelineJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -103622,12 +103105,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -103751,12 +103233,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -103885,12 +103366,11 @@ func (c *ProjectsLocationsPipelineJobsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsPipelineJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -103984,8 +103464,7 @@ func (c *ProjectsLocationsPublishersModelsComputeTokensCall) Header() http.Heade func (c *ProjectsLocationsPublishersModelsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1computetokensrequest) if err != nil { return nil, err } @@ -104087,8 +103566,7 @@ func (c *ProjectsLocationsPublishersModelsCountTokensCall) Header() http.Header func (c *ProjectsLocationsPublishersModelsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1counttokensrequest) if err != nil { return nil, err } @@ -104192,8 +103670,7 @@ func (c *ProjectsLocationsPublishersModelsFetchPredictOperationCall) Header() ht func (c *ProjectsLocationsPublishersModelsFetchPredictOperationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1fetchpredictoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1fetchpredictoperationrequest) if err != nil { return nil, err } @@ -104298,8 +103775,7 @@ func (c *ProjectsLocationsPublishersModelsGenerateContentCall) Header() http.Hea func (c *ProjectsLocationsPublishersModelsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -104418,12 +103894,11 @@ func (c *ProjectsLocationsPublishersModelsGetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsPublishersModelsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -104517,8 +103992,7 @@ func (c *ProjectsLocationsPublishersModelsPredictCall) Header() http.Header { func (c *ProjectsLocationsPublishersModelsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1predictrequest) if err != nil { return nil, err } @@ -104622,8 +104096,7 @@ func (c *ProjectsLocationsPublishersModelsPredictLongRunningCall) Header() http. func (c *ProjectsLocationsPublishersModelsPredictLongRunningCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1predictlongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1predictlongrunningrequest) if err != nil { return nil, err } @@ -104729,8 +104202,7 @@ func (c *ProjectsLocationsPublishersModelsRawPredictCall) Header() http.Header { func (c *ProjectsLocationsPublishersModelsRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1rawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1rawpredictrequest) if err != nil { return nil, err } @@ -104833,8 +104305,7 @@ func (c *ProjectsLocationsPublishersModelsServerStreamingPredictCall) Header() h func (c *ProjectsLocationsPublishersModelsServerStreamingPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamingpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamingpredictrequest) if err != nil { return nil, err } @@ -104940,8 +104411,7 @@ func (c *ProjectsLocationsPublishersModelsStreamGenerateContentCall) Header() ht func (c *ProjectsLocationsPublishersModelsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -105044,8 +104514,7 @@ func (c *ProjectsLocationsPublishersModelsStreamRawPredictCall) Header() http.He func (c *ProjectsLocationsPublishersModelsStreamRawPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamrawpredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamrawpredictrequest) if err != nil { return nil, err } @@ -105147,8 +104616,7 @@ func (c *ProjectsLocationsRagCorporaCreateCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1ragcorpus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1ragcorpus) if err != nil { return nil, err } @@ -105256,12 +104724,11 @@ func (c *ProjectsLocationsRagCorporaDeleteCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -105365,12 +104832,11 @@ func (c *ProjectsLocationsRagCorporaGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -105489,12 +104955,11 @@ func (c *ProjectsLocationsRagCorporaListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/ragCorpora") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -105608,8 +105073,7 @@ func (c *ProjectsLocationsRagCorporaPatchCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1ragcorpus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1ragcorpus) if err != nil { return nil, err } @@ -105716,12 +105180,11 @@ func (c *ProjectsLocationsRagCorporaOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -105815,12 +105278,11 @@ func (c *ProjectsLocationsRagCorporaOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -105925,12 +105387,11 @@ func (c *ProjectsLocationsRagCorporaOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106054,12 +105515,11 @@ func (c *ProjectsLocationsRagCorporaOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106188,12 +105648,11 @@ func (c *ProjectsLocationsRagCorporaOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -106286,12 +105745,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaRagFilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -106396,12 +105854,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106496,8 +105953,7 @@ func (c *ProjectsLocationsRagCorporaRagFilesImportCall) Header() http.Header { func (c *ProjectsLocationsRagCorporaRagFilesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1importragfilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1importragfilesrequest) if err != nil { return nil, err } @@ -106625,12 +106081,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/ragFiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -106750,12 +106205,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsCancelCall) Header() http. func (c *ProjectsLocationsRagCorporaRagFilesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -106849,12 +106303,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsDeleteCall) Header() http. func (c *ProjectsLocationsRagCorporaRagFilesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -106959,12 +106412,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107088,12 +106540,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107222,12 +106673,11 @@ func (c *ProjectsLocationsRagCorporaRagFilesOperationsWaitCall) Header() http.He func (c *ProjectsLocationsRagCorporaRagFilesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -107321,8 +106771,7 @@ func (c *ProjectsLocationsReasoningEnginesCreateCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1reasoningengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1reasoningengine) if err != nil { return nil, err } @@ -107423,12 +106872,11 @@ func (c *ProjectsLocationsReasoningEnginesDeleteCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -107533,12 +106981,11 @@ func (c *ProjectsLocationsReasoningEnginesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107663,12 +107110,11 @@ func (c *ProjectsLocationsReasoningEnginesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/reasoningEngines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -107789,8 +107235,7 @@ func (c *ProjectsLocationsReasoningEnginesPatchCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1reasoningengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1reasoningengine) if err != nil { return nil, err } @@ -107893,8 +107338,7 @@ func (c *ProjectsLocationsReasoningEnginesQueryCall) Header() http.Header { func (c *ProjectsLocationsReasoningEnginesQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1queryreasoningenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1queryreasoningenginerequest) if err != nil { return nil, err } @@ -107997,8 +107441,7 @@ func (c *ProjectsLocationsReasoningEnginesStreamQueryCall) Header() http.Header func (c *ProjectsLocationsReasoningEnginesStreamQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1streamqueryreasoningenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1streamqueryreasoningenginerequest) if err != nil { return nil, err } @@ -108105,12 +107548,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsCancelCall) Header() http.He func (c *ProjectsLocationsReasoningEnginesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -108204,12 +107646,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsDeleteCall) Header() http.He func (c *ProjectsLocationsReasoningEnginesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -108314,12 +107755,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -108443,12 +107883,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -108577,12 +108016,11 @@ func (c *ProjectsLocationsReasoningEnginesOperationsWaitCall) Header() http.Head func (c *ProjectsLocationsReasoningEnginesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -108676,8 +108114,7 @@ func (c *ProjectsLocationsSchedulesCreateCall) Header() http.Header { func (c *ProjectsLocationsSchedulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1schedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1schedule) if err != nil { return nil, err } @@ -108777,12 +108214,11 @@ func (c *ProjectsLocationsSchedulesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSchedulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -108886,12 +108322,11 @@ func (c *ProjectsLocationsSchedulesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -109047,12 +108482,11 @@ func (c *ProjectsLocationsSchedulesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/schedules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -109177,8 +108611,7 @@ func (c *ProjectsLocationsSchedulesPatchCall) Header() http.Header { func (c *ProjectsLocationsSchedulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1schedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1schedule) if err != nil { return nil, err } @@ -109282,8 +108715,7 @@ func (c *ProjectsLocationsSchedulesPauseCall) Header() http.Header { func (c *ProjectsLocationsSchedulesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1pauseschedulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1pauseschedulerequest) if err != nil { return nil, err } @@ -109390,8 +108822,7 @@ func (c *ProjectsLocationsSchedulesResumeCall) Header() http.Header { func (c *ProjectsLocationsSchedulesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1resumeschedulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1resumeschedulerequest) if err != nil { return nil, err } @@ -109498,12 +108929,11 @@ func (c *ProjectsLocationsSchedulesOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsSchedulesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -109597,12 +109027,11 @@ func (c *ProjectsLocationsSchedulesOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSchedulesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -109707,12 +109136,11 @@ func (c *ProjectsLocationsSchedulesOperationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -109836,12 +109264,11 @@ func (c *ProjectsLocationsSchedulesOperationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -109970,12 +109397,11 @@ func (c *ProjectsLocationsSchedulesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsSchedulesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -110069,12 +109495,11 @@ func (c *ProjectsLocationsSolversOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSolversOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -110179,12 +109604,11 @@ func (c *ProjectsLocationsSolversOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -110308,12 +109732,11 @@ func (c *ProjectsLocationsSolversOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -110428,8 +109851,7 @@ func (c *ProjectsLocationsSpecialistPoolsCreateCall) Header() http.Header { func (c *ProjectsLocationsSpecialistPoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1specialistpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1specialistpool) if err != nil { return nil, err } @@ -110537,12 +109959,11 @@ func (c *ProjectsLocationsSpecialistPoolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSpecialistPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -110647,12 +110068,11 @@ func (c *ProjectsLocationsSpecialistPoolsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -110779,12 +110199,11 @@ func (c *ProjectsLocationsSpecialistPoolsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/specialistPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -110905,8 +110324,7 @@ func (c *ProjectsLocationsSpecialistPoolsPatchCall) Header() http.Header { func (c *ProjectsLocationsSpecialistPoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1specialistpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1specialistpool) if err != nil { return nil, err } @@ -111013,12 +110431,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsCancelCall) Header() http.Hea func (c *ProjectsLocationsSpecialistPoolsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -111112,12 +110529,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsDeleteCall) Header() http.Hea func (c *ProjectsLocationsSpecialistPoolsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -111222,12 +110638,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -111351,12 +110766,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -111485,12 +110899,11 @@ func (c *ProjectsLocationsSpecialistPoolsOperationsWaitCall) Header() http.Heade func (c *ProjectsLocationsSpecialistPoolsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -111585,8 +110998,7 @@ func (c *ProjectsLocationsStudiesCreateCall) Header() http.Header { func (c *ProjectsLocationsStudiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1study) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1study) if err != nil { return nil, err } @@ -111686,12 +111098,11 @@ func (c *ProjectsLocationsStudiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -111795,12 +111206,11 @@ func (c *ProjectsLocationsStudiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -111919,12 +111329,11 @@ func (c *ProjectsLocationsStudiesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/studies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -112040,8 +111449,7 @@ func (c *ProjectsLocationsStudiesLookupCall) Header() http.Header { func (c *ProjectsLocationsStudiesLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1lookupstudyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1lookupstudyrequest) if err != nil { return nil, err } @@ -112148,12 +111556,11 @@ func (c *ProjectsLocationsStudiesOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsStudiesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -112247,12 +111654,11 @@ func (c *ProjectsLocationsStudiesOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -112357,12 +111763,11 @@ func (c *ProjectsLocationsStudiesOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -112486,12 +111891,11 @@ func (c *ProjectsLocationsStudiesOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -112620,12 +112024,11 @@ func (c *ProjectsLocationsStudiesOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsStudiesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -112720,8 +112123,7 @@ func (c *ProjectsLocationsStudiesTrialsAddTrialMeasurementCall) Header() http.He func (c *ProjectsLocationsStudiesTrialsAddTrialMeasurementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1addtrialmeasurementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1addtrialmeasurementrequest) if err != nil { return nil, err } @@ -112825,8 +112227,7 @@ func (c *ProjectsLocationsStudiesTrialsCheckTrialEarlyStoppingStateCall) Header( func (c *ProjectsLocationsStudiesTrialsCheckTrialEarlyStoppingStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1checktrialearlystoppingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1checktrialearlystoppingstaterequest) if err != nil { return nil, err } @@ -112928,8 +112329,7 @@ func (c *ProjectsLocationsStudiesTrialsCompleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1completetrialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1completetrialrequest) if err != nil { return nil, err } @@ -113031,8 +112431,7 @@ func (c *ProjectsLocationsStudiesTrialsCreateCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1trial) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1trial) if err != nil { return nil, err } @@ -113132,12 +112531,11 @@ func (c *ProjectsLocationsStudiesTrialsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -113241,12 +112639,11 @@ func (c *ProjectsLocationsStudiesTrialsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -113365,12 +112762,11 @@ func (c *ProjectsLocationsStudiesTrialsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/trials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -113487,8 +112883,7 @@ func (c *ProjectsLocationsStudiesTrialsListOptimalTrialsCall) Header() http.Head func (c *ProjectsLocationsStudiesTrialsListOptimalTrialsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1listoptimaltrialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1listoptimaltrialsrequest) if err != nil { return nil, err } @@ -113590,8 +112985,7 @@ func (c *ProjectsLocationsStudiesTrialsStopCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1stoptrialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1stoptrialrequest) if err != nil { return nil, err } @@ -113696,8 +113090,7 @@ func (c *ProjectsLocationsStudiesTrialsSuggestCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsSuggestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1suggesttrialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1suggesttrialsrequest) if err != nil { return nil, err } @@ -113804,12 +113197,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsCancelCall) Header() http.Heade func (c *ProjectsLocationsStudiesTrialsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -113903,12 +113295,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsStudiesTrialsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -114013,12 +113404,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -114142,12 +113532,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -114276,12 +113665,11 @@ func (c *ProjectsLocationsStudiesTrialsOperationsWaitCall) Header() http.Header func (c *ProjectsLocationsStudiesTrialsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -114401,12 +113789,11 @@ func (c *ProjectsLocationsTensorboardsBatchReadCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+tensorboard}:batchRead") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -114500,8 +113887,7 @@ func (c *ProjectsLocationsTensorboardsCreateCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboard) if err != nil { return nil, err } @@ -114601,12 +113987,11 @@ func (c *ProjectsLocationsTensorboardsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -114710,12 +114095,11 @@ func (c *ProjectsLocationsTensorboardsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -114859,12 +114243,11 @@ func (c *ProjectsLocationsTensorboardsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tensorboards") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -114990,8 +114373,7 @@ func (c *ProjectsLocationsTensorboardsPatchCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboard) if err != nil { return nil, err } @@ -115103,12 +114485,11 @@ func (c *ProjectsLocationsTensorboardsReadSizeCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+tensorboard}:readSize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -115213,12 +114594,11 @@ func (c *ProjectsLocationsTensorboardsReadUsageCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+tensorboard}:readUsage") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -115317,8 +114697,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsBatchCreateCall) Header() http. func (c *ProjectsLocationsTensorboardsExperimentsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchcreatetensorboardtimeseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchcreatetensorboardtimeseriesrequest) if err != nil { return nil, err } @@ -115431,8 +114810,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsCreateCall) Header() http.Heade func (c *ProjectsLocationsTensorboardsExperimentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboardexperiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboardexperiment) if err != nil { return nil, err } @@ -115533,12 +114911,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsDeleteCall) Header() http.Heade func (c *ProjectsLocationsTensorboardsExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -115643,12 +115020,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -115793,12 +115169,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/experiments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -115925,8 +115300,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsPatchCall) Header() http.Header func (c *ProjectsLocationsTensorboardsExperimentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboardexperiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboardexperiment) if err != nil { return nil, err } @@ -116032,8 +115406,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsWriteCall) Header() http.Header func (c *ProjectsLocationsTensorboardsExperimentsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1writetensorboardexperimentdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1writetensorboardexperimentdatarequest) if err != nil { return nil, err } @@ -116140,12 +115513,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsCancelCall) Header() func (c *ProjectsLocationsTensorboardsExperimentsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -116239,12 +115611,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsDeleteCall) Header() func (c *ProjectsLocationsTensorboardsExperimentsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -116349,12 +115720,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -116478,12 +115848,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -116612,12 +115981,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsOperationsWaitCall) Header() ht func (c *ProjectsLocationsTensorboardsExperimentsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -116714,8 +116082,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsBatchCreateCall) Header() h func (c *ProjectsLocationsTensorboardsExperimentsRunsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1batchcreatetensorboardrunsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1batchcreatetensorboardrunsrequest) if err != nil { return nil, err } @@ -116828,8 +116195,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsCreateCall) Header() http.H func (c *ProjectsLocationsTensorboardsExperimentsRunsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboardrun) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboardrun) if err != nil { return nil, err } @@ -116930,12 +116296,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsDeleteCall) Header() http.H func (c *ProjectsLocationsTensorboardsExperimentsRunsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -117040,12 +116405,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -117191,12 +116555,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/runs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -117323,8 +116686,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsPatchCall) Header() http.He func (c *ProjectsLocationsTensorboardsExperimentsRunsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboardrun) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboardrun) if err != nil { return nil, err } @@ -117430,8 +116792,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsWriteCall) Header() http.He func (c *ProjectsLocationsTensorboardsExperimentsRunsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1writetensorboardrundatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1writetensorboardrundatarequest) if err != nil { return nil, err } @@ -117538,12 +116899,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsCancelCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -117637,12 +116997,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsDeleteCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -117747,12 +117106,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -117876,12 +117234,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -118010,12 +117367,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsWaitCall) Header( func (c *ProjectsLocationsTensorboardsExperimentsRunsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -118121,8 +117477,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesCreateCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboardtimeseries) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboardtimeseries) if err != nil { return nil, err } @@ -118223,12 +117578,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesDeleteCall) Heade func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -118325,8 +117679,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesExportTensorboard func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesExportTensorboardTimeSeriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1exporttensorboardtimeseriesdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1exporttensorboardtimeseriesdatarequest) if err != nil { return nil, err } @@ -118460,12 +117813,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -118611,12 +117963,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/timeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -118741,8 +118092,7 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesPatchCall) Header func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tensorboardtimeseries) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tensorboardtimeseries) if err != nil { return nil, err } @@ -118874,12 +118224,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesReadCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+tensorboardTimeSeries}:read") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -118993,12 +118342,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesReadBlobDataCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+timeSeries}:readBlobData") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -119097,12 +118445,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsCancelC func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -119196,12 +118543,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsDeleteC func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -119306,12 +118652,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -119435,12 +118780,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -119569,12 +118913,11 @@ func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsWaitCal func (c *ProjectsLocationsTensorboardsExperimentsRunsTimeSeriesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -119673,12 +119016,11 @@ func (c *ProjectsLocationsTensorboardsOperationsCancelCall) Header() http.Header func (c *ProjectsLocationsTensorboardsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -119772,12 +119114,11 @@ func (c *ProjectsLocationsTensorboardsOperationsDeleteCall) Header() http.Header func (c *ProjectsLocationsTensorboardsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -119882,12 +119223,11 @@ func (c *ProjectsLocationsTensorboardsOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -120011,12 +119351,11 @@ func (c *ProjectsLocationsTensorboardsOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -120145,12 +119484,11 @@ func (c *ProjectsLocationsTensorboardsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsTensorboardsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -120253,8 +119591,7 @@ func (c *ProjectsLocationsTrainingPipelinesCancelCall) Header() http.Header { func (c *ProjectsLocationsTrainingPipelinesCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1canceltrainingpipelinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1canceltrainingpipelinerequest) if err != nil { return nil, err } @@ -120357,8 +119694,7 @@ func (c *ProjectsLocationsTrainingPipelinesCreateCall) Header() http.Header { func (c *ProjectsLocationsTrainingPipelinesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1trainingpipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1trainingpipeline) if err != nil { return nil, err } @@ -120459,12 +119795,11 @@ func (c *ProjectsLocationsTrainingPipelinesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTrainingPipelinesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -120569,12 +119904,11 @@ func (c *ProjectsLocationsTrainingPipelinesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -120717,12 +120051,11 @@ func (c *ProjectsLocationsTrainingPipelinesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/trainingPipelines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -120842,12 +120175,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsCancelCall) Header() http.H func (c *ProjectsLocationsTrainingPipelinesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -120941,12 +120273,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsDeleteCall) Header() http.H func (c *ProjectsLocationsTrainingPipelinesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -121051,12 +120382,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -121180,12 +120510,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -121314,12 +120643,11 @@ func (c *ProjectsLocationsTrainingPipelinesOperationsWaitCall) Header() http.Hea func (c *ProjectsLocationsTrainingPipelinesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -121420,8 +120748,7 @@ func (c *ProjectsLocationsTuningJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1canceltuningjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1canceltuningjobrequest) if err != nil { return nil, err } @@ -121524,8 +120851,7 @@ func (c *ProjectsLocationsTuningJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1tuningjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1tuningjob) if err != nil { return nil, err } @@ -121637,12 +120963,11 @@ func (c *ProjectsLocationsTuningJobsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -121767,12 +121092,11 @@ func (c *ProjectsLocationsTuningJobsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tuningJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -121887,8 +121211,7 @@ func (c *ProjectsLocationsTuningJobsRebaseTunedModelCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsRebaseTunedModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1rebasetunedmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1rebasetunedmodelrequest) if err != nil { return nil, err } @@ -121990,12 +121313,11 @@ func (c *ProjectsLocationsTuningJobsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTuningJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -122089,8 +121411,7 @@ func (c *PublishersModelsComputeTokensCall) Header() http.Header { func (c *PublishersModelsComputeTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1computetokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1computetokensrequest) if err != nil { return nil, err } @@ -122192,8 +121513,7 @@ func (c *PublishersModelsCountTokensCall) Header() http.Header { func (c *PublishersModelsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1counttokensrequest) if err != nil { return nil, err } @@ -122298,8 +121618,7 @@ func (c *PublishersModelsGenerateContentCall) Header() http.Header { func (c *PublishersModelsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -122455,12 +121774,11 @@ func (c *PublishersModelsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -122630,12 +121948,11 @@ func (c *PublishersModelsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -122754,8 +122071,7 @@ func (c *PublishersModelsStreamGenerateContentCall) Header() http.Header { func (c *PublishersModelsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } diff --git a/airquality/v1/airquality-gen.go b/airquality/v1/airquality-gen.go index dfbbf06f406..a06da7c4b1c 100644 --- a/airquality/v1/airquality-gen.go +++ b/airquality/v1/airquality-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.CurrentConditions = NewCurrentConditionsService(s) + s.Forecast = NewForecastService(s) + s.History = NewHistoryService(s) + s.MapTypes = NewMapTypesService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.CurrentConditions = NewCurrentConditionsService(s) - s.Forecast = NewForecastService(s) - s.History = NewHistoryService(s) - s.MapTypes = NewMapTypesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1184,8 +1183,7 @@ func (c *CurrentConditionsLookupCall) Header() http.Header { func (c *CurrentConditionsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookupcurrentconditionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookupcurrentconditionsrequest) if err != nil { return nil, err } @@ -1280,8 +1278,7 @@ func (c *ForecastLookupCall) Header() http.Header { func (c *ForecastLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookupforecastrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookupforecastrequest) if err != nil { return nil, err } @@ -1397,8 +1394,7 @@ func (c *HistoryLookupCall) Header() http.Header { func (c *HistoryLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuphistoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookuphistoryrequest) if err != nil { return nil, err } @@ -1545,12 +1541,11 @@ func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/mapTypes/{mapType}/heatmapTiles/{zoom}/{x}/{y}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/alertcenter/v1beta1/alertcenter-gen.go b/alertcenter/v1beta1/alertcenter-gen.go index 07983c2fa60..e36d5fea66d 100644 --- a/alertcenter/v1beta1/alertcenter-gen.go +++ b/alertcenter/v1beta1/alertcenter-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Alerts = NewAlertsService(s) + s.V1beta1 = NewV1beta1Service(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Alerts = NewAlertsService(s) - s.V1beta1 = NewV1beta1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2468,8 +2467,7 @@ func (c *AlertsBatchDeleteCall) Header() http.Header { func (c *AlertsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletealertsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletealertsrequest) if err != nil { return nil, err } @@ -2563,8 +2561,7 @@ func (c *AlertsBatchUndeleteCall) Header() http.Header { func (c *AlertsBatchUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchundeletealertsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchundeletealertsrequest) if err != nil { return nil, err } @@ -2674,12 +2671,11 @@ func (c *AlertsDeleteCall) Header() http.Header { func (c *AlertsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2792,12 +2788,11 @@ func (c *AlertsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2911,12 +2906,11 @@ func (c *AlertsGetMetadataCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}/metadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3061,12 +3055,11 @@ func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3181,8 +3174,7 @@ func (c *AlertsUndeleteCall) Header() http.Header { func (c *AlertsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletealertrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletealertrequest) if err != nil { return nil, err } @@ -3295,8 +3287,7 @@ func (c *AlertsFeedbackCreateCall) Header() http.Header { func (c *AlertsFeedbackCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.alertfeedback) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.alertfeedback) if err != nil { return nil, err } @@ -3428,12 +3419,11 @@ func (c *AlertsFeedbackListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}/feedback") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3543,12 +3533,11 @@ func (c *V1beta1GetSettingsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3644,8 +3633,7 @@ func (c *V1beta1UpdateSettingsCall) Header() http.Header { func (c *V1beta1UpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } diff --git a/alloydb/v1/alloydb-gen.go b/alloydb/v1/alloydb-gen.go index 7a1b0273ab6..9d423a65eca 100644 --- a/alloydb/v1/alloydb-gen.go +++ b/alloydb/v1/alloydb-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4177,12 +4176,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4309,12 +4307,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4458,8 +4455,7 @@ func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -4589,12 +4585,11 @@ func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4696,12 +4691,11 @@ func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4831,12 +4825,11 @@ func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4998,8 +4991,7 @@ func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5131,8 +5123,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5265,8 +5256,7 @@ func (c *ProjectsLocationsClustersCreatesecondaryCall) Header() http.Header { func (c *ProjectsLocationsClustersCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5404,12 +5394,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5501,8 +5490,7 @@ func (c *ProjectsLocationsClustersExportCall) Header() http.Header { func (c *ProjectsLocationsClustersExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportclusterrequest) if err != nil { return nil, err } @@ -5637,12 +5625,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5775,12 +5762,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5941,8 +5927,7 @@ func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -6045,8 +6030,7 @@ func (c *ProjectsLocationsClustersPromoteCall) Header() http.Header { func (c *ProjectsLocationsClustersPromoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promoteclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promoteclusterrequest) if err != nil { return nil, err } @@ -6149,8 +6133,7 @@ func (c *ProjectsLocationsClustersRestoreCall) Header() http.Header { func (c *ProjectsLocationsClustersRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreclusterrequest) if err != nil { return nil, err } @@ -6253,8 +6236,7 @@ func (c *ProjectsLocationsClustersSwitchoverCall) Header() http.Header { func (c *ProjectsLocationsClustersSwitchoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.switchoverclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.switchoverclusterrequest) if err != nil { return nil, err } @@ -6354,8 +6336,7 @@ func (c *ProjectsLocationsClustersUpgradeCall) Header() http.Header { func (c *ProjectsLocationsClustersUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeclusterrequest) if err != nil { return nil, err } @@ -6487,8 +6468,7 @@ func (c *ProjectsLocationsClustersInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6621,8 +6601,7 @@ func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Header() http.He func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6753,12 +6732,11 @@ func (c *ProjectsLocationsClustersInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6852,8 +6830,7 @@ func (c *ProjectsLocationsClustersInstancesFailoverCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.failoverinstancerequest) if err != nil { return nil, err } @@ -6986,12 +6963,11 @@ func (c *ProjectsLocationsClustersInstancesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7111,12 +7087,11 @@ func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectionInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7209,8 +7184,7 @@ func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Header() http.Header func (c *ProjectsLocationsClustersInstancesInjectFaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectfaultrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.injectfaultrequest) if err != nil { return nil, err } @@ -7352,12 +7326,11 @@ func (c *ProjectsLocationsClustersInstancesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7521,8 +7494,7 @@ func (c *ProjectsLocationsClustersInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -7623,8 +7595,7 @@ func (c *ProjectsLocationsClustersInstancesRestartCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest) if err != nil { return nil, err } @@ -7754,8 +7725,7 @@ func (c *ProjectsLocationsClustersUsersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -7877,12 +7847,11 @@ func (c *ProjectsLocationsClustersUsersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7985,12 +7954,11 @@ func (c *ProjectsLocationsClustersUsersGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8120,12 +8088,11 @@ func (c *ProjectsLocationsClustersUsersListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8280,8 +8247,7 @@ func (c *ProjectsLocationsClustersUsersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -8389,8 +8355,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -8491,12 +8456,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8600,12 +8564,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8728,12 +8691,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8876,12 +8838,11 @@ func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/supportedDatabaseFlags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/alloydb/v1alpha/alloydb-gen.go b/alloydb/v1alpha/alloydb-gen.go index 1d8dab1304b..69851e3b6d4 100644 --- a/alloydb/v1alpha/alloydb-gen.go +++ b/alloydb/v1alpha/alloydb-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4423,12 +4422,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4555,12 +4553,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4704,8 +4701,7 @@ func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -4835,12 +4831,11 @@ func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4942,12 +4937,11 @@ func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5077,12 +5071,11 @@ func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5244,8 +5237,7 @@ func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5377,8 +5369,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5511,8 +5502,7 @@ func (c *ProjectsLocationsClustersCreatesecondaryCall) Header() http.Header { func (c *ProjectsLocationsClustersCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5650,12 +5640,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5747,8 +5736,7 @@ func (c *ProjectsLocationsClustersExportCall) Header() http.Header { func (c *ProjectsLocationsClustersExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportclusterrequest) if err != nil { return nil, err } @@ -5883,12 +5871,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6021,12 +6008,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6187,8 +6173,7 @@ func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -6291,8 +6276,7 @@ func (c *ProjectsLocationsClustersPromoteCall) Header() http.Header { func (c *ProjectsLocationsClustersPromoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promoteclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promoteclusterrequest) if err != nil { return nil, err } @@ -6395,8 +6379,7 @@ func (c *ProjectsLocationsClustersRestoreCall) Header() http.Header { func (c *ProjectsLocationsClustersRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreclusterrequest) if err != nil { return nil, err } @@ -6499,8 +6482,7 @@ func (c *ProjectsLocationsClustersSwitchoverCall) Header() http.Header { func (c *ProjectsLocationsClustersSwitchoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.switchoverclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.switchoverclusterrequest) if err != nil { return nil, err } @@ -6600,8 +6582,7 @@ func (c *ProjectsLocationsClustersUpgradeCall) Header() http.Header { func (c *ProjectsLocationsClustersUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeclusterrequest) if err != nil { return nil, err } @@ -6733,8 +6714,7 @@ func (c *ProjectsLocationsClustersInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6867,8 +6847,7 @@ func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Header() http.He func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6999,12 +6978,11 @@ func (c *ProjectsLocationsClustersInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7098,8 +7076,7 @@ func (c *ProjectsLocationsClustersInstancesFailoverCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.failoverinstancerequest) if err != nil { return nil, err } @@ -7232,12 +7209,11 @@ func (c *ProjectsLocationsClustersInstancesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7357,12 +7333,11 @@ func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/connectionInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7455,8 +7430,7 @@ func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Header() http.Header func (c *ProjectsLocationsClustersInstancesInjectFaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectfaultrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.injectfaultrequest) if err != nil { return nil, err } @@ -7598,12 +7572,11 @@ func (c *ProjectsLocationsClustersInstancesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7767,8 +7740,7 @@ func (c *ProjectsLocationsClustersInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -7869,8 +7841,7 @@ func (c *ProjectsLocationsClustersInstancesRestartCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest) if err != nil { return nil, err } @@ -8000,8 +7971,7 @@ func (c *ProjectsLocationsClustersUsersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -8123,12 +8093,11 @@ func (c *ProjectsLocationsClustersUsersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8231,12 +8200,11 @@ func (c *ProjectsLocationsClustersUsersGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8366,12 +8334,11 @@ func (c *ProjectsLocationsClustersUsersListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8526,8 +8493,7 @@ func (c *ProjectsLocationsClustersUsersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -8635,8 +8601,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -8737,12 +8702,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8846,12 +8810,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8974,12 +8937,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9122,12 +9084,11 @@ func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/supportedDatabaseFlags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/alloydb/v1beta/alloydb-gen.go b/alloydb/v1beta/alloydb-gen.go index 6bca62c9dfb..a7eb33d42a9 100644 --- a/alloydb/v1beta/alloydb-gen.go +++ b/alloydb/v1beta/alloydb-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4377,12 +4376,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4509,12 +4507,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4658,8 +4655,7 @@ func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -4789,12 +4785,11 @@ func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4896,12 +4891,11 @@ func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5031,12 +5025,11 @@ func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5198,8 +5191,7 @@ func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5331,8 +5323,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5465,8 +5456,7 @@ func (c *ProjectsLocationsClustersCreatesecondaryCall) Header() http.Header { func (c *ProjectsLocationsClustersCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5604,12 +5594,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5701,8 +5690,7 @@ func (c *ProjectsLocationsClustersExportCall) Header() http.Header { func (c *ProjectsLocationsClustersExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportclusterrequest) if err != nil { return nil, err } @@ -5837,12 +5825,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5975,12 +5962,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6141,8 +6127,7 @@ func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -6245,8 +6230,7 @@ func (c *ProjectsLocationsClustersPromoteCall) Header() http.Header { func (c *ProjectsLocationsClustersPromoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promoteclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promoteclusterrequest) if err != nil { return nil, err } @@ -6349,8 +6333,7 @@ func (c *ProjectsLocationsClustersRestoreCall) Header() http.Header { func (c *ProjectsLocationsClustersRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreclusterrequest) if err != nil { return nil, err } @@ -6453,8 +6436,7 @@ func (c *ProjectsLocationsClustersSwitchoverCall) Header() http.Header { func (c *ProjectsLocationsClustersSwitchoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.switchoverclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.switchoverclusterrequest) if err != nil { return nil, err } @@ -6554,8 +6536,7 @@ func (c *ProjectsLocationsClustersUpgradeCall) Header() http.Header { func (c *ProjectsLocationsClustersUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeclusterrequest) if err != nil { return nil, err } @@ -6687,8 +6668,7 @@ func (c *ProjectsLocationsClustersInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6821,8 +6801,7 @@ func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Header() http.He func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6953,12 +6932,11 @@ func (c *ProjectsLocationsClustersInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7052,8 +7030,7 @@ func (c *ProjectsLocationsClustersInstancesFailoverCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.failoverinstancerequest) if err != nil { return nil, err } @@ -7186,12 +7163,11 @@ func (c *ProjectsLocationsClustersInstancesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7311,12 +7287,11 @@ func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/connectionInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7409,8 +7384,7 @@ func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Header() http.Header func (c *ProjectsLocationsClustersInstancesInjectFaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectfaultrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.injectfaultrequest) if err != nil { return nil, err } @@ -7552,12 +7526,11 @@ func (c *ProjectsLocationsClustersInstancesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7721,8 +7694,7 @@ func (c *ProjectsLocationsClustersInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -7823,8 +7795,7 @@ func (c *ProjectsLocationsClustersInstancesRestartCall) Header() http.Header { func (c *ProjectsLocationsClustersInstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest) if err != nil { return nil, err } @@ -7954,8 +7925,7 @@ func (c *ProjectsLocationsClustersUsersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -8077,12 +8047,11 @@ func (c *ProjectsLocationsClustersUsersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8185,12 +8154,11 @@ func (c *ProjectsLocationsClustersUsersGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8320,12 +8288,11 @@ func (c *ProjectsLocationsClustersUsersListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8480,8 +8447,7 @@ func (c *ProjectsLocationsClustersUsersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersUsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -8587,12 +8553,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8685,12 +8650,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8794,12 +8758,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8922,12 +8885,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9070,12 +9032,11 @@ func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/supportedDatabaseFlags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/analytics/v3/analytics-gen.go b/analytics/v3/analytics-gen.go index b6c80b320f2..cf4acc006ed 100644 --- a/analytics/v3/analytics-gen.go +++ b/analytics/v3/analytics-gen.go @@ -142,7 +142,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Data = NewDataService(s) + s.Management = NewManagementService(s) + s.Metadata = NewMetadataService(s) + s.Provisioning = NewProvisioningService(s) + s.UserDeletion = NewUserDeletionService(s) if err != nil { return nil, err } @@ -161,13 +166,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Data = NewDataService(s) - s.Management = NewManagementService(s) - s.Metadata = NewMetadataService(s) - s.Provisioning = NewProvisioningService(s) - s.UserDeletion = NewUserDeletionService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4745,12 +4744,11 @@ func (c *DataGaGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "data/ga") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4915,12 +4913,11 @@ func (c *DataMcfGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "data/mcf") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5050,12 +5047,11 @@ func (c *DataRealtimeGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "data/realtime") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5167,12 +5163,11 @@ func (c *ManagementAccountSummariesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accountSummaries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5263,12 +5258,11 @@ func (c *ManagementAccountUserLinksDeleteCall) Header() http.Header { func (c *ManagementAccountUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5338,8 +5332,7 @@ func (c *ManagementAccountUserLinksInsertCall) Header() http.Header { func (c *ManagementAccountUserLinksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityuserlink) if err != nil { return nil, err } @@ -5464,12 +5457,11 @@ func (c *ManagementAccountUserLinksListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5565,8 +5557,7 @@ func (c *ManagementAccountUserLinksUpdateCall) Header() http.Header { func (c *ManagementAccountUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityuserlink) if err != nil { return nil, err } @@ -5688,12 +5679,11 @@ func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5778,8 +5768,7 @@ func (c *ManagementClientIdHashClientIdCall) Header() http.Header { func (c *ManagementClientIdHashClientIdCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hashclientidrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hashclientidrequest) if err != nil { return nil, err } @@ -5905,12 +5894,11 @@ func (c *ManagementCustomDataSourcesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6020,12 +6008,11 @@ func (c *ManagementCustomDimensionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6123,8 +6110,7 @@ func (c *ManagementCustomDimensionsInsertCall) Header() http.Header { func (c *ManagementCustomDimensionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customdimension) if err != nil { return nil, err } @@ -6254,12 +6240,11 @@ func (c *ManagementCustomDimensionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6369,8 +6354,7 @@ func (c *ManagementCustomDimensionsPatchCall) Header() http.Header { func (c *ManagementCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customdimension) if err != nil { return nil, err } @@ -6488,8 +6472,7 @@ func (c *ManagementCustomDimensionsUpdateCall) Header() http.Header { func (c *ManagementCustomDimensionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customdimension) if err != nil { return nil, err } @@ -6608,12 +6591,11 @@ func (c *ManagementCustomMetricsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6710,8 +6692,7 @@ func (c *ManagementCustomMetricsInsertCall) Header() http.Header { func (c *ManagementCustomMetricsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custommetric) if err != nil { return nil, err } @@ -6840,12 +6821,11 @@ func (c *ManagementCustomMetricsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6954,8 +6934,7 @@ func (c *ManagementCustomMetricsPatchCall) Header() http.Header { func (c *ManagementCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custommetric) if err != nil { return nil, err } @@ -7072,8 +7051,7 @@ func (c *ManagementCustomMetricsUpdateCall) Header() http.Header { func (c *ManagementCustomMetricsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custommetric) if err != nil { return nil, err } @@ -7182,12 +7160,11 @@ func (c *ManagementExperimentsDeleteCall) Header() http.Header { func (c *ManagementExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7278,12 +7255,11 @@ func (c *ManagementExperimentsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7384,8 +7360,7 @@ func (c *ManagementExperimentsInsertCall) Header() http.Header { func (c *ManagementExperimentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.experiment) if err != nil { return nil, err } @@ -7518,12 +7493,11 @@ func (c *ManagementExperimentsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7626,8 +7600,7 @@ func (c *ManagementExperimentsPatchCall) Header() http.Header { func (c *ManagementExperimentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.experiment) if err != nil { return nil, err } @@ -7739,8 +7712,7 @@ func (c *ManagementExperimentsUpdateCall) Header() http.Header { func (c *ManagementExperimentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.experiment) if err != nil { return nil, err } @@ -7844,12 +7816,11 @@ func (c *ManagementFiltersDeleteCall) Header() http.Header { func (c *ManagementFiltersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7955,12 +7926,11 @@ func (c *ManagementFiltersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8053,8 +8023,7 @@ func (c *ManagementFiltersInsertCall) Header() http.Header { func (c *ManagementFiltersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filter) if err != nil { return nil, err } @@ -8179,12 +8148,11 @@ func (c *ManagementFiltersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8279,8 +8247,7 @@ func (c *ManagementFiltersPatchCall) Header() http.Header { func (c *ManagementFiltersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filter) if err != nil { return nil, err } @@ -8384,8 +8351,7 @@ func (c *ManagementFiltersUpdateCall) Header() http.Header { func (c *ManagementFiltersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filter) if err != nil { return nil, err } @@ -8505,12 +8471,11 @@ func (c *ManagementGoalsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8611,8 +8576,7 @@ func (c *ManagementGoalsInsertCall) Header() http.Header { func (c *ManagementGoalsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.goal) if err != nil { return nil, err } @@ -8751,12 +8715,11 @@ func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8859,8 +8822,7 @@ func (c *ManagementGoalsPatchCall) Header() http.Header { func (c *ManagementGoalsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.goal) if err != nil { return nil, err } @@ -8972,8 +8934,7 @@ func (c *ManagementGoalsUpdateCall) Header() http.Header { func (c *ManagementGoalsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.goal) if err != nil { return nil, err } @@ -9083,12 +9044,11 @@ func (c *ManagementProfileFilterLinksDeleteCall) Header() http.Header { func (c *ManagementProfileFilterLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9179,12 +9139,11 @@ func (c *ManagementProfileFilterLinksGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9286,8 +9245,7 @@ func (c *ManagementProfileFilterLinksInsertCall) Header() http.Header { func (c *ManagementProfileFilterLinksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profilefilterlink) if err != nil { return nil, err } @@ -9425,12 +9383,11 @@ func (c *ManagementProfileFilterLinksListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9535,8 +9492,7 @@ func (c *ManagementProfileFilterLinksPatchCall) Header() http.Header { func (c *ManagementProfileFilterLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profilefilterlink) if err != nil { return nil, err } @@ -9649,8 +9605,7 @@ func (c *ManagementProfileFilterLinksUpdateCall) Header() http.Header { func (c *ManagementProfileFilterLinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profilefilterlink) if err != nil { return nil, err } @@ -9761,12 +9716,11 @@ func (c *ManagementProfileUserLinksDeleteCall) Header() http.Header { func (c *ManagementProfileUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9844,8 +9798,7 @@ func (c *ManagementProfileUserLinksInsertCall) Header() http.Header { func (c *ManagementProfileUserLinksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityuserlink) if err != nil { return nil, err } @@ -9982,12 +9935,11 @@ func (c *ManagementProfileUserLinksListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10092,8 +10044,7 @@ func (c *ManagementProfileUserLinksUpdateCall) Header() http.Header { func (c *ManagementProfileUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityuserlink) if err != nil { return nil, err } @@ -10200,12 +10151,11 @@ func (c *ManagementProfilesDeleteCall) Header() http.Header { func (c *ManagementProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10292,12 +10242,11 @@ func (c *ManagementProfilesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10394,8 +10343,7 @@ func (c *ManagementProfilesInsertCall) Header() http.Header { func (c *ManagementProfilesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profile) if err != nil { return nil, err } @@ -10528,12 +10476,11 @@ func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10633,8 +10580,7 @@ func (c *ManagementProfilesPatchCall) Header() http.Header { func (c *ManagementProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profile) if err != nil { return nil, err } @@ -10742,8 +10688,7 @@ func (c *ManagementProfilesUpdateCall) Header() http.Header { func (c *ManagementProfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profile) if err != nil { return nil, err } @@ -10849,12 +10794,11 @@ func (c *ManagementRemarketingAudienceDeleteCall) Header() http.Header { func (c *ManagementRemarketingAudienceDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10942,12 +10886,11 @@ func (c *ManagementRemarketingAudienceGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11046,8 +10989,7 @@ func (c *ManagementRemarketingAudienceInsertCall) Header() http.Header { func (c *ManagementRemarketingAudienceInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketingaudience) if err != nil { return nil, err } @@ -11184,12 +11126,11 @@ func (c *ManagementRemarketingAudienceListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11290,8 +11231,7 @@ func (c *ManagementRemarketingAudiencePatchCall) Header() http.Header { func (c *ManagementRemarketingAudiencePatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketingaudience) if err != nil { return nil, err } @@ -11400,8 +11340,7 @@ func (c *ManagementRemarketingAudienceUpdateCall) Header() http.Header { func (c *ManagementRemarketingAudienceUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketingaudience) if err != nil { return nil, err } @@ -11525,12 +11464,11 @@ func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11626,12 +11564,11 @@ func (c *ManagementUnsampledReportsDeleteCall) Header() http.Header { func (c *ManagementUnsampledReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11722,12 +11659,11 @@ func (c *ManagementUnsampledReportsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11829,8 +11765,7 @@ func (c *ManagementUnsampledReportsInsertCall) Header() http.Header { func (c *ManagementUnsampledReportsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsampledreport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unsampledreport) if err != nil { return nil, err } @@ -11967,12 +11902,11 @@ func (c *ManagementUnsampledReportsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12073,8 +12007,7 @@ func (c *ManagementUploadsDeleteUploadDataCall) Header() http.Header { func (c *ManagementUploadsDeleteUploadDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyticsdataimportdeleteuploaddatarequest) if err != nil { return nil, err } @@ -12172,12 +12105,11 @@ func (c *ManagementUploadsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12303,12 +12235,11 @@ func (c *ManagementUploadsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12445,8 +12376,7 @@ func (c *ManagementUploadsUploadDataCall) Header() http.Header { } func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads") @@ -12454,14 +12384,10 @@ func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -12577,12 +12503,11 @@ func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Header() http.Header { func (c *ManagementWebPropertyAdWordsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12669,12 +12594,11 @@ func (c *ManagementWebPropertyAdWordsLinksGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12772,8 +12696,7 @@ func (c *ManagementWebPropertyAdWordsLinksInsertCall) Header() http.Header { func (c *ManagementWebPropertyAdWordsLinksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityadwordslink) if err != nil { return nil, err } @@ -12903,12 +12826,11 @@ func (c *ManagementWebPropertyAdWordsLinksListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13009,8 +12931,7 @@ func (c *ManagementWebPropertyAdWordsLinksPatchCall) Header() http.Header { func (c *ManagementWebPropertyAdWordsLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityadwordslink) if err != nil { return nil, err } @@ -13119,8 +13040,7 @@ func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Header() http.Header { func (c *ManagementWebPropertyAdWordsLinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityadwordslink) if err != nil { return nil, err } @@ -13236,12 +13156,11 @@ func (c *ManagementWebpropertiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13336,8 +13255,7 @@ func (c *ManagementWebpropertiesInsertCall) Header() http.Header { func (c *ManagementWebpropertiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webproperty) if err != nil { return nil, err } @@ -13464,12 +13382,11 @@ func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13565,8 +13482,7 @@ func (c *ManagementWebpropertiesPatchCall) Header() http.Header { func (c *ManagementWebpropertiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webproperty) if err != nil { return nil, err } @@ -13670,8 +13586,7 @@ func (c *ManagementWebpropertiesUpdateCall) Header() http.Header { func (c *ManagementWebpropertiesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webproperty) if err != nil { return nil, err } @@ -13776,12 +13691,11 @@ func (c *ManagementWebpropertyUserLinksDeleteCall) Header() http.Header { func (c *ManagementWebpropertyUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13855,8 +13769,7 @@ func (c *ManagementWebpropertyUserLinksInsertCall) Header() http.Header { func (c *ManagementWebpropertyUserLinksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityuserlink) if err != nil { return nil, err } @@ -13987,12 +13900,11 @@ func (c *ManagementWebpropertyUserLinksListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14092,8 +14004,7 @@ func (c *ManagementWebpropertyUserLinksUpdateCall) Header() http.Header { func (c *ManagementWebpropertyUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entityuserlink) if err != nil { return nil, err } @@ -14206,12 +14117,11 @@ func (c *MetadataColumnsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14299,8 +14209,7 @@ func (c *ProvisioningCreateAccountTicketCall) Header() http.Header { func (c *ProvisioningCreateAccountTicketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountticket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountticket) if err != nil { return nil, err } @@ -14393,8 +14302,7 @@ func (c *ProvisioningCreateAccountTreeCall) Header() http.Header { func (c *ProvisioningCreateAccountTreeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttreerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accounttreerequest) if err != nil { return nil, err } @@ -14488,8 +14396,7 @@ func (c *UserDeletionUserDeletionRequestUpsertCall) Header() http.Header { func (c *UserDeletionUserDeletionRequestUpsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdeletionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userdeletionrequest) if err != nil { return nil, err } diff --git a/analyticsadmin/v1alpha/analyticsadmin-gen.go b/analyticsadmin/v1alpha/analyticsadmin-gen.go index dc13355afc2..52e4d4e13b9 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-gen.go +++ b/analyticsadmin/v1alpha/analyticsadmin-gen.go @@ -131,7 +131,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AccountSummaries = NewAccountSummariesService(s) + s.Accounts = NewAccountsService(s) + s.Properties = NewPropertiesService(s) if err != nil { return nil, err } @@ -150,11 +153,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AccountSummaries = NewAccountSummariesService(s) - s.Accounts = NewAccountsService(s) - s.Properties = NewPropertiesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6273,12 +6272,11 @@ func (c *AccountSummariesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/accountSummaries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6394,12 +6392,11 @@ func (c *AccountsDeleteCall) Header() http.Header { func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6503,12 +6500,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6614,12 +6610,11 @@ func (c *AccountsGetDataSharingSettingsCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6748,12 +6743,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6874,8 +6868,7 @@ func (c *AccountsPatchCall) Header() http.Header { func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaccount) if err != nil { return nil, err } @@ -6972,8 +6965,7 @@ func (c *AccountsProvisionAccountTicketCall) Header() http.Header { func (c *AccountsProvisionAccountTicketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaprovisionaccountticketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaprovisionaccountticketrequest) if err != nil { return nil, err } @@ -7092,8 +7084,7 @@ func (c *AccountsRunAccessReportCall) Header() http.Header { func (c *AccountsRunAccessReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alpharunaccessreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alpharunaccessreportrequest) if err != nil { return nil, err } @@ -7196,8 +7187,7 @@ func (c *AccountsSearchChangeHistoryEventsCall) Header() http.Header { func (c *AccountsSearchChangeHistoryEventsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphasearchchangehistoryeventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphasearchchangehistoryeventsrequest) if err != nil { return nil, err } @@ -7323,8 +7313,7 @@ func (c *AccountsAccessBindingsBatchCreateCall) Header() http.Header { func (c *AccountsAccessBindingsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabatchcreateaccessbindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabatchcreateaccessbindingsrequest) if err != nil { return nil, err } @@ -7429,8 +7418,7 @@ func (c *AccountsAccessBindingsBatchDeleteCall) Header() http.Header { func (c *AccountsAccessBindingsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabatchdeleteaccessbindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabatchdeleteaccessbindingsrequest) if err != nil { return nil, err } @@ -7553,12 +7541,11 @@ func (c *AccountsAccessBindingsBatchGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/accessBindings:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7654,8 +7641,7 @@ func (c *AccountsAccessBindingsBatchUpdateCall) Header() http.Header { func (c *AccountsAccessBindingsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabatchupdateaccessbindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabatchupdateaccessbindingsrequest) if err != nil { return nil, err } @@ -7756,8 +7742,7 @@ func (c *AccountsAccessBindingsCreateCall) Header() http.Header { func (c *AccountsAccessBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaccessbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaccessbinding) if err != nil { return nil, err } @@ -7857,12 +7842,11 @@ func (c *AccountsAccessBindingsDeleteCall) Header() http.Header { func (c *AccountsAccessBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7967,12 +7951,11 @@ func (c *AccountsAccessBindingsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8093,12 +8076,11 @@ func (c *AccountsAccessBindingsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/accessBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8215,8 +8197,7 @@ func (c *AccountsAccessBindingsPatchCall) Header() http.Header { func (c *AccountsAccessBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaccessbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaccessbinding) if err != nil { return nil, err } @@ -8320,8 +8301,7 @@ func (c *PropertiesAcknowledgeUserDataCollectionCall) Header() http.Header { func (c *PropertiesAcknowledgeUserDataCollectionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaacknowledgeuserdatacollectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaacknowledgeuserdatacollectionrequest) if err != nil { return nil, err } @@ -8419,8 +8399,7 @@ func (c *PropertiesCreateCall) Header() http.Header { func (c *PropertiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaproperty) if err != nil { return nil, err } @@ -8516,8 +8495,7 @@ func (c *PropertiesCreateConnectedSiteTagCall) Header() http.Header { func (c *PropertiesCreateConnectedSiteTagCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacreateconnectedsitetagrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacreateconnectedsitetagrequest) if err != nil { return nil, err } @@ -8612,8 +8590,7 @@ func (c *PropertiesCreateRollupPropertyCall) Header() http.Header { func (c *PropertiesCreateRollupPropertyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacreaterolluppropertyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacreaterolluppropertyrequest) if err != nil { return nil, err } @@ -8716,12 +8693,11 @@ func (c *PropertiesDeleteCall) Header() http.Header { func (c *PropertiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8811,8 +8787,7 @@ func (c *PropertiesDeleteConnectedSiteTagCall) Header() http.Header { func (c *PropertiesDeleteConnectedSiteTagCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadeleteconnectedsitetagrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadeleteconnectedsitetagrequest) if err != nil { return nil, err } @@ -8908,8 +8883,7 @@ func (c *PropertiesFetchAutomatedGa4ConfigurationOptOutCall) Header() http.Heade func (c *PropertiesFetchAutomatedGa4ConfigurationOptOutCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphafetchautomatedga4configurationoptoutrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphafetchautomatedga4configurationoptoutrequest) if err != nil { return nil, err } @@ -9023,12 +8997,11 @@ func (c *PropertiesFetchConnectedGa4PropertyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/properties:fetchConnectedGa4Property") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9129,12 +9102,11 @@ func (c *PropertiesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9238,12 +9210,11 @@ func (c *PropertiesGetAttributionSettingsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9349,12 +9320,11 @@ func (c *PropertiesGetDataRetentionSettingsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9458,12 +9428,11 @@ func (c *PropertiesGetGoogleSignalsSettingsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9609,12 +9578,11 @@ func (c *PropertiesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/properties") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9723,8 +9691,7 @@ func (c *PropertiesListConnectedSiteTagsCall) Header() http.Header { func (c *PropertiesListConnectedSiteTagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphalistconnectedsitetagsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphalistconnectedsitetagsrequest) if err != nil { return nil, err } @@ -9832,8 +9799,7 @@ func (c *PropertiesPatchCall) Header() http.Header { func (c *PropertiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaproperty) if err != nil { return nil, err } @@ -9931,8 +9897,7 @@ func (c *PropertiesProvisionSubpropertyCall) Header() http.Header { func (c *PropertiesProvisionSubpropertyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaprovisionsubpropertyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaprovisionsubpropertyrequest) if err != nil { return nil, err } @@ -10051,8 +10016,7 @@ func (c *PropertiesRunAccessReportCall) Header() http.Header { func (c *PropertiesRunAccessReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alpharunaccessreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alpharunaccessreportrequest) if err != nil { return nil, err } @@ -10151,8 +10115,7 @@ func (c *PropertiesSetAutomatedGa4ConfigurationOptOutCall) Header() http.Header func (c *PropertiesSetAutomatedGa4ConfigurationOptOutCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphasetautomatedga4configurationoptoutrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphasetautomatedga4configurationoptoutrequest) if err != nil { return nil, err } @@ -10261,8 +10224,7 @@ func (c *PropertiesUpdateAttributionSettingsCall) Header() http.Header { func (c *PropertiesUpdateAttributionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaattributionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaattributionsettings) if err != nil { return nil, err } @@ -10374,8 +10336,7 @@ func (c *PropertiesUpdateDataRetentionSettingsCall) Header() http.Header { func (c *PropertiesUpdateDataRetentionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadataretentionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadataretentionsettings) if err != nil { return nil, err } @@ -10487,8 +10448,7 @@ func (c *PropertiesUpdateGoogleSignalsSettingsCall) Header() http.Header { func (c *PropertiesUpdateGoogleSignalsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphagooglesignalssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphagooglesignalssettings) if err != nil { return nil, err } @@ -10593,8 +10553,7 @@ func (c *PropertiesAccessBindingsBatchCreateCall) Header() http.Header { func (c *PropertiesAccessBindingsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabatchcreateaccessbindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabatchcreateaccessbindingsrequest) if err != nil { return nil, err } @@ -10699,8 +10658,7 @@ func (c *PropertiesAccessBindingsBatchDeleteCall) Header() http.Header { func (c *PropertiesAccessBindingsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabatchdeleteaccessbindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabatchdeleteaccessbindingsrequest) if err != nil { return nil, err } @@ -10823,12 +10781,11 @@ func (c *PropertiesAccessBindingsBatchGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/accessBindings:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10924,8 +10881,7 @@ func (c *PropertiesAccessBindingsBatchUpdateCall) Header() http.Header { func (c *PropertiesAccessBindingsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabatchupdateaccessbindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabatchupdateaccessbindingsrequest) if err != nil { return nil, err } @@ -11026,8 +10982,7 @@ func (c *PropertiesAccessBindingsCreateCall) Header() http.Header { func (c *PropertiesAccessBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaccessbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaccessbinding) if err != nil { return nil, err } @@ -11127,12 +11082,11 @@ func (c *PropertiesAccessBindingsDeleteCall) Header() http.Header { func (c *PropertiesAccessBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11237,12 +11191,11 @@ func (c *PropertiesAccessBindingsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11363,12 +11316,11 @@ func (c *PropertiesAccessBindingsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/accessBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11485,8 +11437,7 @@ func (c *PropertiesAccessBindingsPatchCall) Header() http.Header { func (c *PropertiesAccessBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaccessbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaccessbinding) if err != nil { return nil, err } @@ -11588,8 +11539,7 @@ func (c *PropertiesAdSenseLinksCreateCall) Header() http.Header { func (c *PropertiesAdSenseLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaadsenselink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaadsenselink) if err != nil { return nil, err } @@ -11690,12 +11640,11 @@ func (c *PropertiesAdSenseLinksDeleteCall) Header() http.Header { func (c *PropertiesAdSenseLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11800,12 +11749,11 @@ func (c *PropertiesAdSenseLinksGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11926,12 +11874,11 @@ func (c *PropertiesAdSenseLinksListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/adSenseLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12045,8 +11992,7 @@ func (c *PropertiesAudiencesArchiveCall) Header() http.Header { func (c *PropertiesAudiencesArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaarchiveaudiencerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaarchiveaudiencerequest) if err != nil { return nil, err } @@ -12147,8 +12093,7 @@ func (c *PropertiesAudiencesCreateCall) Header() http.Header { func (c *PropertiesAudiencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaudience) if err != nil { return nil, err } @@ -12261,12 +12206,11 @@ func (c *PropertiesAudiencesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12387,12 +12331,11 @@ func (c *PropertiesAudiencesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/audiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12516,8 +12459,7 @@ func (c *PropertiesAudiencesPatchCall) Header() http.Header { func (c *PropertiesAudiencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaaudience) if err != nil { return nil, err } @@ -12618,8 +12560,7 @@ func (c *PropertiesBigQueryLinksCreateCall) Header() http.Header { func (c *PropertiesBigQueryLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabigquerylink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabigquerylink) if err != nil { return nil, err } @@ -12719,12 +12660,11 @@ func (c *PropertiesBigQueryLinksDeleteCall) Header() http.Header { func (c *PropertiesBigQueryLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12829,12 +12769,11 @@ func (c *PropertiesBigQueryLinksGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12957,12 +12896,11 @@ func (c *PropertiesBigQueryLinksListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/bigQueryLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13087,8 +13025,7 @@ func (c *PropertiesBigQueryLinksPatchCall) Header() http.Header { func (c *PropertiesBigQueryLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphabigquerylink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphabigquerylink) if err != nil { return nil, err } @@ -13202,8 +13139,7 @@ func (c *PropertiesCalculatedMetricsCreateCall) Header() http.Header { func (c *PropertiesCalculatedMetricsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacalculatedmetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacalculatedmetric) if err != nil { return nil, err } @@ -13304,12 +13240,11 @@ func (c *PropertiesCalculatedMetricsDeleteCall) Header() http.Header { func (c *PropertiesCalculatedMetricsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13414,12 +13349,11 @@ func (c *PropertiesCalculatedMetricsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13539,12 +13473,11 @@ func (c *PropertiesCalculatedMetricsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/calculatedMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13667,8 +13600,7 @@ func (c *PropertiesCalculatedMetricsPatchCall) Header() http.Header { func (c *PropertiesCalculatedMetricsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacalculatedmetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacalculatedmetric) if err != nil { return nil, err } @@ -13770,8 +13702,7 @@ func (c *PropertiesChannelGroupsCreateCall) Header() http.Header { func (c *PropertiesChannelGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphachannelgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphachannelgroup) if err != nil { return nil, err } @@ -13871,12 +13802,11 @@ func (c *PropertiesChannelGroupsDeleteCall) Header() http.Header { func (c *PropertiesChannelGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13980,12 +13910,11 @@ func (c *PropertiesChannelGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14106,12 +14035,11 @@ func (c *PropertiesChannelGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/channelGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14235,8 +14163,7 @@ func (c *PropertiesChannelGroupsPatchCall) Header() http.Header { func (c *PropertiesChannelGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphachannelgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphachannelgroup) if err != nil { return nil, err } @@ -14339,8 +14266,7 @@ func (c *PropertiesConversionEventsCreateCall) Header() http.Header { func (c *PropertiesConversionEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaconversionevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaconversionevent) if err != nil { return nil, err } @@ -14442,12 +14368,11 @@ func (c *PropertiesConversionEventsDeleteCall) Header() http.Header { func (c *PropertiesConversionEventsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14553,12 +14478,11 @@ func (c *PropertiesConversionEventsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14681,12 +14605,11 @@ func (c *PropertiesConversionEventsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversionEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14811,8 +14734,7 @@ func (c *PropertiesConversionEventsPatchCall) Header() http.Header { func (c *PropertiesConversionEventsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaconversionevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaconversionevent) if err != nil { return nil, err } @@ -14914,8 +14836,7 @@ func (c *PropertiesCustomDimensionsArchiveCall) Header() http.Header { func (c *PropertiesCustomDimensionsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaarchivecustomdimensionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaarchivecustomdimensionrequest) if err != nil { return nil, err } @@ -15016,8 +14937,7 @@ func (c *PropertiesCustomDimensionsCreateCall) Header() http.Header { func (c *PropertiesCustomDimensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacustomdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacustomdimension) if err != nil { return nil, err } @@ -15129,12 +15049,11 @@ func (c *PropertiesCustomDimensionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15254,12 +15173,11 @@ func (c *PropertiesCustomDimensionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/customDimensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15382,8 +15300,7 @@ func (c *PropertiesCustomDimensionsPatchCall) Header() http.Header { func (c *PropertiesCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacustomdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacustomdimension) if err != nil { return nil, err } @@ -15485,8 +15402,7 @@ func (c *PropertiesCustomMetricsArchiveCall) Header() http.Header { func (c *PropertiesCustomMetricsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaarchivecustommetricrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaarchivecustommetricrequest) if err != nil { return nil, err } @@ -15587,8 +15503,7 @@ func (c *PropertiesCustomMetricsCreateCall) Header() http.Header { func (c *PropertiesCustomMetricsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacustommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacustommetric) if err != nil { return nil, err } @@ -15700,12 +15615,11 @@ func (c *PropertiesCustomMetricsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15825,12 +15739,11 @@ func (c *PropertiesCustomMetricsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/customMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15953,8 +15866,7 @@ func (c *PropertiesCustomMetricsPatchCall) Header() http.Header { func (c *PropertiesCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacustommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacustommetric) if err != nil { return nil, err } @@ -16055,8 +15967,7 @@ func (c *PropertiesDataStreamsCreateCall) Header() http.Header { func (c *PropertiesDataStreamsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadatastream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadatastream) if err != nil { return nil, err } @@ -16156,12 +16067,11 @@ func (c *PropertiesDataStreamsDeleteCall) Header() http.Header { func (c *PropertiesDataStreamsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16265,12 +16175,11 @@ func (c *PropertiesDataStreamsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16375,12 +16284,11 @@ func (c *PropertiesDataStreamsGetDataRedactionSettingsCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16487,12 +16395,11 @@ func (c *PropertiesDataStreamsGetEnhancedMeasurementSettingsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16601,12 +16508,11 @@ func (c *PropertiesDataStreamsGetGlobalSiteTagCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16726,12 +16632,11 @@ func (c *PropertiesDataStreamsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/dataStreams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16855,8 +16760,7 @@ func (c *PropertiesDataStreamsPatchCall) Header() http.Header { func (c *PropertiesDataStreamsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadatastream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadatastream) if err != nil { return nil, err } @@ -16968,8 +16872,7 @@ func (c *PropertiesDataStreamsUpdateDataRedactionSettingsCall) Header() http.Hea func (c *PropertiesDataStreamsUpdateDataRedactionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadataredactionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadataredactionsettings) if err != nil { return nil, err } @@ -17085,8 +16988,7 @@ func (c *PropertiesDataStreamsUpdateEnhancedMeasurementSettingsCall) Header() ht func (c *PropertiesDataStreamsUpdateEnhancedMeasurementSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaenhancedmeasurementsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaenhancedmeasurementsettings) if err != nil { return nil, err } @@ -17189,8 +17091,7 @@ func (c *PropertiesDataStreamsEventCreateRulesCreateCall) Header() http.Header { func (c *PropertiesDataStreamsEventCreateRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaeventcreaterule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaeventcreaterule) if err != nil { return nil, err } @@ -17289,12 +17190,11 @@ func (c *PropertiesDataStreamsEventCreateRulesDeleteCall) Header() http.Header { func (c *PropertiesDataStreamsEventCreateRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17398,12 +17298,11 @@ func (c *PropertiesDataStreamsEventCreateRulesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17523,12 +17422,11 @@ func (c *PropertiesDataStreamsEventCreateRulesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/eventCreateRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17654,8 +17552,7 @@ func (c *PropertiesDataStreamsEventCreateRulesPatchCall) Header() http.Header { func (c *PropertiesDataStreamsEventCreateRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaeventcreaterule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaeventcreaterule) if err != nil { return nil, err } @@ -17756,8 +17653,7 @@ func (c *PropertiesDataStreamsEventEditRulesCreateCall) Header() http.Header { func (c *PropertiesDataStreamsEventEditRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaeventeditrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaeventeditrule) if err != nil { return nil, err } @@ -17856,12 +17752,11 @@ func (c *PropertiesDataStreamsEventEditRulesDeleteCall) Header() http.Header { func (c *PropertiesDataStreamsEventEditRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17965,12 +17860,11 @@ func (c *PropertiesDataStreamsEventEditRulesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18090,12 +17984,11 @@ func (c *PropertiesDataStreamsEventEditRulesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/eventEditRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18220,8 +18113,7 @@ func (c *PropertiesDataStreamsEventEditRulesPatchCall) Header() http.Header { func (c *PropertiesDataStreamsEventEditRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaeventeditrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaeventeditrule) if err != nil { return nil, err } @@ -18323,8 +18215,7 @@ func (c *PropertiesDataStreamsEventEditRulesReorderCall) Header() http.Header { func (c *PropertiesDataStreamsEventEditRulesReorderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphareordereventeditrulesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphareordereventeditrulesrequest) if err != nil { return nil, err } @@ -18426,8 +18317,7 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsCreateCall) Header() htt func (c *PropertiesDataStreamsMeasurementProtocolSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphameasurementprotocolsecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphameasurementprotocolsecret) if err != nil { return nil, err } @@ -18528,12 +18418,11 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsDeleteCall) Header() htt func (c *PropertiesDataStreamsMeasurementProtocolSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18638,12 +18527,11 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18766,12 +18654,11 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/measurementProtocolSecrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18895,8 +18782,7 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsPatchCall) Header() http func (c *PropertiesDataStreamsMeasurementProtocolSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphameasurementprotocolsecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphameasurementprotocolsecret) if err != nil { return nil, err } @@ -18998,8 +18884,7 @@ func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaCreateCall) Header func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaskadnetworkconversionvalueschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaskadnetworkconversionvalueschema) if err != nil { return nil, err } @@ -19100,12 +18985,11 @@ func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaDeleteCall) Header func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19211,12 +19095,11 @@ func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19342,12 +19225,11 @@ func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaListCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sKAdNetworkConversionValueSchema") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19472,8 +19354,7 @@ func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaPatchCall) Header( func (c *PropertiesDataStreamsSKAdNetworkConversionValueSchemaPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaskadnetworkconversionvalueschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaskadnetworkconversionvalueschema) if err != nil { return nil, err } @@ -19578,8 +19459,7 @@ func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsApproveCall) Header() h func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaapprovedisplayvideo360advertiserlinkproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaapprovedisplayvideo360advertiserlinkproposalrequest) if err != nil { return nil, err } @@ -19685,8 +19565,7 @@ func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsCancelCall) Header() ht func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphacanceldisplayvideo360advertiserlinkproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphacanceldisplayvideo360advertiserlinkproposalrequest) if err != nil { return nil, err } @@ -19787,8 +19666,7 @@ func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsCreateCall) Header() ht func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadisplayvideo360advertiserlinkproposal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadisplayvideo360advertiserlinkproposal) if err != nil { return nil, err } @@ -19890,12 +19768,11 @@ func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsDeleteCall) Header() ht func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20000,12 +19877,11 @@ func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20126,12 +20002,11 @@ func (c *PropertiesDisplayVideo360AdvertiserLinkProposalsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/displayVideo360AdvertiserLinkProposals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20249,8 +20124,7 @@ func (c *PropertiesDisplayVideo360AdvertiserLinksCreateCall) Header() http.Heade func (c *PropertiesDisplayVideo360AdvertiserLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadisplayvideo360advertiserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadisplayvideo360advertiserlink) if err != nil { return nil, err } @@ -20350,12 +20224,11 @@ func (c *PropertiesDisplayVideo360AdvertiserLinksDeleteCall) Header() http.Heade func (c *PropertiesDisplayVideo360AdvertiserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20459,12 +20332,11 @@ func (c *PropertiesDisplayVideo360AdvertiserLinksGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20585,12 +20457,11 @@ func (c *PropertiesDisplayVideo360AdvertiserLinksListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/displayVideo360AdvertiserLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20715,8 +20586,7 @@ func (c *PropertiesDisplayVideo360AdvertiserLinksPatchCall) Header() http.Header func (c *PropertiesDisplayVideo360AdvertiserLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphadisplayvideo360advertiserlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphadisplayvideo360advertiserlink) if err != nil { return nil, err } @@ -20817,8 +20687,7 @@ func (c *PropertiesExpandedDataSetsCreateCall) Header() http.Header { func (c *PropertiesExpandedDataSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaexpandeddataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaexpandeddataset) if err != nil { return nil, err } @@ -20917,12 +20786,11 @@ func (c *PropertiesExpandedDataSetsDeleteCall) Header() http.Header { func (c *PropertiesExpandedDataSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21026,12 +20894,11 @@ func (c *PropertiesExpandedDataSetsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21151,12 +21018,11 @@ func (c *PropertiesExpandedDataSetsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/expandedDataSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21280,8 +21146,7 @@ func (c *PropertiesExpandedDataSetsPatchCall) Header() http.Header { func (c *PropertiesExpandedDataSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaexpandeddataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphaexpandeddataset) if err != nil { return nil, err } @@ -21383,8 +21248,7 @@ func (c *PropertiesFirebaseLinksCreateCall) Header() http.Header { func (c *PropertiesFirebaseLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphafirebaselink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphafirebaselink) if err != nil { return nil, err } @@ -21484,12 +21348,11 @@ func (c *PropertiesFirebaseLinksDeleteCall) Header() http.Header { func (c *PropertiesFirebaseLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21612,12 +21475,11 @@ func (c *PropertiesFirebaseLinksListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/firebaseLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21731,8 +21593,7 @@ func (c *PropertiesGoogleAdsLinksCreateCall) Header() http.Header { func (c *PropertiesGoogleAdsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphagoogleadslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphagoogleadslink) if err != nil { return nil, err } @@ -21831,12 +21692,11 @@ func (c *PropertiesGoogleAdsLinksDeleteCall) Header() http.Header { func (c *PropertiesGoogleAdsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21956,12 +21816,11 @@ func (c *PropertiesGoogleAdsLinksListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/googleAdsLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22086,8 +21945,7 @@ func (c *PropertiesGoogleAdsLinksPatchCall) Header() http.Header { func (c *PropertiesGoogleAdsLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphagoogleadslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphagoogleadslink) if err != nil { return nil, err } @@ -22189,8 +22047,7 @@ func (c *PropertiesKeyEventsCreateCall) Header() http.Header { func (c *PropertiesKeyEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphakeyevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphakeyevent) if err != nil { return nil, err } @@ -22291,12 +22148,11 @@ func (c *PropertiesKeyEventsDeleteCall) Header() http.Header { func (c *PropertiesKeyEventsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22401,12 +22257,11 @@ func (c *PropertiesKeyEventsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22528,12 +22383,11 @@ func (c *PropertiesKeyEventsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/keyEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22657,8 +22511,7 @@ func (c *PropertiesKeyEventsPatchCall) Header() http.Header { func (c *PropertiesKeyEventsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphakeyevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphakeyevent) if err != nil { return nil, err } @@ -22761,8 +22614,7 @@ func (c *PropertiesRollupPropertySourceLinksCreateCall) Header() http.Header { func (c *PropertiesRollupPropertySourceLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alpharolluppropertysourcelink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alpharolluppropertysourcelink) if err != nil { return nil, err } @@ -22865,12 +22717,11 @@ func (c *PropertiesRollupPropertySourceLinksDeleteCall) Header() http.Header { func (c *PropertiesRollupPropertySourceLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22977,12 +22828,11 @@ func (c *PropertiesRollupPropertySourceLinksGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23108,12 +22958,11 @@ func (c *PropertiesRollupPropertySourceLinksListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/rollupPropertySourceLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23227,8 +23076,7 @@ func (c *PropertiesSearchAds360LinksCreateCall) Header() http.Header { func (c *PropertiesSearchAds360LinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphasearchads360link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphasearchads360link) if err != nil { return nil, err } @@ -23328,12 +23176,11 @@ func (c *PropertiesSearchAds360LinksDeleteCall) Header() http.Header { func (c *PropertiesSearchAds360LinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23437,12 +23284,11 @@ func (c *PropertiesSearchAds360LinksGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23562,12 +23408,11 @@ func (c *PropertiesSearchAds360LinksListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/searchAds360Links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23691,8 +23536,7 @@ func (c *PropertiesSearchAds360LinksPatchCall) Header() http.Header { func (c *PropertiesSearchAds360LinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphasearchads360link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphasearchads360link) if err != nil { return nil, err } @@ -23794,8 +23638,7 @@ func (c *PropertiesSubpropertyEventFiltersCreateCall) Header() http.Header { func (c *PropertiesSubpropertyEventFiltersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphasubpropertyeventfilter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphasubpropertyeventfilter) if err != nil { return nil, err } @@ -23896,12 +23739,11 @@ func (c *PropertiesSubpropertyEventFiltersDeleteCall) Header() http.Header { func (c *PropertiesSubpropertyEventFiltersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24006,12 +23848,11 @@ func (c *PropertiesSubpropertyEventFiltersGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24135,12 +23976,11 @@ func (c *PropertiesSubpropertyEventFiltersListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/subpropertyEventFilters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24265,8 +24105,7 @@ func (c *PropertiesSubpropertyEventFiltersPatchCall) Header() http.Header { func (c *PropertiesSubpropertyEventFiltersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphasubpropertyeventfilter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1alphasubpropertyeventfilter) if err != nil { return nil, err } diff --git a/analyticsadmin/v1beta/analyticsadmin-gen.go b/analyticsadmin/v1beta/analyticsadmin-gen.go index b43487b5d5e..09f5991fbc4 100644 --- a/analyticsadmin/v1beta/analyticsadmin-gen.go +++ b/analyticsadmin/v1beta/analyticsadmin-gen.go @@ -123,7 +123,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AccountSummaries = NewAccountSummariesService(s) + s.Accounts = NewAccountsService(s) + s.Properties = NewPropertiesService(s) if err != nil { return nil, err } @@ -142,11 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AccountSummaries = NewAccountSummariesService(s) - s.Accounts = NewAccountsService(s) - s.Properties = NewPropertiesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2648,12 +2647,11 @@ func (c *AccountSummariesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/accountSummaries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2771,12 +2769,11 @@ func (c *AccountsDeleteCall) Header() http.Header { func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2880,12 +2877,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2991,12 +2987,11 @@ func (c *AccountsGetDataSharingSettingsCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3125,12 +3120,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3251,8 +3245,7 @@ func (c *AccountsPatchCall) Header() http.Header { func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaaccount) if err != nil { return nil, err } @@ -3349,8 +3342,7 @@ func (c *AccountsProvisionAccountTicketCall) Header() http.Header { func (c *AccountsProvisionAccountTicketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaprovisionaccountticketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaprovisionaccountticketrequest) if err != nil { return nil, err } @@ -3469,8 +3461,7 @@ func (c *AccountsRunAccessReportCall) Header() http.Header { func (c *AccountsRunAccessReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betarunaccessreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betarunaccessreportrequest) if err != nil { return nil, err } @@ -3573,8 +3564,7 @@ func (c *AccountsSearchChangeHistoryEventsCall) Header() http.Header { func (c *AccountsSearchChangeHistoryEventsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betasearchchangehistoryeventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betasearchchangehistoryeventsrequest) if err != nil { return nil, err } @@ -3699,8 +3689,7 @@ func (c *PropertiesAcknowledgeUserDataCollectionCall) Header() http.Header { func (c *PropertiesAcknowledgeUserDataCollectionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaacknowledgeuserdatacollectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaacknowledgeuserdatacollectionrequest) if err != nil { return nil, err } @@ -3798,8 +3787,7 @@ func (c *PropertiesCreateCall) Header() http.Header { func (c *PropertiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaproperty) if err != nil { return nil, err } @@ -3902,12 +3890,11 @@ func (c *PropertiesDeleteCall) Header() http.Header { func (c *PropertiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4011,12 +3998,11 @@ func (c *PropertiesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4122,12 +4108,11 @@ func (c *PropertiesGetDataRetentionSettingsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4273,12 +4258,11 @@ func (c *PropertiesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/properties") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4399,8 +4383,7 @@ func (c *PropertiesPatchCall) Header() http.Header { func (c *PropertiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaproperty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaproperty) if err != nil { return nil, err } @@ -4522,8 +4505,7 @@ func (c *PropertiesRunAccessReportCall) Header() http.Header { func (c *PropertiesRunAccessReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betarunaccessreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betarunaccessreportrequest) if err != nil { return nil, err } @@ -4635,8 +4617,7 @@ func (c *PropertiesUpdateDataRetentionSettingsCall) Header() http.Header { func (c *PropertiesUpdateDataRetentionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betadataretentionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betadataretentionsettings) if err != nil { return nil, err } @@ -4739,8 +4720,7 @@ func (c *PropertiesConversionEventsCreateCall) Header() http.Header { func (c *PropertiesConversionEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaconversionevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaconversionevent) if err != nil { return nil, err } @@ -4842,12 +4822,11 @@ func (c *PropertiesConversionEventsDeleteCall) Header() http.Header { func (c *PropertiesConversionEventsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4953,12 +4932,11 @@ func (c *PropertiesConversionEventsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5081,12 +5059,11 @@ func (c *PropertiesConversionEventsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversionEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5213,8 +5190,7 @@ func (c *PropertiesConversionEventsPatchCall) Header() http.Header { func (c *PropertiesConversionEventsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaconversionevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaconversionevent) if err != nil { return nil, err } @@ -5316,8 +5292,7 @@ func (c *PropertiesCustomDimensionsArchiveCall) Header() http.Header { func (c *PropertiesCustomDimensionsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaarchivecustomdimensionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaarchivecustomdimensionrequest) if err != nil { return nil, err } @@ -5418,8 +5393,7 @@ func (c *PropertiesCustomDimensionsCreateCall) Header() http.Header { func (c *PropertiesCustomDimensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betacustomdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betacustomdimension) if err != nil { return nil, err } @@ -5531,12 +5505,11 @@ func (c *PropertiesCustomDimensionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5656,12 +5629,11 @@ func (c *PropertiesCustomDimensionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/customDimensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5786,8 +5758,7 @@ func (c *PropertiesCustomDimensionsPatchCall) Header() http.Header { func (c *PropertiesCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betacustomdimension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betacustomdimension) if err != nil { return nil, err } @@ -5889,8 +5860,7 @@ func (c *PropertiesCustomMetricsArchiveCall) Header() http.Header { func (c *PropertiesCustomMetricsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betaarchivecustommetricrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betaarchivecustommetricrequest) if err != nil { return nil, err } @@ -5991,8 +5961,7 @@ func (c *PropertiesCustomMetricsCreateCall) Header() http.Header { func (c *PropertiesCustomMetricsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betacustommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betacustommetric) if err != nil { return nil, err } @@ -6104,12 +6073,11 @@ func (c *PropertiesCustomMetricsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6229,12 +6197,11 @@ func (c *PropertiesCustomMetricsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/customMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6357,8 +6324,7 @@ func (c *PropertiesCustomMetricsPatchCall) Header() http.Header { func (c *PropertiesCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betacustommetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betacustommetric) if err != nil { return nil, err } @@ -6459,8 +6425,7 @@ func (c *PropertiesDataStreamsCreateCall) Header() http.Header { func (c *PropertiesDataStreamsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betadatastream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betadatastream) if err != nil { return nil, err } @@ -6560,12 +6525,11 @@ func (c *PropertiesDataStreamsDeleteCall) Header() http.Header { func (c *PropertiesDataStreamsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6669,12 +6633,11 @@ func (c *PropertiesDataStreamsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6794,12 +6757,11 @@ func (c *PropertiesDataStreamsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/dataStreams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6923,8 +6885,7 @@ func (c *PropertiesDataStreamsPatchCall) Header() http.Header { func (c *PropertiesDataStreamsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betadatastream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betadatastream) if err != nil { return nil, err } @@ -7026,8 +6987,7 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsCreateCall) Header() htt func (c *PropertiesDataStreamsMeasurementProtocolSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betameasurementprotocolsecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betameasurementprotocolsecret) if err != nil { return nil, err } @@ -7128,12 +7088,11 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsDeleteCall) Header() htt func (c *PropertiesDataStreamsMeasurementProtocolSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7238,12 +7197,11 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7366,12 +7324,11 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/measurementProtocolSecrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7495,8 +7452,7 @@ func (c *PropertiesDataStreamsMeasurementProtocolSecretsPatchCall) Header() http func (c *PropertiesDataStreamsMeasurementProtocolSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betameasurementprotocolsecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betameasurementprotocolsecret) if err != nil { return nil, err } @@ -7598,8 +7554,7 @@ func (c *PropertiesFirebaseLinksCreateCall) Header() http.Header { func (c *PropertiesFirebaseLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betafirebaselink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betafirebaselink) if err != nil { return nil, err } @@ -7699,12 +7654,11 @@ func (c *PropertiesFirebaseLinksDeleteCall) Header() http.Header { func (c *PropertiesFirebaseLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7827,12 +7781,11 @@ func (c *PropertiesFirebaseLinksListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/firebaseLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7946,8 +7899,7 @@ func (c *PropertiesGoogleAdsLinksCreateCall) Header() http.Header { func (c *PropertiesGoogleAdsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betagoogleadslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betagoogleadslink) if err != nil { return nil, err } @@ -8046,12 +7998,11 @@ func (c *PropertiesGoogleAdsLinksDeleteCall) Header() http.Header { func (c *PropertiesGoogleAdsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8171,12 +8122,11 @@ func (c *PropertiesGoogleAdsLinksListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/googleAdsLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8301,8 +8251,7 @@ func (c *PropertiesGoogleAdsLinksPatchCall) Header() http.Header { func (c *PropertiesGoogleAdsLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betagoogleadslink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betagoogleadslink) if err != nil { return nil, err } @@ -8404,8 +8353,7 @@ func (c *PropertiesKeyEventsCreateCall) Header() http.Header { func (c *PropertiesKeyEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betakeyevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betakeyevent) if err != nil { return nil, err } @@ -8506,12 +8454,11 @@ func (c *PropertiesKeyEventsDeleteCall) Header() http.Header { func (c *PropertiesKeyEventsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8616,12 +8563,11 @@ func (c *PropertiesKeyEventsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8743,12 +8689,11 @@ func (c *PropertiesKeyEventsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/keyEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8872,8 +8817,7 @@ func (c *PropertiesKeyEventsPatchCall) Header() http.Header { func (c *PropertiesKeyEventsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1betakeyevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleanalyticsadminv1betakeyevent) if err != nil { return nil, err } diff --git a/analyticsdata/v1beta/analyticsdata-gen.go b/analyticsdata/v1beta/analyticsdata-gen.go index 18617c88d81..a5af92422c8 100644 --- a/analyticsdata/v1beta/analyticsdata-gen.go +++ b/analyticsdata/v1beta/analyticsdata-gen.go @@ -123,7 +123,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Properties = NewPropertiesService(s) if err != nil { return nil, err } @@ -142,9 +143,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Properties = NewPropertiesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2733,8 +2732,7 @@ func (c *PropertiesBatchRunPivotReportsCall) Header() http.Header { func (c *PropertiesBatchRunPivotReportsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchrunpivotreportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchrunpivotreportsrequest) if err != nil { return nil, err } @@ -2842,8 +2840,7 @@ func (c *PropertiesBatchRunReportsCall) Header() http.Header { func (c *PropertiesBatchRunReportsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchrunreportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchrunreportsrequest) if err != nil { return nil, err } @@ -2955,8 +2952,7 @@ func (c *PropertiesCheckCompatibilityCall) Header() http.Header { func (c *PropertiesCheckCompatibilityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkcompatibilityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkcompatibilityrequest) if err != nil { return nil, err } @@ -3081,12 +3077,11 @@ func (c *PropertiesGetMetadataCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3187,8 +3182,7 @@ func (c *PropertiesRunPivotReportCall) Header() http.Header { func (c *PropertiesRunPivotReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runpivotreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runpivotreportrequest) if err != nil { return nil, err } @@ -3300,8 +3294,7 @@ func (c *PropertiesRunRealtimeReportCall) Header() http.Header { func (c *PropertiesRunRealtimeReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runrealtimereportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runrealtimereportrequest) if err != nil { return nil, err } @@ -3415,8 +3408,7 @@ func (c *PropertiesRunReportCall) Header() http.Header { func (c *PropertiesRunReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runreportrequest) if err != nil { return nil, err } @@ -3536,8 +3528,7 @@ func (c *PropertiesAudienceExportsCreateCall) Header() http.Header { func (c *PropertiesAudienceExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.audienceexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.audienceexport) if err != nil { return nil, err } @@ -3656,12 +3647,11 @@ func (c *PropertiesAudienceExportsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3792,12 +3782,11 @@ func (c *PropertiesAudienceExportsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/audienceExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3925,8 +3914,7 @@ func (c *PropertiesAudienceExportsQueryCall) Header() http.Header { func (c *PropertiesAudienceExportsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryaudienceexportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryaudienceexportrequest) if err != nil { return nil, err } diff --git a/analyticshub/v1/analyticshub-gen.go b/analyticshub/v1/analyticshub-gen.go index 4a659a77afb..0e9ee818ec2 100644 --- a/analyticshub/v1/analyticshub-gen.go +++ b/analyticshub/v1/analyticshub-gen.go @@ -125,7 +125,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,10 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2396,12 +2395,11 @@ func (c *OrganizationsLocationsDataExchangesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+organization}/dataExchanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2525,8 +2523,7 @@ func (c *ProjectsLocationsDataExchangesCreateCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataexchange) if err != nil { return nil, err } @@ -2625,12 +2622,11 @@ func (c *ProjectsLocationsDataExchangesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2733,12 +2729,11 @@ func (c *ProjectsLocationsDataExchangesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2832,8 +2827,7 @@ func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2959,12 +2953,11 @@ func (c *ProjectsLocationsDataExchangesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataExchanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3114,12 +3107,11 @@ func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listSubscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3243,8 +3235,7 @@ func (c *ProjectsLocationsDataExchangesPatchCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataexchange) if err != nil { return nil, err } @@ -3346,8 +3337,7 @@ func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3449,8 +3439,7 @@ func (c *ProjectsLocationsDataExchangesSubscribeCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesSubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribedataexchangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribedataexchangerequest) if err != nil { return nil, err } @@ -3553,8 +3542,7 @@ func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3665,8 +3653,7 @@ func (c *ProjectsLocationsDataExchangesListingsCreateCall) Header() http.Header func (c *ProjectsLocationsDataExchangesListingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listing) if err != nil { return nil, err } @@ -3765,12 +3752,11 @@ func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Header() http.Header func (c *ProjectsLocationsDataExchangesListingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3873,12 +3859,11 @@ func (c *ProjectsLocationsDataExchangesListingsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3972,8 +3957,7 @@ func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -4099,12 +4083,11 @@ func (c *ProjectsLocationsDataExchangesListingsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4254,12 +4237,11 @@ func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listSubscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4382,8 +4364,7 @@ func (c *ProjectsLocationsDataExchangesListingsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesListingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listing) if err != nil { return nil, err } @@ -4485,8 +4466,7 @@ func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4590,8 +4570,7 @@ func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Header() http.Head func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribelistingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribelistingrequest) if err != nil { return nil, err } @@ -4695,8 +4674,7 @@ func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Header() func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4796,12 +4774,11 @@ func (c *ProjectsLocationsSubscriptionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4904,12 +4881,11 @@ func (c *ProjectsLocationsSubscriptionsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5003,8 +4979,7 @@ func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5143,12 +5118,11 @@ func (c *ProjectsLocationsSubscriptionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5265,8 +5239,7 @@ func (c *ProjectsLocationsSubscriptionsRefreshCall) Header() http.Header { func (c *ProjectsLocationsSubscriptionsRefreshCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.refreshsubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.refreshsubscriptionrequest) if err != nil { return nil, err } @@ -5367,8 +5340,7 @@ func (c *ProjectsLocationsSubscriptionsRevokeCall) Header() http.Header { func (c *ProjectsLocationsSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokesubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revokesubscriptionrequest) if err != nil { return nil, err } @@ -5471,8 +5443,7 @@ func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } diff --git a/analyticshub/v1beta1/analyticshub-gen.go b/analyticshub/v1beta1/analyticshub-gen.go index 88bcf0c32eb..30b83a0018f 100644 --- a/analyticshub/v1beta1/analyticshub-gen.go +++ b/analyticshub/v1beta1/analyticshub-gen.go @@ -125,7 +125,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,10 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1395,12 +1394,11 @@ func (c *OrganizationsLocationsDataExchangesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+organization}/dataExchanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1524,8 +1522,7 @@ func (c *ProjectsLocationsDataExchangesCreateCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataexchange) if err != nil { return nil, err } @@ -1624,12 +1621,11 @@ func (c *ProjectsLocationsDataExchangesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1732,12 +1728,11 @@ func (c *ProjectsLocationsDataExchangesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1831,8 +1826,7 @@ func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1958,12 +1952,11 @@ func (c *ProjectsLocationsDataExchangesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataExchanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2087,8 +2080,7 @@ func (c *ProjectsLocationsDataExchangesPatchCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataexchange) if err != nil { return nil, err } @@ -2190,8 +2182,7 @@ func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2294,8 +2285,7 @@ func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2406,8 +2396,7 @@ func (c *ProjectsLocationsDataExchangesListingsCreateCall) Header() http.Header func (c *ProjectsLocationsDataExchangesListingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listing) if err != nil { return nil, err } @@ -2506,12 +2495,11 @@ func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Header() http.Header func (c *ProjectsLocationsDataExchangesListingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2614,12 +2602,11 @@ func (c *ProjectsLocationsDataExchangesListingsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2713,8 +2700,7 @@ func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2840,12 +2826,11 @@ func (c *ProjectsLocationsDataExchangesListingsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2968,8 +2953,7 @@ func (c *ProjectsLocationsDataExchangesListingsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataExchangesListingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listing) if err != nil { return nil, err } @@ -3071,8 +3055,7 @@ func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3176,8 +3159,7 @@ func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Header() http.Head func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribelistingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribelistingrequest) if err != nil { return nil, err } @@ -3281,8 +3263,7 @@ func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Header() func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/analyticsreporting/v4/analyticsreporting-gen.go b/analyticsreporting/v4/analyticsreporting-gen.go index 1fee3be0a14..6715545ccc4 100644 --- a/analyticsreporting/v4/analyticsreporting-gen.go +++ b/analyticsreporting/v4/analyticsreporting-gen.go @@ -123,7 +123,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Reports = NewReportsService(s) + s.UserActivity = NewUserActivityService(s) if err != nil { return nil, err } @@ -142,10 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Reports = NewReportsService(s) - s.UserActivity = NewUserActivityService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2176,8 +2175,7 @@ func (c *ReportsBatchGetCall) Header() http.Header { func (c *ReportsBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getreportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getreportsrequest) if err != nil { return nil, err } @@ -2271,8 +2269,7 @@ func (c *UserActivitySearchCall) Header() http.Header { func (c *UserActivitySearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchuseractivityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchuseractivityrequest) if err != nil { return nil, err } diff --git a/androiddeviceprovisioning/v1/androiddeviceprovisioning-gen.go b/androiddeviceprovisioning/v1/androiddeviceprovisioning-gen.go index a832a6a940d..9fe594f17e8 100644 --- a/androiddeviceprovisioning/v1/androiddeviceprovisioning-gen.go +++ b/androiddeviceprovisioning/v1/androiddeviceprovisioning-gen.go @@ -103,7 +103,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Operations = NewOperationsService(s) + s.Partners = NewPartnersService(s) if err != nil { return nil, err } @@ -122,11 +125,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Operations = NewOperationsService(s) - s.Partners = NewPartnersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1770,12 +1769,11 @@ func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1889,8 +1887,7 @@ func (c *CustomersConfigurationsCreateCall) Header() http.Header { func (c *CustomersConfigurationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configuration) if err != nil { return nil, err } @@ -1991,12 +1988,11 @@ func (c *CustomersConfigurationsDeleteCall) Header() http.Header { func (c *CustomersConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2099,12 +2095,11 @@ func (c *CustomersConfigurationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2207,12 +2202,11 @@ func (c *CustomersConfigurationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configurations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2317,8 +2311,7 @@ func (c *CustomersConfigurationsPatchCall) Header() http.Header { func (c *CustomersConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configuration) if err != nil { return nil, err } @@ -2422,8 +2415,7 @@ func (c *CustomersDevicesApplyConfigurationCall) Header() http.Header { func (c *CustomersDevicesApplyConfigurationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerapplyconfigurationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customerapplyconfigurationrequest) if err != nil { return nil, err } @@ -2534,12 +2526,11 @@ func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2657,12 +2648,11 @@ func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2777,8 +2767,7 @@ func (c *CustomersDevicesRemoveConfigurationCall) Header() http.Header { func (c *CustomersDevicesRemoveConfigurationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerremoveconfigurationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customerremoveconfigurationrequest) if err != nil { return nil, err } @@ -2881,8 +2870,7 @@ func (c *CustomersDevicesUnclaimCall) Header() http.Header { func (c *CustomersDevicesUnclaimCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerunclaimdevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customerunclaimdevicerequest) if err != nil { return nil, err } @@ -2994,12 +2982,11 @@ func (c *CustomersDpcsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dpcs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3104,12 +3091,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3206,8 +3192,7 @@ func (c *PartnersCustomersCreateCall) Header() http.Header { func (c *PartnersCustomersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcustomerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcustomerrequest) if err != nil { return nil, err } @@ -3333,12 +3318,11 @@ func (c *PartnersCustomersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3454,8 +3438,7 @@ func (c *PartnersDevicesClaimCall) Header() http.Header { func (c *PartnersDevicesClaimCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimdevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.claimdevicerequest) if err != nil { return nil, err } @@ -3558,8 +3541,7 @@ func (c *PartnersDevicesClaimAsyncCall) Header() http.Header { func (c *PartnersDevicesClaimAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimdevicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.claimdevicesrequest) if err != nil { return nil, err } @@ -3659,8 +3641,7 @@ func (c *PartnersDevicesFindByIdentifierCall) Header() http.Header { func (c *PartnersDevicesFindByIdentifierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finddevicesbydeviceidentifierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finddevicesbydeviceidentifierrequest) if err != nil { return nil, err } @@ -3785,8 +3766,7 @@ func (c *PartnersDevicesFindByOwnerCall) Header() http.Header { func (c *PartnersDevicesFindByOwnerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finddevicesbyownerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finddevicesbyownerrequest) if err != nil { return nil, err } @@ -3919,12 +3899,11 @@ func (c *PartnersDevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4016,8 +3995,7 @@ func (c *PartnersDevicesGetSimLockStateCall) Header() http.Header { func (c *PartnersDevicesGetSimLockStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getdevicesimlockstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getdevicesimlockstaterequest) if err != nil { return nil, err } @@ -4123,8 +4101,7 @@ func (c *PartnersDevicesMetadataCall) Header() http.Header { func (c *PartnersDevicesMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedevicemetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatedevicemetadatarequest) if err != nil { return nil, err } @@ -4226,8 +4203,7 @@ func (c *PartnersDevicesUnclaimCall) Header() http.Header { func (c *PartnersDevicesUnclaimCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimdevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unclaimdevicerequest) if err != nil { return nil, err } @@ -4330,8 +4306,7 @@ func (c *PartnersDevicesUnclaimAsyncCall) Header() http.Header { func (c *PartnersDevicesUnclaimAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimdevicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unclaimdevicesrequest) if err != nil { return nil, err } @@ -4435,8 +4410,7 @@ func (c *PartnersDevicesUpdateMetadataAsyncCall) Header() http.Header { func (c *PartnersDevicesUpdateMetadataAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedevicemetadatainbatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatedevicemetadatainbatchrequest) if err != nil { return nil, err } @@ -4560,12 +4534,11 @@ func (c *PartnersVendorsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vendors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4704,12 +4677,11 @@ func (c *PartnersVendorsCustomersListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/androidenterprise/v1/androidenterprise-gen.go b/androidenterprise/v1/androidenterprise-gen.go index f4ef8c890ca..afe1a07f45a 100644 --- a/androidenterprise/v1/androidenterprise-gen.go +++ b/androidenterprise/v1/androidenterprise-gen.go @@ -114,25 +114,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.Devices = NewDevicesService(s) s.Enterprises = NewEnterprisesService(s) @@ -150,9 +131,27 @@ func New(client *http.Client) (*Service, error) { s.Storelayoutpages = NewStorelayoutpagesService(s) s.Users = NewUsersService(s) s.Webapps = NewWebappsService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL @@ -3489,12 +3488,11 @@ func (c *DevicesForceReportUploadCall) Header() http.Header { func (c *DevicesForceReportUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3581,12 +3579,11 @@ func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3700,12 +3697,11 @@ func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3812,12 +3808,11 @@ func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3921,8 +3916,7 @@ func (c *DevicesSetStateCall) Header() http.Header { func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.devicestate) if err != nil { return nil, err } @@ -4045,8 +4039,7 @@ func (c *DevicesUpdateCall) Header() http.Header { func (c *DevicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.device) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.device) if err != nil { return nil, err } @@ -4152,12 +4145,11 @@ func (c *EnterprisesAcknowledgeNotificationSetCall) Header() http.Header { func (c *EnterprisesAcknowledgeNotificationSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/acknowledgeNotificationSet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4233,12 +4225,11 @@ func (c *EnterprisesCompleteSignupCall) Header() http.Header { func (c *EnterprisesCompleteSignupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/completeSignup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4374,12 +4365,11 @@ func (c *EnterprisesCreateEnrollmentTokenCall) Header() http.Header { func (c *EnterprisesCreateEnrollmentTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/createEnrollmentToken") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4475,8 +4465,7 @@ func (c *EnterprisesCreateWebTokenCall) Header() http.Header { func (c *EnterprisesCreateWebTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.administratorwebtokenspec) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.administratorwebtokenspec) if err != nil { return nil, err } @@ -4576,8 +4565,7 @@ func (c *EnterprisesEnrollCall) Header() http.Header { func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enterprise) if err != nil { return nil, err } @@ -4689,12 +4677,11 @@ func (c *EnterprisesGenerateSignupUrlCall) Header() http.Header { func (c *EnterprisesGenerateSignupUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/signupUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4793,12 +4780,11 @@ func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4926,12 +4912,11 @@ func (c *EnterprisesGetServiceAccountCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5035,12 +5020,11 @@ func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5145,12 +5129,11 @@ func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5266,12 +5249,11 @@ func (c *EnterprisesPullNotificationSetCall) Header() http.Header { func (c *EnterprisesPullNotificationSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/pullNotificationSet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5360,12 +5342,11 @@ func (c *EnterprisesSendTestPushNotificationCall) Header() http.Header { func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5459,8 +5440,7 @@ func (c *EnterprisesSetAccountCall) Header() http.Header { func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enterpriseaccount) if err != nil { return nil, err } @@ -5568,8 +5548,7 @@ func (c *EnterprisesSetStoreLayoutCall) Header() http.Header { func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storelayout) if err != nil { return nil, err } @@ -5667,12 +5646,11 @@ func (c *EnterprisesUnenrollCall) Header() http.Header { func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5748,12 +5726,11 @@ func (c *EntitlementsDeleteCall) Header() http.Header { func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5843,12 +5820,11 @@ func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5957,12 +5933,11 @@ func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6075,8 +6050,7 @@ func (c *EntitlementsUpdateCall) Header() http.Header { func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entitlement) if err != nil { return nil, err } @@ -6194,12 +6168,11 @@ func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6304,12 +6277,11 @@ func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6418,12 +6390,11 @@ func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6530,12 +6501,11 @@ func (c *InstallsDeleteCall) Header() http.Header { func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6627,12 +6597,11 @@ func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6743,12 +6712,11 @@ func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6855,8 +6823,7 @@ func (c *InstallsUpdateCall) Header() http.Header { func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.install) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.install) if err != nil { return nil, err } @@ -6968,12 +6935,11 @@ func (c *ManagedconfigurationsfordeviceDeleteCall) Header() http.Header { func (c *ManagedconfigurationsfordeviceDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7065,12 +7031,11 @@ func (c *ManagedconfigurationsfordeviceGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7183,12 +7148,11 @@ func (c *ManagedconfigurationsfordeviceListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7294,8 +7258,7 @@ func (c *ManagedconfigurationsfordeviceUpdateCall) Header() http.Header { func (c *ManagedconfigurationsfordeviceUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedconfiguration) if err != nil { return nil, err } @@ -7405,12 +7368,11 @@ func (c *ManagedconfigurationsforuserDeleteCall) Header() http.Header { func (c *ManagedconfigurationsforuserDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7499,12 +7461,11 @@ func (c *ManagedconfigurationsforuserGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7613,12 +7574,11 @@ func (c *ManagedconfigurationsforuserListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7724,8 +7684,7 @@ func (c *ManagedconfigurationsforuserUpdateCall) Header() http.Header { func (c *ManagedconfigurationsforuserUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedconfiguration) if err != nil { return nil, err } @@ -7842,12 +7801,11 @@ func (c *ManagedconfigurationssettingsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7959,12 +7917,11 @@ func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8064,8 +8021,7 @@ func (c *ProductsApproveCall) Header() http.Header { func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productsapproverequest) if err != nil { return nil, err } @@ -8161,12 +8117,11 @@ func (c *ProductsGenerateApprovalUrlCall) Header() http.Header { func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8280,12 +8235,11 @@ func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8403,12 +8357,11 @@ func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8515,12 +8468,11 @@ func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8668,12 +8620,11 @@ func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8770,12 +8721,11 @@ func (c *ProductsUnapproveCall) Header() http.Header { func (c *ProductsUnapproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8850,12 +8800,11 @@ func (c *ServiceaccountkeysDeleteCall) Header() http.Header { func (c *ServiceaccountkeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8929,8 +8878,7 @@ func (c *ServiceaccountkeysInsertCall) Header() http.Header { func (c *ServiceaccountkeysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccountkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceaccountkey) if err != nil { return nil, err } @@ -9045,12 +8993,11 @@ func (c *ServiceaccountkeysListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9147,12 +9094,11 @@ func (c *StorelayoutclustersDeleteCall) Header() http.Header { func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9239,12 +9185,11 @@ func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9341,8 +9286,7 @@ func (c *StorelayoutclustersInsertCall) Header() http.Header { func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storecluster) if err != nil { return nil, err } @@ -9456,12 +9400,11 @@ func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9561,8 +9504,7 @@ func (c *StorelayoutclustersUpdateCall) Header() http.Header { func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storecluster) if err != nil { return nil, err } @@ -9665,12 +9607,11 @@ func (c *StorelayoutpagesDeleteCall) Header() http.Header { func (c *StorelayoutpagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9753,12 +9694,11 @@ func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9851,8 +9791,7 @@ func (c *StorelayoutpagesInsertCall) Header() http.Header { func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storepage) if err != nil { return nil, err } @@ -9962,12 +9901,11 @@ func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10063,8 +10001,7 @@ func (c *StorelayoutpagesUpdateCall) Header() http.Header { func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storepage) if err != nil { return nil, err } @@ -10166,12 +10103,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10246,12 +10182,11 @@ func (c *UsersGenerateAuthenticationTokenCall) Header() http.Header { func (c *UsersGenerateAuthenticationTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10358,12 +10293,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10471,12 +10405,11 @@ func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10573,8 +10506,7 @@ func (c *UsersInsertCall) Header() http.Header { func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -10688,12 +10620,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10790,12 +10721,11 @@ func (c *UsersRevokeDeviceAccessCall) Header() http.Header { func (c *UsersRevokeDeviceAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10873,8 +10803,7 @@ func (c *UsersSetAvailableProductSetCall) Header() http.Header { func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productset) if err != nil { return nil, err } @@ -10982,8 +10911,7 @@ func (c *UsersUpdateCall) Header() http.Header { func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -11085,12 +11013,11 @@ func (c *WebappsDeleteCall) Header() http.Header { func (c *WebappsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11173,12 +11100,11 @@ func (c *WebappsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11271,8 +11197,7 @@ func (c *WebappsInsertCall) Header() http.Header { func (c *WebappsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webapp) if err != nil { return nil, err } @@ -11382,12 +11307,11 @@ func (c *WebappsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11483,8 +11407,7 @@ func (c *WebappsUpdateCall) Header() http.Header { func (c *WebappsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webapp) if err != nil { return nil, err } diff --git a/androidmanagement/v1/androidmanagement-gen.go b/androidmanagement/v1/androidmanagement-gen.go index 318233fba53..d675abc1815 100644 --- a/androidmanagement/v1/androidmanagement-gen.go +++ b/androidmanagement/v1/androidmanagement-gen.go @@ -114,7 +114,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Enterprises = NewEnterprisesService(s) + s.ProvisioningInfo = NewProvisioningInfoService(s) + s.SignupUrls = NewSignupUrlsService(s) if err != nil { return nil, err } @@ -133,11 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Enterprises = NewEnterprisesService(s) - s.ProvisioningInfo = NewProvisioningInfoService(s) - s.SignupUrls = NewSignupUrlsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6935,8 +6934,7 @@ func (c *EnterprisesCreateCall) Header() http.Header { func (c *EnterprisesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enterprise) if err != nil { return nil, err } @@ -7034,12 +7032,11 @@ func (c *EnterprisesDeleteCall) Header() http.Header { func (c *EnterprisesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7141,12 +7138,11 @@ func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7280,12 +7276,11 @@ func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/enterprises") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7404,8 +7399,7 @@ func (c *EnterprisesPatchCall) Header() http.Header { func (c *EnterprisesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enterprise) if err != nil { return nil, err } @@ -7525,12 +7519,11 @@ func (c *EnterprisesApplicationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7650,12 +7643,11 @@ func (c *EnterprisesDevicesDeleteCall) Header() http.Header { func (c *EnterprisesDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7758,12 +7750,11 @@ func (c *EnterprisesDevicesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7858,8 +7849,7 @@ func (c *EnterprisesDevicesIssueCommandCall) Header() http.Header { func (c *EnterprisesDevicesIssueCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.command) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.command) if err != nil { return nil, err } @@ -7984,12 +7974,11 @@ func (c *EnterprisesDevicesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8112,8 +8101,7 @@ func (c *EnterprisesDevicesPatchCall) Header() http.Header { func (c *EnterprisesDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.device) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.device) if err != nil { return nil, err } @@ -8219,12 +8207,11 @@ func (c *EnterprisesDevicesOperationsCancelCall) Header() http.Header { func (c *EnterprisesDevicesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8328,12 +8315,11 @@ func (c *EnterprisesDevicesOperationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8456,12 +8442,11 @@ func (c *EnterprisesDevicesOperationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8577,8 +8562,7 @@ func (c *EnterprisesEnrollmentTokensCreateCall) Header() http.Header { func (c *EnterprisesEnrollmentTokensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollmenttoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollmenttoken) if err != nil { return nil, err } @@ -8679,12 +8663,11 @@ func (c *EnterprisesEnrollmentTokensDeleteCall) Header() http.Header { func (c *EnterprisesEnrollmentTokensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8792,12 +8775,11 @@ func (c *EnterprisesEnrollmentTokensGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8922,12 +8904,11 @@ func (c *EnterprisesEnrollmentTokensListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/enrollmentTokens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9047,8 +9028,7 @@ func (c *EnterprisesMigrationTokensCreateCall) Header() http.Header { func (c *EnterprisesMigrationTokensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationtoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrationtoken) if err != nil { return nil, err } @@ -9159,12 +9139,11 @@ func (c *EnterprisesMigrationTokensGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9285,12 +9264,11 @@ func (c *EnterprisesMigrationTokensListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/migrationTokens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9404,12 +9382,11 @@ func (c *EnterprisesPoliciesDeleteCall) Header() http.Header { func (c *EnterprisesPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9512,12 +9489,11 @@ func (c *EnterprisesPoliciesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9633,12 +9609,11 @@ func (c *EnterprisesPoliciesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9761,8 +9736,7 @@ func (c *EnterprisesPoliciesPatchCall) Header() http.Header { func (c *EnterprisesPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -9862,8 +9836,7 @@ func (c *EnterprisesWebAppsCreateCall) Header() http.Header { func (c *EnterprisesWebAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webapp) if err != nil { return nil, err } @@ -9962,12 +9935,11 @@ func (c *EnterprisesWebAppsDeleteCall) Header() http.Header { func (c *EnterprisesWebAppsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10070,12 +10042,11 @@ func (c *EnterprisesWebAppsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10191,12 +10162,11 @@ func (c *EnterprisesWebAppsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/webApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10319,8 +10289,7 @@ func (c *EnterprisesWebAppsPatchCall) Header() http.Header { func (c *EnterprisesWebAppsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webapp) if err != nil { return nil, err } @@ -10421,8 +10390,7 @@ func (c *EnterprisesWebTokensCreateCall) Header() http.Header { func (c *EnterprisesWebTokensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webtoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webtoken) if err != nil { return nil, err } @@ -10534,12 +10502,11 @@ func (c *ProvisioningInfoGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10653,12 +10620,11 @@ func (c *SignupUrlsCreateCall) Header() http.Header { func (c *SignupUrlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/signupUrls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go index 6b76396076e..a57031b509a 100644 --- a/androidpublisher/v3/androidpublisher-gen.go +++ b/androidpublisher/v3/androidpublisher-gen.go @@ -114,7 +114,21 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Applications = NewApplicationsService(s) + s.Apprecovery = NewApprecoveryService(s) + s.Edits = NewEditsService(s) + s.Externaltransactions = NewExternaltransactionsService(s) + s.Generatedapks = NewGeneratedapksService(s) + s.Grants = NewGrantsService(s) + s.Inappproducts = NewInappproductsService(s) + s.Internalappsharingartifacts = NewInternalappsharingartifactsService(s) + s.Monetization = NewMonetizationService(s) + s.Orders = NewOrdersService(s) + s.Purchases = NewPurchasesService(s) + s.Reviews = NewReviewsService(s) + s.Systemapks = NewSystemapksService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -133,22 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Applications = NewApplicationsService(s) - s.Apprecovery = NewApprecoveryService(s) - s.Edits = NewEditsService(s) - s.Externaltransactions = NewExternaltransactionsService(s) - s.Generatedapks = NewGeneratedapksService(s) - s.Grants = NewGrantsService(s) - s.Inappproducts = NewInappproductsService(s) - s.Internalappsharingartifacts = NewInternalappsharingartifactsService(s) - s.Monetization = NewMonetizationService(s) - s.Orders = NewOrdersService(s) - s.Purchases = NewPurchasesService(s) - s.Reviews = NewReviewsService(s) - s.Systemapks = NewSystemapksService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7691,8 +7690,7 @@ func (c *ApplicationsDataSafetyCall) Header() http.Header { func (c *ApplicationsDataSafetyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.safetylabelsupdaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.safetylabelsupdaterequest) if err != nil { return nil, err } @@ -7801,8 +7799,7 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Header() http.Header { func (c *ApplicationsDeviceTierConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicetierconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.devicetierconfig) if err != nil { return nil, err } @@ -7916,12 +7913,11 @@ func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8044,12 +8040,11 @@ func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8169,8 +8164,7 @@ func (c *ApprecoveryAddTargetingCall) Header() http.Header { func (c *ApprecoveryAddTargetingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addtargetingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addtargetingrequest) if err != nil { return nil, err } @@ -8277,8 +8271,7 @@ func (c *ApprecoveryCancelCall) Header() http.Header { func (c *ApprecoveryCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelapprecoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelapprecoveryrequest) if err != nil { return nil, err } @@ -8382,8 +8375,7 @@ func (c *ApprecoveryCreateCall) Header() http.Header { func (c *ApprecoveryCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createdraftapprecoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createdraftapprecoveryrequest) if err != nil { return nil, err } @@ -8490,8 +8482,7 @@ func (c *ApprecoveryDeployCall) Header() http.Header { func (c *ApprecoveryDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployapprecoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployapprecoveryrequest) if err != nil { return nil, err } @@ -8612,12 +8603,11 @@ func (c *ApprecoveryListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/appRecoveries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8721,12 +8711,11 @@ func (c *EditsCommitCall) Header() http.Header { func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8820,12 +8809,11 @@ func (c *EditsDeleteCall) Header() http.Header { func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8908,12 +8896,11 @@ func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9006,8 +8993,7 @@ func (c *EditsInsertCall) Header() http.Header { func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appedit) if err != nil { return nil, err } @@ -9108,12 +9094,11 @@ func (c *EditsValidateCall) Header() http.Header { func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9212,8 +9197,7 @@ func (c *EditsApksAddexternallyhostedCall) Header() http.Header { func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apksaddexternallyhostedrequest) if err != nil { return nil, err } @@ -9328,12 +9312,11 @@ func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9466,8 +9449,7 @@ func (c *EditsApksUploadCall) Header() http.Header { } func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") @@ -9475,14 +9457,10 @@ func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -9606,12 +9584,11 @@ func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9765,8 +9742,7 @@ func (c *EditsBundlesUploadCall) Header() http.Header { } func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") @@ -9774,14 +9750,10 @@ func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -9908,12 +9880,11 @@ func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10054,8 +10025,7 @@ func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header { } func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") @@ -10063,14 +10033,10 @@ func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Respons urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -10197,12 +10163,11 @@ func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10298,8 +10263,7 @@ func (c *EditsDetailsPatchCall) Header() http.Header { func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appdetails) if err != nil { return nil, err } @@ -10403,8 +10367,7 @@ func (c *EditsDetailsUpdateCall) Header() http.Header { func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appdetails) if err != nil { return nil, err } @@ -10526,12 +10489,11 @@ func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10638,8 +10600,7 @@ func (c *EditsExpansionfilesPatchCall) Header() http.Header { func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.expansionfile) if err != nil { return nil, err } @@ -10754,8 +10715,7 @@ func (c *EditsExpansionfilesUpdateCall) Header() http.Header { func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.expansionfile) if err != nil { return nil, err } @@ -10905,8 +10865,7 @@ func (c *EditsExpansionfilesUploadCall) Header() http.Header { } func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") @@ -10914,14 +10873,10 @@ func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, e urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -11047,12 +11002,11 @@ func (c *EditsImagesDeleteCall) Header() http.Header { func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11136,12 +11090,11 @@ func (c *EditsImagesDeleteallCall) Header() http.Header { func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11259,12 +11212,11 @@ func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11408,8 +11360,7 @@ func (c *EditsImagesUploadCall) Header() http.Header { } func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") @@ -11417,14 +11368,10 @@ func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -11543,12 +11490,11 @@ func (c *EditsListingsDeleteCall) Header() http.Header { func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11620,12 +11566,11 @@ func (c *EditsListingsDeleteallCall) Header() http.Header { func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11712,12 +11657,11 @@ func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11824,12 +11768,11 @@ func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11930,8 +11873,7 @@ func (c *EditsListingsPatchCall) Header() http.Header { func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listing) if err != nil { return nil, err } @@ -12040,8 +11982,7 @@ func (c *EditsListingsUpdateCall) Header() http.Header { func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listing) if err != nil { return nil, err } @@ -12159,12 +12100,11 @@ func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12264,8 +12204,7 @@ func (c *EditsTestersPatchCall) Header() http.Header { func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testers) if err != nil { return nil, err } @@ -12374,8 +12313,7 @@ func (c *EditsTestersUpdateCall) Header() http.Header { func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testers) if err != nil { return nil, err } @@ -12480,8 +12418,7 @@ func (c *EditsTracksCreateCall) Header() http.Header { func (c *EditsTracksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trackconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trackconfig) if err != nil { return nil, err } @@ -12599,12 +12536,11 @@ func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12711,12 +12647,11 @@ func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12817,8 +12752,7 @@ func (c *EditsTracksPatchCall) Header() http.Header { func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.track2) if err != nil { return nil, err } @@ -12927,8 +12861,7 @@ func (c *EditsTracksUpdateCall) Header() http.Header { func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.track2) if err != nil { return nil, err } @@ -13042,8 +12975,7 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) Header() http.Header func (c *ExternaltransactionsCreateexternaltransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externaltransaction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externaltransaction) if err != nil { return nil, err } @@ -13155,12 +13087,11 @@ func (c *ExternaltransactionsGetexternaltransactionCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13255,8 +13186,7 @@ func (c *ExternaltransactionsRefundexternaltransactionCall) Header() http.Header func (c *ExternaltransactionsRefundexternaltransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.refundexternaltransactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.refundexternaltransactionrequest) if err != nil { return nil, err } @@ -13374,12 +13304,11 @@ func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13480,12 +13409,11 @@ func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13580,8 +13508,7 @@ func (c *GrantsCreateCall) Header() http.Header { func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grant) if err != nil { return nil, err } @@ -13681,12 +13608,11 @@ func (c *GrantsDeleteCall) Header() http.Header { func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13765,8 +13691,7 @@ func (c *GrantsPatchCall) Header() http.Header { func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grant) if err != nil { return nil, err } @@ -13872,8 +13797,7 @@ func (c *InappproductsBatchDeleteCall) Header() http.Header { func (c *InappproductsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproductsbatchdeleterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inappproductsbatchdeleterequest) if err != nil { return nil, err } @@ -13971,12 +13895,11 @@ func (c *InappproductsBatchGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14075,8 +13998,7 @@ func (c *InappproductsBatchUpdateCall) Header() http.Header { func (c *InappproductsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproductsbatchupdaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inappproductsbatchupdaterequest) if err != nil { return nil, err } @@ -14206,12 +14128,11 @@ func (c *InappproductsDeleteCall) Header() http.Header { func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14298,12 +14219,11 @@ func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14410,8 +14330,7 @@ func (c *InappproductsInsertCall) Header() http.Header { func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inappproduct) if err != nil { return nil, err } @@ -14549,12 +14468,11 @@ func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14687,8 +14605,7 @@ func (c *InappproductsPatchCall) Header() http.Header { func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inappproduct) if err != nil { return nil, err } @@ -14838,8 +14755,7 @@ func (c *InappproductsUpdateCall) Header() http.Header { func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inappproduct) if err != nil { return nil, err } @@ -14981,8 +14897,7 @@ func (c *InternalappsharingartifactsUploadapkCall) Header() http.Header { } func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") @@ -14990,14 +14905,10 @@ func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http. urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -15149,8 +15060,7 @@ func (c *InternalappsharingartifactsUploadbundleCall) Header() http.Header { } func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") @@ -15158,14 +15068,10 @@ func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*ht urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -15278,8 +15184,7 @@ func (c *MonetizationConvertRegionPricesCall) Header() http.Header { func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertregionpricesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.convertregionpricesrequest) if err != nil { return nil, err } @@ -15384,8 +15289,7 @@ func (c *MonetizationSubscriptionsArchiveCall) Header() http.Header { func (c *MonetizationSubscriptionsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.archivesubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.archivesubscriptionrequest) if err != nil { return nil, err } @@ -15505,12 +15409,11 @@ func (c *MonetizationSubscriptionsBatchGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15608,8 +15511,7 @@ func (c *MonetizationSubscriptionsBatchUpdateCall) Header() http.Header { func (c *MonetizationSubscriptionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatesubscriptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatesubscriptionsrequest) if err != nil { return nil, err } @@ -15736,8 +15638,7 @@ func (c *MonetizationSubscriptionsCreateCall) Header() http.Header { func (c *MonetizationSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -15840,12 +15741,11 @@ func (c *MonetizationSubscriptionsDeleteCall) Header() http.Header { func (c *MonetizationSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15928,12 +15828,11 @@ func (c *MonetizationSubscriptionsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16062,12 +15961,11 @@ func (c *MonetizationSubscriptionsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16243,8 +16141,7 @@ func (c *MonetizationSubscriptionsPatchCall) Header() http.Header { func (c *MonetizationSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -16352,8 +16249,7 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) Header() http.Header { func (c *MonetizationSubscriptionsBasePlansActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatebaseplanrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatebaseplanrequest) if err != nil { return nil, err } @@ -16465,8 +16361,7 @@ func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) Header() http func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchmigratebaseplanpricesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchmigratebaseplanpricesrequest) if err != nil { return nil, err } @@ -16576,8 +16471,7 @@ func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) Header() http. func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatebaseplanstatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatebaseplanstatesrequest) if err != nil { return nil, err } @@ -16687,8 +16581,7 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Header() http.Header func (c *MonetizationSubscriptionsBasePlansDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatebaseplanrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatebaseplanrequest) if err != nil { return nil, err } @@ -16795,12 +16688,11 @@ func (c *MonetizationSubscriptionsBasePlansDeleteCall) Header() http.Header { func (c *MonetizationSubscriptionsBasePlansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16881,8 +16773,7 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Header() http.Head func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratebaseplanpricesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migratebaseplanpricesrequest) if err != nil { return nil, err } @@ -16995,8 +16886,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Header() http.Hea func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatesubscriptionofferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatesubscriptionofferrequest) if err != nil { return nil, err } @@ -17111,8 +17001,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) Header() http.Hea func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetsubscriptionoffersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchgetsubscriptionoffersrequest) if err != nil { return nil, err } @@ -17230,8 +17119,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) Header() http. func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatesubscriptionoffersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatesubscriptionoffersrequest) if err != nil { return nil, err } @@ -17349,8 +17237,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) Header() func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatesubscriptionofferstatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatesubscriptionofferstatesrequest) if err != nil { return nil, err } @@ -17490,8 +17377,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) Header() http.Heade func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionoffer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscriptionoffer) if err != nil { return nil, err } @@ -17605,8 +17491,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) Header() http.H func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatesubscriptionofferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatesubscriptionofferrequest) if err != nil { return nil, err } @@ -17718,12 +17603,11 @@ func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) Header() http.Heade func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17814,12 +17698,11 @@ func (c *MonetizationSubscriptionsBasePlansOffersGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17953,12 +17836,11 @@ func (c *MonetizationSubscriptionsBasePlansOffersListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18142,8 +18024,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) Header() http.Header func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionoffer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscriptionoffer) if err != nil { return nil, err } @@ -18261,12 +18142,11 @@ func (c *OrdersRefundCall) Header() http.Header { func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/orders/{orderId}:refund") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -18344,8 +18224,7 @@ func (c *PurchasesProductsAcknowledgeCall) Header() http.Header { func (c *PurchasesProductsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productpurchasesacknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productpurchasesacknowledgerequest) if err != nil { return nil, err } @@ -18430,12 +18309,11 @@ func (c *PurchasesProductsConsumeCall) Header() http.Header { func (c *PurchasesProductsConsumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:consume") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -18524,12 +18402,11 @@ func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18632,8 +18509,7 @@ func (c *PurchasesSubscriptionsAcknowledgeCall) Header() http.Header { func (c *PurchasesSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesacknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscriptionpurchasesacknowledgerequest) if err != nil { return nil, err } @@ -18719,12 +18595,11 @@ func (c *PurchasesSubscriptionsCancelCall) Header() http.Header { func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -18804,8 +18679,7 @@ func (c *PurchasesSubscriptionsDeferCall) Header() http.Header { func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscriptionpurchasesdeferrequest) if err != nil { return nil, err } @@ -18927,12 +18801,11 @@ func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19035,12 +18908,11 @@ func (c *PurchasesSubscriptionsRefundCall) Header() http.Header { func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19119,12 +18991,11 @@ func (c *PurchasesSubscriptionsRevokeCall) Header() http.Header { func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19210,12 +19081,11 @@ func (c *PurchasesSubscriptionsv2GetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19314,8 +19184,7 @@ func (c *PurchasesSubscriptionsv2RevokeCall) Header() http.Header { func (c *PurchasesSubscriptionsv2RevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokesubscriptionpurchaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revokesubscriptionpurchaserequest) if err != nil { return nil, err } @@ -19501,12 +19370,11 @@ func (c *PurchasesVoidedpurchasesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/voidedpurchases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19619,12 +19487,11 @@ func (c *ReviewsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19755,12 +19622,11 @@ func (c *ReviewsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/reviews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19856,8 +19722,7 @@ func (c *ReviewsReplyCall) Header() http.Header { func (c *ReviewsReplyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reviewsreplyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reviewsreplyrequest) if err != nil { return nil, err } @@ -19963,8 +19828,7 @@ func (c *SystemapksVariantsCreateCall) Header() http.Header { func (c *SystemapksVariantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variant) if err != nil { return nil, err } @@ -20082,12 +19946,11 @@ func (c *SystemapksVariantsDownloadCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20190,12 +20053,11 @@ func (c *SystemapksVariantsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20302,12 +20164,11 @@ func (c *SystemapksVariantsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20402,8 +20263,7 @@ func (c *UsersCreateCall) Header() http.Header { func (c *UsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -20502,12 +20362,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20601,12 +20460,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20728,8 +20586,7 @@ func (c *UsersPatchCall) Header() http.Header { func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } diff --git a/apigateway/v1/apigateway-gen.go b/apigateway/v1/apigateway-gen.go index 9f6782d0a1b..cddc8cc35bc 100644 --- a/apigateway/v1/apigateway-gen.go +++ b/apigateway/v1/apigateway-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1281,12 +1280,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1413,12 +1411,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1540,8 +1537,7 @@ func (c *ProjectsLocationsApisCreateCall) Header() http.Header { func (c *ProjectsLocationsApisCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapi) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapi) if err != nil { return nil, err } @@ -1640,12 +1636,11 @@ func (c *ProjectsLocationsApisDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1748,12 +1743,11 @@ func (c *ProjectsLocationsApisGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1875,12 +1869,11 @@ func (c *ProjectsLocationsApisGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2008,12 +2001,11 @@ func (c *ProjectsLocationsApisListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2138,8 +2130,7 @@ func (c *ProjectsLocationsApisPatchCall) Header() http.Header { func (c *ProjectsLocationsApisPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapi) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapi) if err != nil { return nil, err } @@ -2244,8 +2235,7 @@ func (c *ProjectsLocationsApisSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaysetiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaysetiampolicyrequest) if err != nil { return nil, err } @@ -2353,8 +2343,7 @@ func (c *ProjectsLocationsApisTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsApisTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaytestiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaytestiampermissionsrequest) if err != nil { return nil, err } @@ -2464,8 +2453,7 @@ func (c *ProjectsLocationsApisConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapiconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapiconfig) if err != nil { return nil, err } @@ -2565,12 +2553,11 @@ func (c *ProjectsLocationsApisConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2687,12 +2674,11 @@ func (c *ProjectsLocationsApisConfigsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2815,12 +2801,11 @@ func (c *ProjectsLocationsApisConfigsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2948,12 +2933,11 @@ func (c *ProjectsLocationsApisConfigsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3079,8 +3063,7 @@ func (c *ProjectsLocationsApisConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapiconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapiconfig) if err != nil { return nil, err } @@ -3185,8 +3168,7 @@ func (c *ProjectsLocationsApisConfigsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaysetiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaysetiampolicyrequest) if err != nil { return nil, err } @@ -3294,8 +3276,7 @@ func (c *ProjectsLocationsApisConfigsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsApisConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaytestiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaytestiampermissionsrequest) if err != nil { return nil, err } @@ -3404,8 +3385,7 @@ func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaygateway) if err != nil { return nil, err } @@ -3504,12 +3484,11 @@ func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3612,12 +3591,11 @@ func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3740,12 +3718,11 @@ func (c *ProjectsLocationsGatewaysGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3873,12 +3850,11 @@ func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4003,8 +3979,7 @@ func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header { func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaygateway) if err != nil { return nil, err } @@ -4109,8 +4084,7 @@ func (c *ProjectsLocationsGatewaysSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaysetiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaysetiampolicyrequest) if err != nil { return nil, err } @@ -4218,8 +4192,7 @@ func (c *ProjectsLocationsGatewaysTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaytestiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaytestiampermissionsrequest) if err != nil { return nil, err } @@ -4328,8 +4301,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaycanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaycanceloperationrequest) if err != nil { return nil, err } @@ -4430,12 +4402,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4539,12 +4510,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4668,12 +4638,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/apigateway/v1beta/apigateway-gen.go b/apigateway/v1beta/apigateway-gen.go index e134c249a45..ddc44e3cbd7 100644 --- a/apigateway/v1beta/apigateway-gen.go +++ b/apigateway/v1beta/apigateway-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1338,12 +1337,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1470,12 +1468,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1597,8 +1594,7 @@ func (c *ProjectsLocationsApisCreateCall) Header() http.Header { func (c *ProjectsLocationsApisCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapi) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapi) if err != nil { return nil, err } @@ -1697,12 +1693,11 @@ func (c *ProjectsLocationsApisDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1805,12 +1800,11 @@ func (c *ProjectsLocationsApisGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1932,12 +1926,11 @@ func (c *ProjectsLocationsApisGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2065,12 +2058,11 @@ func (c *ProjectsLocationsApisListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apis") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2195,8 +2187,7 @@ func (c *ProjectsLocationsApisPatchCall) Header() http.Header { func (c *ProjectsLocationsApisPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapi) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapi) if err != nil { return nil, err } @@ -2301,8 +2292,7 @@ func (c *ProjectsLocationsApisSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaysetiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaysetiampolicyrequest) if err != nil { return nil, err } @@ -2410,8 +2400,7 @@ func (c *ProjectsLocationsApisTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsApisTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaytestiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaytestiampermissionsrequest) if err != nil { return nil, err } @@ -2521,8 +2510,7 @@ func (c *ProjectsLocationsApisConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapiconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapiconfig) if err != nil { return nil, err } @@ -2622,12 +2610,11 @@ func (c *ProjectsLocationsApisConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2744,12 +2731,11 @@ func (c *ProjectsLocationsApisConfigsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2872,12 +2858,11 @@ func (c *ProjectsLocationsApisConfigsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3005,12 +2990,11 @@ func (c *ProjectsLocationsApisConfigsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/configs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3136,8 +3120,7 @@ func (c *ProjectsLocationsApisConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewayapiconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewayapiconfig) if err != nil { return nil, err } @@ -3242,8 +3225,7 @@ func (c *ProjectsLocationsApisConfigsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaysetiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaysetiampolicyrequest) if err != nil { return nil, err } @@ -3351,8 +3333,7 @@ func (c *ProjectsLocationsApisConfigsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsApisConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaytestiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaytestiampermissionsrequest) if err != nil { return nil, err } @@ -3461,8 +3442,7 @@ func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaygateway) if err != nil { return nil, err } @@ -3561,12 +3541,11 @@ func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3669,12 +3648,11 @@ func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3797,12 +3775,11 @@ func (c *ProjectsLocationsGatewaysGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3930,12 +3907,11 @@ func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/gateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4060,8 +4036,7 @@ func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header { func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaygateway) if err != nil { return nil, err } @@ -4166,8 +4141,7 @@ func (c *ProjectsLocationsGatewaysSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaysetiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaysetiampolicyrequest) if err != nil { return nil, err } @@ -4275,8 +4249,7 @@ func (c *ProjectsLocationsGatewaysTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaytestiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaytestiampermissionsrequest) if err != nil { return nil, err } @@ -4385,8 +4358,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apigatewaycanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apigatewaycanceloperationrequest) if err != nil { return nil, err } @@ -4487,12 +4459,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4596,12 +4567,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4725,12 +4695,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/apigee/v1/apigee-gen.go b/apigee/v1/apigee-gen.go index 07bae4d7d12..44f2489e917 100644 --- a/apigee/v1/apigee-gen.go +++ b/apigee/v1/apigee-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Hybrid = NewHybridService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Hybrid = NewHybridService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -11867,12 +11866,11 @@ func (c *HybridIssuersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11971,8 +11969,7 @@ func (c *OrganizationsCreateCall) Header() http.Header { func (c *OrganizationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1organization) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1organization) if err != nil { return nil, err } @@ -12101,12 +12098,11 @@ func (c *OrganizationsDeleteCall) Header() http.Header { func (c *OrganizationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12212,12 +12208,11 @@ func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12323,12 +12318,11 @@ func (c *OrganizationsGetControlPlaneAccessCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12457,12 +12451,11 @@ func (c *OrganizationsGetDeployedIngressConfigCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12567,12 +12560,11 @@ func (c *OrganizationsGetProjectMappingCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getProjectMapping") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12676,12 +12668,11 @@ func (c *OrganizationsGetRuntimeConfigCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12786,12 +12777,11 @@ func (c *OrganizationsGetSecuritySettingsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12894,8 +12884,7 @@ func (c *OrganizationsGetSyncAuthorizationCall) Header() http.Header { func (c *OrganizationsGetSyncAuthorizationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1getsyncauthorizationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1getsyncauthorizationrequest) if err != nil { return nil, err } @@ -13008,12 +12997,11 @@ func (c *OrganizationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13108,8 +13096,7 @@ func (c *OrganizationsSetAddonsCall) Header() http.Header { func (c *OrganizationsSetAddonsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1setaddonsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1setaddonsrequest) if err != nil { return nil, err } @@ -13220,8 +13207,7 @@ func (c *OrganizationsSetSyncAuthorizationCall) Header() http.Header { func (c *OrganizationsSetSyncAuthorizationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1syncauthorization) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1syncauthorization) if err != nil { return nil, err } @@ -13324,8 +13310,7 @@ func (c *OrganizationsUpdateCall) Header() http.Header { func (c *OrganizationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1organization) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1organization) if err != nil { return nil, err } @@ -13439,8 +13424,7 @@ func (c *OrganizationsUpdateControlPlaneAccessCall) Header() http.Header { func (c *OrganizationsUpdateControlPlaneAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1controlplaneaccess) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1controlplaneaccess) if err != nil { return nil, err } @@ -13550,8 +13534,7 @@ func (c *OrganizationsUpdateSecuritySettingsCall) Header() http.Header { func (c *OrganizationsUpdateSecuritySettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securitysettings) if err != nil { return nil, err } @@ -13653,8 +13636,7 @@ func (c *OrganizationsAnalyticsDatastoresCreateCall) Header() http.Header { func (c *OrganizationsAnalyticsDatastoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1datastore) if err != nil { return nil, err } @@ -13754,12 +13736,11 @@ func (c *OrganizationsAnalyticsDatastoresDeleteCall) Header() http.Header { func (c *OrganizationsAnalyticsDatastoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13863,12 +13844,11 @@ func (c *OrganizationsAnalyticsDatastoresGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13979,12 +13959,11 @@ func (c *OrganizationsAnalyticsDatastoresListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/analytics/datastores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14080,8 +14059,7 @@ func (c *OrganizationsAnalyticsDatastoresTestCall) Header() http.Header { func (c *OrganizationsAnalyticsDatastoresTestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1datastore) if err != nil { return nil, err } @@ -14183,8 +14161,7 @@ func (c *OrganizationsAnalyticsDatastoresUpdateCall) Header() http.Header { func (c *OrganizationsAnalyticsDatastoresUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1datastore) if err != nil { return nil, err } @@ -14295,8 +14272,7 @@ func (c *OrganizationsApiproductsAttributesCall) Header() http.Header { func (c *OrganizationsApiproductsAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1attributes) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1attributes) if err != nil { return nil, err } @@ -14414,8 +14390,7 @@ func (c *OrganizationsApiproductsCreateCall) Header() http.Header { func (c *OrganizationsApiproductsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apiproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apiproduct) if err != nil { return nil, err } @@ -14522,12 +14497,11 @@ func (c *OrganizationsApiproductsDeleteCall) Header() http.Header { func (c *OrganizationsApiproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14635,12 +14609,11 @@ func (c *OrganizationsApiproductsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14785,12 +14758,11 @@ func (c *OrganizationsApiproductsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apiproducts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14889,8 +14861,7 @@ func (c *OrganizationsApiproductsUpdateCall) Header() http.Header { func (c *OrganizationsApiproductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apiproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apiproduct) if err != nil { return nil, err } @@ -14991,12 +14962,11 @@ func (c *OrganizationsApiproductsAttributesDeleteCall) Header() http.Header { func (c *OrganizationsApiproductsAttributesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15101,12 +15071,11 @@ func (c *OrganizationsApiproductsAttributesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15210,12 +15179,11 @@ func (c *OrganizationsApiproductsAttributesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15315,8 +15283,7 @@ func (c *OrganizationsApiproductsAttributesUpdateApiProductAttributeCall) Header func (c *OrganizationsApiproductsAttributesUpdateApiProductAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1attribute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1attribute) if err != nil { return nil, err } @@ -15427,8 +15394,7 @@ func (c *OrganizationsApiproductsRateplansCreateCall) Header() http.Header { func (c *OrganizationsApiproductsRateplansCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1rateplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1rateplan) if err != nil { return nil, err } @@ -15528,12 +15494,11 @@ func (c *OrganizationsApiproductsRateplansDeleteCall) Header() http.Header { func (c *OrganizationsApiproductsRateplansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15637,12 +15602,11 @@ func (c *OrganizationsApiproductsRateplansGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15799,12 +15763,11 @@ func (c *OrganizationsApiproductsRateplansListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rateplans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15898,8 +15861,7 @@ func (c *OrganizationsApiproductsRateplansUpdateCall) Header() http.Header { func (c *OrganizationsApiproductsRateplansUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1rateplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1rateplan) if err != nil { return nil, err } @@ -16040,8 +16002,7 @@ func (c *OrganizationsApisCreateCall) Header() http.Header { func (c *OrganizationsApisCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -16143,12 +16104,11 @@ func (c *OrganizationsApisDeleteCall) Header() http.Header { func (c *OrganizationsApisDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16252,12 +16212,11 @@ func (c *OrganizationsApisGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16377,12 +16336,11 @@ func (c *OrganizationsApisListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16483,8 +16441,7 @@ func (c *OrganizationsApisPatchCall) Header() http.Header { func (c *OrganizationsApisPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apiproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apiproxy) if err != nil { return nil, err } @@ -16596,12 +16553,11 @@ func (c *OrganizationsApisDeploymentsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16695,8 +16651,7 @@ func (c *OrganizationsApisKeyvaluemapsCreateCall) Header() http.Header { func (c *OrganizationsApisKeyvaluemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvaluemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvaluemap) if err != nil { return nil, err } @@ -16796,12 +16751,11 @@ func (c *OrganizationsApisKeyvaluemapsDeleteCall) Header() http.Header { func (c *OrganizationsApisKeyvaluemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16900,8 +16854,7 @@ func (c *OrganizationsApisKeyvaluemapsEntriesCreateCall) Header() http.Header { func (c *OrganizationsApisKeyvaluemapsEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvalueentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvalueentry) if err != nil { return nil, err } @@ -17010,12 +16963,11 @@ func (c *OrganizationsApisKeyvaluemapsEntriesDeleteCall) Header() http.Header { func (c *OrganizationsApisKeyvaluemapsEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17126,12 +17078,11 @@ func (c *OrganizationsApisKeyvaluemapsEntriesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17255,12 +17206,11 @@ func (c *OrganizationsApisKeyvaluemapsEntriesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17379,8 +17329,7 @@ func (c *OrganizationsApisKeyvaluemapsEntriesUpdateCall) Header() http.Header { func (c *OrganizationsApisKeyvaluemapsEntriesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvalueentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvalueentry) if err != nil { return nil, err } @@ -17482,12 +17431,11 @@ func (c *OrganizationsApisRevisionsDeleteCall) Header() http.Header { func (c *OrganizationsApisRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17605,12 +17553,11 @@ func (c *OrganizationsApisRevisionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17717,8 +17664,7 @@ func (c *OrganizationsApisRevisionsUpdateApiProxyRevisionCall) Header() http.Hea func (c *OrganizationsApisRevisionsUpdateApiProxyRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -17831,12 +17777,11 @@ func (c *OrganizationsApisRevisionsDeploymentsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17932,8 +17877,7 @@ func (c *OrganizationsAppgroupsCreateCall) Header() http.Header { func (c *OrganizationsAppgroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1appgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1appgroup) if err != nil { return nil, err } @@ -18038,12 +17982,11 @@ func (c *OrganizationsAppgroupsDeleteCall) Header() http.Header { func (c *OrganizationsAppgroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18148,12 +18091,11 @@ func (c *OrganizationsAppgroupsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18284,12 +18226,11 @@ func (c *OrganizationsAppgroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/appgroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18415,8 +18356,7 @@ func (c *OrganizationsAppgroupsUpdateCall) Header() http.Header { func (c *OrganizationsAppgroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1appgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1appgroup) if err != nil { return nil, err } @@ -18522,8 +18462,7 @@ func (c *OrganizationsAppgroupsAppsCreateCall) Header() http.Header { func (c *OrganizationsAppgroupsAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1appgroupapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1appgroupapp) if err != nil { return nil, err } @@ -18626,12 +18565,11 @@ func (c *OrganizationsAppgroupsAppsDeleteCall) Header() http.Header { func (c *OrganizationsAppgroupsAppsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18735,12 +18673,11 @@ func (c *OrganizationsAppgroupsAppsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18863,12 +18800,11 @@ func (c *OrganizationsAppgroupsAppsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18999,8 +18935,7 @@ func (c *OrganizationsAppgroupsAppsUpdateCall) Header() http.Header { func (c *OrganizationsAppgroupsAppsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1appgroupapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1appgroupapp) if err != nil { return nil, err } @@ -19113,8 +19048,7 @@ func (c *OrganizationsAppgroupsAppsKeysCreateCall) Header() http.Header { func (c *OrganizationsAppgroupsAppsKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1appgroupappkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1appgroupappkey) if err != nil { return nil, err } @@ -19217,12 +19151,11 @@ func (c *OrganizationsAppgroupsAppsKeysDeleteCall) Header() http.Header { func (c *OrganizationsAppgroupsAppsKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19328,12 +19261,11 @@ func (c *OrganizationsAppgroupsAppsKeysGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19434,8 +19366,7 @@ func (c *OrganizationsAppgroupsAppsKeysUpdateAppGroupAppKeyCall) Header() http.H func (c *OrganizationsAppgroupsAppsKeysUpdateAppGroupAppKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1updateappgroupappkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1updateappgroupappkeyrequest) if err != nil { return nil, err } @@ -19540,12 +19471,11 @@ func (c *OrganizationsAppgroupsAppsKeysApiproductsDeleteCall) Header() http.Head func (c *OrganizationsAppgroupsAppsKeysApiproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19653,12 +19583,11 @@ func (c *OrganizationsAppgroupsAppsKeysApiproductsUpdateAppGroupAppKeyApiProduct func (c *OrganizationsAppgroupsAppsKeysApiproductsUpdateAppGroupAppKeyApiProductCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19761,12 +19690,11 @@ func (c *OrganizationsAppsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19961,12 +19889,11 @@ func (c *OrganizationsAppsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20090,8 +20017,7 @@ func (c *OrganizationsDatacollectorsCreateCall) Header() http.Header { func (c *OrganizationsDatacollectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1datacollector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1datacollector) if err != nil { return nil, err } @@ -20191,12 +20117,11 @@ func (c *OrganizationsDatacollectorsDeleteCall) Header() http.Header { func (c *OrganizationsDatacollectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20300,12 +20225,11 @@ func (c *OrganizationsDatacollectorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20424,12 +20348,11 @@ func (c *OrganizationsDatacollectorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/datacollectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20551,8 +20474,7 @@ func (c *OrganizationsDatacollectorsPatchCall) Header() http.Header { func (c *OrganizationsDatacollectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1datacollector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1datacollector) if err != nil { return nil, err } @@ -20673,12 +20595,11 @@ func (c *OrganizationsDeploymentsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20782,8 +20703,7 @@ func (c *OrganizationsDevelopersAttributesCall) Header() http.Header { func (c *OrganizationsDevelopersAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1attributes) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1attributes) if err != nil { return nil, err } @@ -20887,8 +20807,7 @@ func (c *OrganizationsDevelopersCreateCall) Header() http.Header { func (c *OrganizationsDevelopersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developer) if err != nil { return nil, err } @@ -20995,12 +20914,11 @@ func (c *OrganizationsDevelopersDeleteCall) Header() http.Header { func (c *OrganizationsDevelopersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21113,12 +21031,11 @@ func (c *OrganizationsDevelopersGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21222,12 +21139,11 @@ func (c *OrganizationsDevelopersGetBalanceCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21333,12 +21249,11 @@ func (c *OrganizationsDevelopersGetMonetizationConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21495,12 +21410,11 @@ func (c *OrganizationsDevelopersListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/developers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21607,12 +21521,11 @@ func (c *OrganizationsDevelopersSetDeveloperStatusCall) Header() http.Header { func (c *OrganizationsDevelopersSetDeveloperStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -21714,8 +21627,7 @@ func (c *OrganizationsDevelopersUpdateCall) Header() http.Header { func (c *OrganizationsDevelopersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developer) if err != nil { return nil, err } @@ -21819,8 +21731,7 @@ func (c *OrganizationsDevelopersUpdateMonetizationConfigCall) Header() http.Head func (c *OrganizationsDevelopersUpdateMonetizationConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developermonetizationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developermonetizationconfig) if err != nil { return nil, err } @@ -21923,8 +21834,7 @@ func (c *OrganizationsDevelopersAppsAttributesCall) Header() http.Header { func (c *OrganizationsDevelopersAppsAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1attributes) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1attributes) if err != nil { return nil, err } @@ -22031,8 +21941,7 @@ func (c *OrganizationsDevelopersAppsCreateCall) Header() http.Header { func (c *OrganizationsDevelopersAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerapp) if err != nil { return nil, err } @@ -22135,12 +22044,11 @@ func (c *OrganizationsDevelopersAppsDeleteCall) Header() http.Header { func (c *OrganizationsDevelopersAppsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22264,8 +22172,7 @@ func (c *OrganizationsDevelopersAppsGenerateKeyPairOrUpdateDeveloperAppStatusCal func (c *OrganizationsDevelopersAppsGenerateKeyPairOrUpdateDeveloperAppStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerapp) if err != nil { return nil, err } @@ -22395,12 +22302,11 @@ func (c *OrganizationsDevelopersAppsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22543,12 +22449,11 @@ func (c *OrganizationsDevelopersAppsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22651,8 +22556,7 @@ func (c *OrganizationsDevelopersAppsUpdateCall) Header() http.Header { func (c *OrganizationsDevelopersAppsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerapp) if err != nil { return nil, err } @@ -22754,12 +22658,11 @@ func (c *OrganizationsDevelopersAppsAttributesDeleteCall) Header() http.Header { func (c *OrganizationsDevelopersAppsAttributesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22865,12 +22768,11 @@ func (c *OrganizationsDevelopersAppsAttributesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22974,12 +22876,11 @@ func (c *OrganizationsDevelopersAppsAttributesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23081,8 +22982,7 @@ func (c *OrganizationsDevelopersAppsAttributesUpdateDeveloperAppAttributeCall) H func (c *OrganizationsDevelopersAppsAttributesUpdateDeveloperAppAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1attribute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1attribute) if err != nil { return nil, err } @@ -23197,8 +23097,7 @@ func (c *OrganizationsDevelopersAppsKeysCreateCall) Header() http.Header { func (c *OrganizationsDevelopersAppsKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerappkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerappkey) if err != nil { return nil, err } @@ -23305,12 +23204,11 @@ func (c *OrganizationsDevelopersAppsKeysDeleteCall) Header() http.Header { func (c *OrganizationsDevelopersAppsKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23416,12 +23314,11 @@ func (c *OrganizationsDevelopersAppsKeysGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23521,8 +23418,7 @@ func (c *OrganizationsDevelopersAppsKeysReplaceDeveloperAppKeyCall) Header() htt func (c *OrganizationsDevelopersAppsKeysReplaceDeveloperAppKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerappkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerappkey) if err != nil { return nil, err } @@ -23639,8 +23535,7 @@ func (c *OrganizationsDevelopersAppsKeysUpdateDeveloperAppKeyCall) Header() http func (c *OrganizationsDevelopersAppsKeysUpdateDeveloperAppKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerappkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerappkey) if err != nil { return nil, err } @@ -23745,12 +23640,11 @@ func (c *OrganizationsDevelopersAppsKeysApiproductsDeleteCall) Header() http.Hea func (c *OrganizationsDevelopersAppsKeysApiproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23856,12 +23750,11 @@ func (c *OrganizationsDevelopersAppsKeysApiproductsUpdateDeveloperAppKeyApiProdu func (c *OrganizationsDevelopersAppsKeysApiproductsUpdateDeveloperAppKeyApiProductCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -23968,8 +23861,7 @@ func (c *OrganizationsDevelopersAppsKeysCreateCreateCall) Header() http.Header { func (c *OrganizationsDevelopersAppsKeysCreateCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developerappkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developerappkey) if err != nil { return nil, err } @@ -24070,12 +23962,11 @@ func (c *OrganizationsDevelopersAttributesDeleteCall) Header() http.Header { func (c *OrganizationsDevelopersAttributesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24180,12 +24071,11 @@ func (c *OrganizationsDevelopersAttributesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24290,12 +24180,11 @@ func (c *OrganizationsDevelopersAttributesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24396,8 +24285,7 @@ func (c *OrganizationsDevelopersAttributesUpdateDeveloperAttributeCall) Header() func (c *OrganizationsDevelopersAttributesUpdateDeveloperAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1attribute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1attribute) if err != nil { return nil, err } @@ -24500,8 +24388,7 @@ func (c *OrganizationsDevelopersBalanceAdjustCall) Header() http.Header { func (c *OrganizationsDevelopersBalanceAdjustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1adjustdeveloperbalancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1adjustdeveloperbalancerequest) if err != nil { return nil, err } @@ -24603,8 +24490,7 @@ func (c *OrganizationsDevelopersBalanceCreditCall) Header() http.Header { func (c *OrganizationsDevelopersBalanceCreditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1creditdeveloperbalancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1creditdeveloperbalancerequest) if err != nil { return nil, err } @@ -24707,8 +24593,7 @@ func (c *OrganizationsDevelopersSubscriptionsCreateCall) Header() http.Header { func (c *OrganizationsDevelopersSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1developersubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1developersubscription) if err != nil { return nil, err } @@ -24812,8 +24697,7 @@ func (c *OrganizationsDevelopersSubscriptionsExpireCall) Header() http.Header { func (c *OrganizationsDevelopersSubscriptionsExpireCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1expiredevelopersubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1expiredevelopersubscriptionrequest) if err != nil { return nil, err } @@ -24927,12 +24811,11 @@ func (c *OrganizationsDevelopersSubscriptionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25054,12 +24937,11 @@ func (c *OrganizationsDevelopersSubscriptionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25162,8 +25044,7 @@ func (c *OrganizationsEndpointAttachmentsCreateCall) Header() http.Header { func (c *OrganizationsEndpointAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1endpointattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1endpointattachment) if err != nil { return nil, err } @@ -25263,12 +25144,11 @@ func (c *OrganizationsEndpointAttachmentsDeleteCall) Header() http.Header { func (c *OrganizationsEndpointAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25372,12 +25252,11 @@ func (c *OrganizationsEndpointAttachmentsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25497,12 +25376,11 @@ func (c *OrganizationsEndpointAttachmentsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpointAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25624,8 +25502,7 @@ func (c *OrganizationsEnvgroupsCreateCall) Header() http.Header { func (c *OrganizationsEnvgroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environmentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environmentgroup) if err != nil { return nil, err } @@ -25725,12 +25602,11 @@ func (c *OrganizationsEnvgroupsDeleteCall) Header() http.Header { func (c *OrganizationsEnvgroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25834,12 +25710,11 @@ func (c *OrganizationsEnvgroupsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25969,12 +25844,11 @@ func (c *OrganizationsEnvgroupsGetDeployedIngressConfigCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26093,12 +25967,11 @@ func (c *OrganizationsEnvgroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/envgroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26220,8 +26093,7 @@ func (c *OrganizationsEnvgroupsPatchCall) Header() http.Header { func (c *OrganizationsEnvgroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environmentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environmentgroup) if err != nil { return nil, err } @@ -26323,8 +26195,7 @@ func (c *OrganizationsEnvgroupsAttachmentsCreateCall) Header() http.Header { func (c *OrganizationsEnvgroupsAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environmentgroupattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environmentgroupattachment) if err != nil { return nil, err } @@ -26425,12 +26296,11 @@ func (c *OrganizationsEnvgroupsAttachmentsDeleteCall) Header() http.Header { func (c *OrganizationsEnvgroupsAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26534,12 +26404,11 @@ func (c *OrganizationsEnvgroupsAttachmentsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26658,12 +26527,11 @@ func (c *OrganizationsEnvgroupsAttachmentsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26784,8 +26652,7 @@ func (c *OrganizationsEnvironmentsCreateCall) Header() http.Header { func (c *OrganizationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environment) if err != nil { return nil, err } @@ -26888,12 +26755,11 @@ func (c *OrganizationsEnvironmentsDeleteCall) Header() http.Header { func (c *OrganizationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26997,12 +26863,11 @@ func (c *OrganizationsEnvironmentsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27106,12 +26971,11 @@ func (c *OrganizationsEnvironmentsGetAddonsConfigCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27218,12 +27082,11 @@ func (c *OrganizationsEnvironmentsGetApiSecurityRuntimeConfigCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27327,12 +27190,11 @@ func (c *OrganizationsEnvironmentsGetDebugmaskCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27437,12 +27299,11 @@ func (c *OrganizationsEnvironmentsGetDeployedConfigCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27568,12 +27429,11 @@ func (c *OrganizationsEnvironmentsGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27678,12 +27538,11 @@ func (c *OrganizationsEnvironmentsGetSecurityActionsConfigCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27787,12 +27646,11 @@ func (c *OrganizationsEnvironmentsGetTraceConfigCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27894,8 +27752,7 @@ func (c *OrganizationsEnvironmentsModifyEnvironmentCall) Header() http.Header { func (c *OrganizationsEnvironmentsModifyEnvironmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environment) if err != nil { return nil, err } @@ -28003,8 +27860,7 @@ func (c *OrganizationsEnvironmentsSetIamPolicyCall) Header() http.Header { func (c *OrganizationsEnvironmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -28106,12 +27962,11 @@ func (c *OrganizationsEnvironmentsSubscribeCall) Header() http.Header { func (c *OrganizationsEnvironmentsSubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:subscribe") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -28210,8 +28065,7 @@ func (c *OrganizationsEnvironmentsTestIamPermissionsCall) Header() http.Header { func (c *OrganizationsEnvironmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -28313,8 +28167,7 @@ func (c *OrganizationsEnvironmentsUnsubscribeCall) Header() http.Header { func (c *OrganizationsEnvironmentsUnsubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1subscription) if err != nil { return nil, err } @@ -28421,8 +28274,7 @@ func (c *OrganizationsEnvironmentsUpdateCall) Header() http.Header { func (c *OrganizationsEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environment) if err != nil { return nil, err } @@ -28540,8 +28392,7 @@ func (c *OrganizationsEnvironmentsUpdateDebugmaskCall) Header() http.Header { func (c *OrganizationsEnvironmentsUpdateDebugmaskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1debugmask) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1debugmask) if err != nil { return nil, err } @@ -28648,8 +28499,7 @@ func (c *OrganizationsEnvironmentsUpdateEnvironmentCall) Header() http.Header { func (c *OrganizationsEnvironmentsUpdateEnvironmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1environment) if err != nil { return nil, err } @@ -28761,8 +28611,7 @@ func (c *OrganizationsEnvironmentsUpdateSecurityActionsConfigCall) Header() http func (c *OrganizationsEnvironmentsUpdateSecurityActionsConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityactionsconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityactionsconfig) if err != nil { return nil, err } @@ -28874,8 +28723,7 @@ func (c *OrganizationsEnvironmentsUpdateTraceConfigCall) Header() http.Header { func (c *OrganizationsEnvironmentsUpdateTraceConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1traceconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1traceconfig) if err != nil { return nil, err } @@ -28977,8 +28825,7 @@ func (c *OrganizationsEnvironmentsAddonsConfigSetAddonEnablementCall) Header() h func (c *OrganizationsEnvironmentsAddonsConfigSetAddonEnablementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1setaddonenablementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1setaddonenablementrequest) if err != nil { return nil, err } @@ -29108,12 +28955,11 @@ func (c *OrganizationsEnvironmentsAnalyticsAdminGetSchemav2Call) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29210,8 +29056,7 @@ func (c *OrganizationsEnvironmentsAnalyticsExportsCreateCall) Header() http.Head func (c *OrganizationsEnvironmentsAnalyticsExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1exportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1exportrequest) if err != nil { return nil, err } @@ -29325,12 +29170,11 @@ func (c *OrganizationsEnvironmentsAnalyticsExportsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29435,12 +29279,11 @@ func (c *OrganizationsEnvironmentsAnalyticsExportsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/analytics/exports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29544,12 +29387,11 @@ func (c *OrganizationsEnvironmentsApisDeploymentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29687,12 +29529,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDeployCall) Header() http.Header func (c *OrganizationsEnvironmentsApisRevisionsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -29798,12 +29639,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsGetDeploymentsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29916,12 +29756,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsUndeployCall) Header() http.Heade func (c *OrganizationsEnvironmentsApisRevisionsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30025,8 +29864,7 @@ func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsCreateCall) Header() func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1debugsession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1debugsession) if err != nil { return nil, err } @@ -30129,12 +29967,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsDeleteDataCall) Head func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsDeleteDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/data") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30239,12 +30076,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30366,12 +30202,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/debugsessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30497,12 +30332,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDebugsessionsDataGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30613,12 +30447,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDeploymentsGenerateDeployChangeRe func (c *OrganizationsEnvironmentsApisRevisionsDeploymentsGenerateDeployChangeReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments:generateDeployChangeReport") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30721,12 +30554,11 @@ func (c *OrganizationsEnvironmentsApisRevisionsDeploymentsGenerateUndeployChange func (c *OrganizationsEnvironmentsApisRevisionsDeploymentsGenerateUndeployChangeReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments:generateUndeployChangeReport") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30819,8 +30651,7 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsCreateCall) Header() http.He func (c *OrganizationsEnvironmentsArchiveDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1archivedeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1archivedeployment) if err != nil { return nil, err } @@ -30920,12 +30751,11 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsDeleteCall) Header() http.He func (c *OrganizationsEnvironmentsArchiveDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31021,8 +30851,7 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsGenerateDownloadUrlCall) Hea func (c *OrganizationsEnvironmentsArchiveDeploymentsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1generatedownloadurlrequest) if err != nil { return nil, err } @@ -31134,8 +30963,7 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsGenerateUploadUrlCall) Heade func (c *OrganizationsEnvironmentsArchiveDeploymentsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1generateuploadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1generateuploadurlrequest) if err != nil { return nil, err } @@ -31247,12 +31075,11 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31380,12 +31207,11 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/archiveDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31508,8 +31334,7 @@ func (c *OrganizationsEnvironmentsArchiveDeploymentsPatchCall) Header() http.Hea func (c *OrganizationsEnvironmentsArchiveDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1archivedeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1archivedeployment) if err != nil { return nil, err } @@ -31610,12 +31435,11 @@ func (c *OrganizationsEnvironmentsCachesDeleteCall) Header() http.Header { func (c *OrganizationsEnvironmentsCachesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31721,12 +31545,11 @@ func (c *OrganizationsEnvironmentsDeploymentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31852,12 +31675,11 @@ func (c *OrganizationsEnvironmentsDeploymentsGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31971,12 +31793,11 @@ func (c *OrganizationsEnvironmentsDeploymentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32076,8 +31897,7 @@ func (c *OrganizationsEnvironmentsDeploymentsSetIamPolicyCall) Header() http.Hea func (c *OrganizationsEnvironmentsDeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -32184,8 +32004,7 @@ func (c *OrganizationsEnvironmentsDeploymentsTestIamPermissionsCall) Header() ht func (c *OrganizationsEnvironmentsDeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -32288,8 +32107,7 @@ func (c *OrganizationsEnvironmentsFlowhooksAttachSharedFlowToFlowHookCall) Heade func (c *OrganizationsEnvironmentsFlowhooksAttachSharedFlowToFlowHookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1flowhook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1flowhook) if err != nil { return nil, err } @@ -32389,12 +32207,11 @@ func (c *OrganizationsEnvironmentsFlowhooksDetachSharedFlowFromFlowHookCall) Hea func (c *OrganizationsEnvironmentsFlowhooksDetachSharedFlowFromFlowHookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32500,12 +32317,11 @@ func (c *OrganizationsEnvironmentsFlowhooksGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32610,8 +32426,7 @@ func (c *OrganizationsEnvironmentsKeystoresCreateCall) Header() http.Header { func (c *OrganizationsEnvironmentsKeystoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keystore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keystore) if err != nil { return nil, err } @@ -32711,12 +32526,11 @@ func (c *OrganizationsEnvironmentsKeystoresDeleteCall) Header() http.Header { func (c *OrganizationsEnvironmentsKeystoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32820,12 +32634,11 @@ func (c *OrganizationsEnvironmentsKeystoresGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32973,8 +32786,7 @@ func (c *OrganizationsEnvironmentsKeystoresAliasesCreateCall) Header() http.Head func (c *OrganizationsEnvironmentsKeystoresAliasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -33088,12 +32900,11 @@ func (c *OrganizationsEnvironmentsKeystoresAliasesCsrCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/csr") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33186,12 +32997,11 @@ func (c *OrganizationsEnvironmentsKeystoresAliasesDeleteCall) Header() http.Head func (c *OrganizationsEnvironmentsKeystoresAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33296,12 +33106,11 @@ func (c *OrganizationsEnvironmentsKeystoresAliasesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33406,12 +33215,11 @@ func (c *OrganizationsEnvironmentsKeystoresAliasesGetCertificateCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/certificate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33524,8 +33332,7 @@ func (c *OrganizationsEnvironmentsKeystoresAliasesUpdateCall) Header() http.Head func (c *OrganizationsEnvironmentsKeystoresAliasesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -33628,8 +33435,7 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsCreateCall) Header() http.Header { func (c *OrganizationsEnvironmentsKeyvaluemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvaluemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvaluemap) if err != nil { return nil, err } @@ -33730,12 +33536,11 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsDeleteCall) Header() http.Header { func (c *OrganizationsEnvironmentsKeyvaluemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33834,8 +33639,7 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesCreateCall) Header() http.H func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvalueentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvalueentry) if err != nil { return nil, err } @@ -33944,12 +33748,11 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesDeleteCall) Header() http.H func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34060,12 +33863,11 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34189,12 +33991,11 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34313,8 +34114,7 @@ func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesUpdateCall) Header() http.H func (c *OrganizationsEnvironmentsKeyvaluemapsEntriesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvalueentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvalueentry) if err != nil { return nil, err } @@ -34543,12 +34343,11 @@ func (c *OrganizationsEnvironmentsOptimizedStatsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34645,8 +34444,7 @@ func (c *OrganizationsEnvironmentsQueriesCreateCall) Header() http.Header { func (c *OrganizationsEnvironmentsQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1query) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1query) if err != nil { return nil, err } @@ -34760,12 +34558,11 @@ func (c *OrganizationsEnvironmentsQueriesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34873,12 +34670,11 @@ func (c *OrganizationsEnvironmentsQueriesGetResultCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34984,12 +34780,11 @@ func (c *OrganizationsEnvironmentsQueriesGetResulturlCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35138,12 +34933,11 @@ func (c *OrganizationsEnvironmentsQueriesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/queries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35237,8 +35031,7 @@ func (c *OrganizationsEnvironmentsReferencesCreateCall) Header() http.Header { func (c *OrganizationsEnvironmentsReferencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1reference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1reference) if err != nil { return nil, err } @@ -35339,12 +35132,11 @@ func (c *OrganizationsEnvironmentsReferencesDeleteCall) Header() http.Header { func (c *OrganizationsEnvironmentsReferencesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35448,12 +35240,11 @@ func (c *OrganizationsEnvironmentsReferencesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35549,8 +35340,7 @@ func (c *OrganizationsEnvironmentsReferencesUpdateCall) Header() http.Header { func (c *OrganizationsEnvironmentsReferencesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1reference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1reference) if err != nil { return nil, err } @@ -35670,8 +35460,7 @@ func (c *OrganizationsEnvironmentsResourcefilesCreateCall) Header() http.Header func (c *OrganizationsEnvironmentsResourcefilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -35780,12 +35569,11 @@ func (c *OrganizationsEnvironmentsResourcefilesDeleteCall) Header() http.Header func (c *OrganizationsEnvironmentsResourcefilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourcefiles/{type}/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35900,12 +35688,11 @@ func (c *OrganizationsEnvironmentsResourcefilesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourcefiles/{type}/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36020,12 +35807,11 @@ func (c *OrganizationsEnvironmentsResourcefilesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourcefiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36134,12 +35920,11 @@ func (c *OrganizationsEnvironmentsResourcefilesListEnvironmentResourcesCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourcefiles/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36244,8 +36029,7 @@ func (c *OrganizationsEnvironmentsResourcefilesUpdateCall) Header() http.Header func (c *OrganizationsEnvironmentsResourcefilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -36358,8 +36142,7 @@ func (c *OrganizationsEnvironmentsSecurityActionsCreateCall) Header() http.Heade func (c *OrganizationsEnvironmentsSecurityActionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityaction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityaction) if err != nil { return nil, err } @@ -36464,8 +36247,7 @@ func (c *OrganizationsEnvironmentsSecurityActionsDisableCall) Header() http.Head func (c *OrganizationsEnvironmentsSecurityActionsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1disablesecurityactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1disablesecurityactionrequest) if err != nil { return nil, err } @@ -36570,8 +36352,7 @@ func (c *OrganizationsEnvironmentsSecurityActionsEnableCall) Header() http.Heade func (c *OrganizationsEnvironmentsSecurityActionsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1enablesecurityactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1enablesecurityactionrequest) if err != nil { return nil, err } @@ -36683,12 +36464,11 @@ func (c *OrganizationsEnvironmentsSecurityActionsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36820,12 +36600,11 @@ func (c *OrganizationsEnvironmentsSecurityActionsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityActions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36943,8 +36722,7 @@ func (c *OrganizationsEnvironmentsSecurityIncidentsBatchUpdateCall) Header() htt func (c *OrganizationsEnvironmentsSecurityIncidentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1batchupdatesecurityincidentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1batchupdatesecurityincidentsrequest) if err != nil { return nil, err } @@ -37061,12 +36839,11 @@ func (c *OrganizationsEnvironmentsSecurityIncidentsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37196,12 +36973,11 @@ func (c *OrganizationsEnvironmentsSecurityIncidentsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityIncidents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37328,8 +37104,7 @@ func (c *OrganizationsEnvironmentsSecurityIncidentsPatchCall) Header() http.Head func (c *OrganizationsEnvironmentsSecurityIncidentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityincident) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityincident) if err != nil { return nil, err } @@ -37434,8 +37209,7 @@ func (c *OrganizationsEnvironmentsSecurityReportsCreateCall) Header() http.Heade func (c *OrganizationsEnvironmentsSecurityReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityreportquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityreportquery) if err != nil { return nil, err } @@ -37549,12 +37323,11 @@ func (c *OrganizationsEnvironmentsSecurityReportsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37662,12 +37435,11 @@ func (c *OrganizationsEnvironmentsSecurityReportsGetResultCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37773,12 +37545,11 @@ func (c *OrganizationsEnvironmentsSecurityReportsGetResultViewCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37933,12 +37704,11 @@ func (c *OrganizationsEnvironmentsSecurityReportsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38052,8 +37822,7 @@ func (c *OrganizationsEnvironmentsSecurityStatsQueryTabularStatsCall) Header() h func (c *OrganizationsEnvironmentsSecurityStatsQueryTabularStatsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1querytabularstatsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1querytabularstatsrequest) if err != nil { return nil, err } @@ -38176,8 +37945,7 @@ func (c *OrganizationsEnvironmentsSecurityStatsQueryTimeSeriesStatsCall) Header( func (c *OrganizationsEnvironmentsSecurityStatsQueryTimeSeriesStatsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1querytimeseriesstatsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1querytimeseriesstatsrequest) if err != nil { return nil, err } @@ -38310,12 +38078,11 @@ func (c *OrganizationsEnvironmentsSharedflowsDeploymentsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38435,12 +38202,11 @@ func (c *OrganizationsEnvironmentsSharedflowsRevisionsDeployCall) Header() http. func (c *OrganizationsEnvironmentsSharedflowsRevisionsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38547,12 +38313,11 @@ func (c *OrganizationsEnvironmentsSharedflowsRevisionsGetDeploymentsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38652,12 +38417,11 @@ func (c *OrganizationsEnvironmentsSharedflowsRevisionsUndeployCall) Header() htt func (c *OrganizationsEnvironmentsSharedflowsRevisionsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38882,12 +38646,11 @@ func (c *OrganizationsEnvironmentsStatsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38988,8 +38751,7 @@ func (c *OrganizationsEnvironmentsTargetserversCreateCall) Header() http.Header func (c *OrganizationsEnvironmentsTargetserversCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1targetserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1targetserver) if err != nil { return nil, err } @@ -39090,12 +38852,11 @@ func (c *OrganizationsEnvironmentsTargetserversDeleteCall) Header() http.Header func (c *OrganizationsEnvironmentsTargetserversDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39199,12 +38960,11 @@ func (c *OrganizationsEnvironmentsTargetserversGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39300,8 +39060,7 @@ func (c *OrganizationsEnvironmentsTargetserversUpdateCall) Header() http.Header func (c *OrganizationsEnvironmentsTargetserversUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1targetserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1targetserver) if err != nil { return nil, err } @@ -39407,8 +39166,7 @@ func (c *OrganizationsEnvironmentsTraceConfigOverridesCreateCall) Header() http. func (c *OrganizationsEnvironmentsTraceConfigOverridesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1traceconfigoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1traceconfigoverride) if err != nil { return nil, err } @@ -39509,12 +39267,11 @@ func (c *OrganizationsEnvironmentsTraceConfigOverridesDeleteCall) Header() http. func (c *OrganizationsEnvironmentsTraceConfigOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39619,12 +39376,11 @@ func (c *OrganizationsEnvironmentsTraceConfigOverridesGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39748,12 +39504,11 @@ func (c *OrganizationsEnvironmentsTraceConfigOverridesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/overrides") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39879,8 +39634,7 @@ func (c *OrganizationsEnvironmentsTraceConfigOverridesPatchCall) Header() http.H func (c *OrganizationsEnvironmentsTraceConfigOverridesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1traceconfigoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1traceconfigoverride) if err != nil { return nil, err } @@ -39985,8 +39739,7 @@ func (c *OrganizationsHostQueriesCreateCall) Header() http.Header { func (c *OrganizationsHostQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1query) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1query) if err != nil { return nil, err } @@ -40100,12 +39853,11 @@ func (c *OrganizationsHostQueriesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40213,12 +39965,11 @@ func (c *OrganizationsHostQueriesGetResultCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40322,12 +40073,11 @@ func (c *OrganizationsHostQueriesGetResultViewCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40483,12 +40233,11 @@ func (c *OrganizationsHostQueriesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/hostQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40585,8 +40334,7 @@ func (c *OrganizationsHostSecurityReportsCreateCall) Header() http.Header { func (c *OrganizationsHostSecurityReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityreportquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityreportquery) if err != nil { return nil, err } @@ -40700,12 +40448,11 @@ func (c *OrganizationsHostSecurityReportsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40813,12 +40560,11 @@ func (c *OrganizationsHostSecurityReportsGetResultCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40923,12 +40669,11 @@ func (c *OrganizationsHostSecurityReportsGetResultViewCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41090,12 +40835,11 @@ func (c *OrganizationsHostSecurityReportsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/hostSecurityReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41331,12 +41075,11 @@ func (c *OrganizationsHostStatsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41432,8 +41175,7 @@ func (c *OrganizationsInstancesCreateCall) Header() http.Header { func (c *OrganizationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1instance) if err != nil { return nil, err } @@ -41535,12 +41277,11 @@ func (c *OrganizationsInstancesDeleteCall) Header() http.Header { func (c *OrganizationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41645,12 +41386,11 @@ func (c *OrganizationsInstancesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41770,12 +41510,11 @@ func (c *OrganizationsInstancesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41899,8 +41638,7 @@ func (c *OrganizationsInstancesPatchCall) Header() http.Header { func (c *OrganizationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1instance) if err != nil { return nil, err } @@ -42003,8 +41741,7 @@ func (c *OrganizationsInstancesReportStatusCall) Header() http.Header { func (c *OrganizationsInstancesReportStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1reportinstancestatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1reportinstancestatusrequest) if err != nil { return nil, err } @@ -42107,8 +41844,7 @@ func (c *OrganizationsInstancesAttachmentsCreateCall) Header() http.Header { func (c *OrganizationsInstancesAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1instanceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1instanceattachment) if err != nil { return nil, err } @@ -42208,12 +41944,11 @@ func (c *OrganizationsInstancesAttachmentsDeleteCall) Header() http.Header { func (c *OrganizationsInstancesAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42317,12 +42052,11 @@ func (c *OrganizationsInstancesAttachmentsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42442,12 +42176,11 @@ func (c *OrganizationsInstancesAttachmentsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42562,8 +42295,7 @@ func (c *OrganizationsInstancesCanaryevaluationsCreateCall) Header() http.Header func (c *OrganizationsInstancesCanaryevaluationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1canaryevaluation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1canaryevaluation) if err != nil { return nil, err } @@ -42675,12 +42407,11 @@ func (c *OrganizationsInstancesCanaryevaluationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42776,8 +42507,7 @@ func (c *OrganizationsInstancesNatAddressesActivateCall) Header() http.Header { func (c *OrganizationsInstancesNatAddressesActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1activatenataddressrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1activatenataddressrequest) if err != nil { return nil, err } @@ -42883,8 +42613,7 @@ func (c *OrganizationsInstancesNatAddressesCreateCall) Header() http.Header { func (c *OrganizationsInstancesNatAddressesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1nataddress) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1nataddress) if err != nil { return nil, err } @@ -42987,12 +42716,11 @@ func (c *OrganizationsInstancesNatAddressesDeleteCall) Header() http.Header { func (c *OrganizationsInstancesNatAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43098,12 +42826,11 @@ func (c *OrganizationsInstancesNatAddressesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43223,12 +42950,11 @@ func (c *OrganizationsInstancesNatAddressesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/natAddresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43343,8 +43069,7 @@ func (c *OrganizationsKeyvaluemapsCreateCall) Header() http.Header { func (c *OrganizationsKeyvaluemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvaluemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvaluemap) if err != nil { return nil, err } @@ -43444,12 +43169,11 @@ func (c *OrganizationsKeyvaluemapsDeleteCall) Header() http.Header { func (c *OrganizationsKeyvaluemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43548,8 +43272,7 @@ func (c *OrganizationsKeyvaluemapsEntriesCreateCall) Header() http.Header { func (c *OrganizationsKeyvaluemapsEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvalueentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvalueentry) if err != nil { return nil, err } @@ -43658,12 +43381,11 @@ func (c *OrganizationsKeyvaluemapsEntriesDeleteCall) Header() http.Header { func (c *OrganizationsKeyvaluemapsEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43774,12 +43496,11 @@ func (c *OrganizationsKeyvaluemapsEntriesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43903,12 +43624,11 @@ func (c *OrganizationsKeyvaluemapsEntriesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44027,8 +43747,7 @@ func (c *OrganizationsKeyvaluemapsEntriesUpdateCall) Header() http.Header { func (c *OrganizationsKeyvaluemapsEntriesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1keyvalueentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1keyvalueentry) if err != nil { return nil, err } @@ -44141,12 +43860,11 @@ func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44270,12 +43988,11 @@ func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44508,12 +44225,11 @@ func (c *OrganizationsOptimizedHostStatsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44613,8 +44329,7 @@ func (c *OrganizationsReportsCreateCall) Header() http.Header { func (c *OrganizationsReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1customreport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1customreport) if err != nil { return nil, err } @@ -44714,12 +44429,11 @@ func (c *OrganizationsReportsDeleteCall) Header() http.Header { func (c *OrganizationsReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44823,12 +44537,11 @@ func (c *OrganizationsReportsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44939,12 +44652,11 @@ func (c *OrganizationsReportsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45038,8 +44750,7 @@ func (c *OrganizationsReportsUpdateCall) Header() http.Header { func (c *OrganizationsReportsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1customreport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1customreport) if err != nil { return nil, err } @@ -45141,8 +44852,7 @@ func (c *OrganizationsSecurityAssessmentResultsBatchComputeCall) Header() http.H func (c *OrganizationsSecurityAssessmentResultsBatchComputeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1batchcomputesecurityassessmentresultsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1batchcomputesecurityassessmentresultsrequest) if err != nil { return nil, err } @@ -45273,8 +44983,7 @@ func (c *OrganizationsSecurityProfilesCreateCall) Header() http.Header { func (c *OrganizationsSecurityProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityprofile) if err != nil { return nil, err } @@ -45374,12 +45083,11 @@ func (c *OrganizationsSecurityProfilesDeleteCall) Header() http.Header { func (c *OrganizationsSecurityProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45487,12 +45195,11 @@ func (c *OrganizationsSecurityProfilesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45613,12 +45320,11 @@ func (c *OrganizationsSecurityProfilesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45760,12 +45466,11 @@ func (c *OrganizationsSecurityProfilesListRevisionsCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45887,8 +45592,7 @@ func (c *OrganizationsSecurityProfilesPatchCall) Header() http.Header { func (c *OrganizationsSecurityProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityprofile) if err != nil { return nil, err } @@ -45992,8 +45696,7 @@ func (c *OrganizationsSecurityProfilesEnvironmentsComputeEnvironmentScoresCall) func (c *OrganizationsSecurityProfilesEnvironmentsComputeEnvironmentScoresCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1computeenvironmentscoresrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1computeenvironmentscoresrequest) if err != nil { return nil, err } @@ -46117,8 +45820,7 @@ func (c *OrganizationsSecurityProfilesEnvironmentsCreateCall) Header() http.Head func (c *OrganizationsSecurityProfilesEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofileenvironmentassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityprofileenvironmentassociation) if err != nil { return nil, err } @@ -46219,12 +45921,11 @@ func (c *OrganizationsSecurityProfilesEnvironmentsDeleteCall) Header() http.Head func (c *OrganizationsSecurityProfilesEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46324,8 +46025,7 @@ func (c *OrganizationsSecurityProfilesV2CreateCall) Header() http.Header { func (c *OrganizationsSecurityProfilesV2CreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofilev2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityprofilev2) if err != nil { return nil, err } @@ -46425,12 +46125,11 @@ func (c *OrganizationsSecurityProfilesV2DeleteCall) Header() http.Header { func (c *OrganizationsSecurityProfilesV2DeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46534,12 +46233,11 @@ func (c *OrganizationsSecurityProfilesV2GetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46658,12 +46356,11 @@ func (c *OrganizationsSecurityProfilesV2ListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityProfilesV2") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46786,8 +46483,7 @@ func (c *OrganizationsSecurityProfilesV2PatchCall) Header() http.Header { func (c *OrganizationsSecurityProfilesV2PatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofilev2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1securityprofilev2) if err != nil { return nil, err } @@ -46907,8 +46603,7 @@ func (c *OrganizationsSharedflowsCreateCall) Header() http.Header { func (c *OrganizationsSharedflowsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -47009,12 +46704,11 @@ func (c *OrganizationsSharedflowsDeleteCall) Header() http.Header { func (c *OrganizationsSharedflowsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47118,12 +46812,11 @@ func (c *OrganizationsSharedflowsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47241,12 +46934,11 @@ func (c *OrganizationsSharedflowsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sharedflows") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47350,12 +47042,11 @@ func (c *OrganizationsSharedflowsDeploymentsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47449,12 +47140,11 @@ func (c *OrganizationsSharedflowsRevisionsDeleteCall) Header() http.Header { func (c *OrganizationsSharedflowsRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47573,12 +47263,11 @@ func (c *OrganizationsSharedflowsRevisionsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47685,8 +47374,7 @@ func (c *OrganizationsSharedflowsRevisionsUpdateSharedFlowRevisionCall) Header() func (c *OrganizationsSharedflowsRevisionsUpdateSharedFlowRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapihttpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapihttpbody) if err != nil { return nil, err } @@ -47799,12 +47487,11 @@ func (c *OrganizationsSharedflowsRevisionsDeploymentsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47898,8 +47585,7 @@ func (c *OrganizationsSitesApicategoriesCreateCall) Header() http.Header { func (c *OrganizationsSitesApicategoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apicategory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apicategory) if err != nil { return nil, err } @@ -47999,12 +47685,11 @@ func (c *OrganizationsSitesApicategoriesDeleteCall) Header() http.Header { func (c *OrganizationsSitesApicategoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48108,12 +47793,11 @@ func (c *OrganizationsSitesApicategoriesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48217,12 +47901,11 @@ func (c *OrganizationsSitesApicategoriesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apicategories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48316,8 +47999,7 @@ func (c *OrganizationsSitesApicategoriesPatchCall) Header() http.Header { func (c *OrganizationsSitesApicategoriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apicategory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apicategory) if err != nil { return nil, err } @@ -48419,8 +48101,7 @@ func (c *OrganizationsSitesApidocsCreateCall) Header() http.Header { func (c *OrganizationsSitesApidocsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apidoc) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apidoc) if err != nil { return nil, err } @@ -48520,12 +48201,11 @@ func (c *OrganizationsSitesApidocsDeleteCall) Header() http.Header { func (c *OrganizationsSitesApidocsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48629,12 +48309,11 @@ func (c *OrganizationsSitesApidocsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48739,12 +48418,11 @@ func (c *OrganizationsSitesApidocsGetDocumentationCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48865,12 +48543,11 @@ func (c *OrganizationsSitesApidocsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apidocs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48985,8 +48662,7 @@ func (c *OrganizationsSitesApidocsUpdateCall) Header() http.Header { func (c *OrganizationsSitesApidocsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apidoc) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apidoc) if err != nil { return nil, err } @@ -49091,8 +48767,7 @@ func (c *OrganizationsSitesApidocsUpdateDocumentationCall) Header() http.Header func (c *OrganizationsSitesApidocsUpdateDocumentationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1apidocdocumentation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1apidocdocumentation) if err != nil { return nil, err } @@ -49196,8 +48871,7 @@ func (c *ProjectsProvisionOrganizationCall) Header() http.Header { func (c *ProjectsProvisionOrganizationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1provisionorganizationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudapigeev1provisionorganizationrequest) if err != nil { return nil, err } diff --git a/apigeeregistry/v1/apigeeregistry-gen.go b/apigeeregistry/v1/apigeeregistry-gen.go index 415185e8ded..7784c1a09cc 100644 --- a/apigeeregistry/v1/apigeeregistry-gen.go +++ b/apigeeregistry/v1/apigeeregistry-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1684,12 +1683,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1815,12 +1813,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1944,8 +1941,7 @@ func (c *ProjectsLocationsApisCreateCall) Header() http.Header { func (c *ProjectsLocationsApisCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.api) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.api) if err != nil { return nil, err } @@ -2052,12 +2048,11 @@ func (c *ProjectsLocationsApisDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2160,12 +2155,11 @@ func (c *ProjectsLocationsApisGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2287,12 +2281,11 @@ func (c *ProjectsLocationsApisGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2429,12 +2422,11 @@ func (c *ProjectsLocationsApisListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2566,8 +2558,7 @@ func (c *ProjectsLocationsApisPatchCall) Header() http.Header { func (c *ProjectsLocationsApisPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.api) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.api) if err != nil { return nil, err } @@ -2671,8 +2662,7 @@ func (c *ProjectsLocationsApisSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2779,8 +2769,7 @@ func (c *ProjectsLocationsApisTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsApisTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2891,8 +2880,7 @@ func (c *ProjectsLocationsApisArtifactsCreateCall) Header() http.Header { func (c *ProjectsLocationsApisArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -2990,12 +2978,11 @@ func (c *ProjectsLocationsApisArtifactsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3097,12 +3084,11 @@ func (c *ProjectsLocationsApisArtifactsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3208,12 +3194,11 @@ func (c *ProjectsLocationsApisArtifactsGetContentsCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3335,12 +3320,11 @@ func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3477,12 +3461,11 @@ func (c *ProjectsLocationsApisArtifactsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3596,8 +3579,7 @@ func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Header() http.Header func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -3701,8 +3683,7 @@ func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3809,8 +3790,7 @@ func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3922,8 +3902,7 @@ func (c *ProjectsLocationsApisDeploymentsCreateCall) Header() http.Header { func (c *ProjectsLocationsApisDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apideployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apideployment) if err != nil { return nil, err } @@ -4031,12 +4010,11 @@ func (c *ProjectsLocationsApisDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4128,12 +4106,11 @@ func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Header() http.Heade func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4236,12 +4213,11 @@ func (c *ProjectsLocationsApisDeploymentsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4363,12 +4339,11 @@ func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4505,12 +4480,11 @@ func (c *ProjectsLocationsApisDeploymentsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4658,12 +4632,11 @@ func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4795,8 +4768,7 @@ func (c *ProjectsLocationsApisDeploymentsPatchCall) Header() http.Header { func (c *ProjectsLocationsApisDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apideployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apideployment) if err != nil { return nil, err } @@ -4897,8 +4869,7 @@ func (c *ProjectsLocationsApisDeploymentsRollbackCall) Header() http.Header { func (c *ProjectsLocationsApisDeploymentsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackapideploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackapideploymentrequest) if err != nil { return nil, err } @@ -5002,8 +4973,7 @@ func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5105,8 +5075,7 @@ func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Header() http.Header { func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagapideploymentrevisionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagapideploymentrevisionrequest) if err != nil { return nil, err } @@ -5213,8 +5182,7 @@ func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Header() http.H func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5325,8 +5293,7 @@ func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Header() http.Head func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -5424,12 +5391,11 @@ func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Header() http.Head func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5531,12 +5497,11 @@ func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5642,12 +5607,11 @@ func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5784,12 +5748,11 @@ func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5903,8 +5866,7 @@ func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Header() func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -6014,8 +5976,7 @@ func (c *ProjectsLocationsApisVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apiversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apiversion) if err != nil { return nil, err } @@ -6122,12 +6083,11 @@ func (c *ProjectsLocationsApisVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6230,12 +6190,11 @@ func (c *ProjectsLocationsApisVersionsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6357,12 +6316,11 @@ func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6499,12 +6457,11 @@ func (c *ProjectsLocationsApisVersionsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6636,8 +6593,7 @@ func (c *ProjectsLocationsApisVersionsPatchCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apiversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apiversion) if err != nil { return nil, err } @@ -6741,8 +6697,7 @@ func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6849,8 +6804,7 @@ func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6961,8 +6915,7 @@ func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Header() http.Header func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -7060,12 +7013,11 @@ func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Header() http.Header func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7167,12 +7119,11 @@ func (c *ProjectsLocationsApisVersionsArtifactsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7278,12 +7229,11 @@ func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7405,12 +7355,11 @@ func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7547,12 +7496,11 @@ func (c *ProjectsLocationsApisVersionsArtifactsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7666,8 +7614,7 @@ func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Header() htt func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -7771,8 +7718,7 @@ func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7879,8 +7825,7 @@ func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Header() func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7991,8 +7936,7 @@ func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsSpecsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apispec) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apispec) if err != nil { return nil, err } @@ -8100,12 +8044,11 @@ func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8198,12 +8141,11 @@ func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Header() http.Hea func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8306,12 +8248,11 @@ func (c *ProjectsLocationsApisVersionsSpecsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8417,12 +8358,11 @@ func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8544,12 +8484,11 @@ func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8686,12 +8625,11 @@ func (c *ProjectsLocationsApisVersionsSpecsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/specs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8839,12 +8777,11 @@ func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8976,8 +8913,7 @@ func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsSpecsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apispec) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apispec) if err != nil { return nil, err } @@ -9078,8 +9014,7 @@ func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Header() http.Header { func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackapispecrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackapispecrequest) if err != nil { return nil, err } @@ -9183,8 +9118,7 @@ func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9285,8 +9219,7 @@ func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Header() http.Header func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagapispecrevisionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagapispecrevisionrequest) if err != nil { return nil, err } @@ -9393,8 +9326,7 @@ func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Header() http func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9505,8 +9437,7 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Header() http.He func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -9604,12 +9535,11 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Header() http.He func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9711,12 +9641,11 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9822,12 +9751,11 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9949,12 +9877,11 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10091,12 +10018,11 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10210,8 +10136,7 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Header( func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -10315,8 +10240,7 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Header() h func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10423,8 +10347,7 @@ func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Head func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10535,8 +10458,7 @@ func (c *ProjectsLocationsArtifactsCreateCall) Header() http.Header { func (c *ProjectsLocationsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -10634,12 +10556,11 @@ func (c *ProjectsLocationsArtifactsDeleteCall) Header() http.Header { func (c *ProjectsLocationsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10741,12 +10662,11 @@ func (c *ProjectsLocationsArtifactsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10852,12 +10772,11 @@ func (c *ProjectsLocationsArtifactsGetContentsCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10979,12 +10898,11 @@ func (c *ProjectsLocationsArtifactsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11121,12 +11039,11 @@ func (c *ProjectsLocationsArtifactsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11240,8 +11157,7 @@ func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Header() http.Header { func (c *ProjectsLocationsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact) if err != nil { return nil, err } @@ -11345,8 +11261,7 @@ func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11453,8 +11368,7 @@ func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11585,12 +11499,11 @@ func (c *ProjectsLocationsDocumentsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11686,8 +11599,7 @@ func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDocumentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11794,8 +11706,7 @@ func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11904,8 +11815,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -12004,12 +11914,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12112,12 +12021,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12239,12 +12147,11 @@ func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12340,8 +12247,7 @@ func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12448,8 +12354,7 @@ func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12558,8 +12463,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12660,12 +12564,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12769,12 +12672,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12897,12 +12799,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13046,12 +12947,11 @@ func (c *ProjectsLocationsRuntimeGetIamPolicyCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13147,8 +13047,7 @@ func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRuntimeSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13255,8 +13154,7 @@ func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/apikeys/v2/apikeys-gen.go b/apikeys/v2/apikeys-gen.go index 948a7cd7b2e..355c9fee7a0 100644 --- a/apikeys/v2/apikeys-gen.go +++ b/apikeys/v2/apikeys-gen.go @@ -125,7 +125,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Keys = NewKeysService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,11 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Keys = NewKeysService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -695,12 +694,11 @@ func (c *KeysLookupKeyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/keys:lookupKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -802,12 +800,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -911,8 +908,7 @@ func (c *ProjectsLocationsKeysCreateCall) Header() http.Header { func (c *ProjectsLocationsKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v2key) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v2key) if err != nil { return nil, err } @@ -1020,12 +1016,11 @@ func (c *ProjectsLocationsKeysDeleteCall) Header() http.Header { func (c *ProjectsLocationsKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1129,12 +1124,11 @@ func (c *ProjectsLocationsKeysGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1237,12 +1231,11 @@ func (c *ProjectsLocationsKeysGetKeyStringCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/keyString") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1368,12 +1361,11 @@ func (c *ProjectsLocationsKeysListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/keys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1505,8 +1497,7 @@ func (c *ProjectsLocationsKeysPatchCall) Header() http.Header { func (c *ProjectsLocationsKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v2key) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v2key) if err != nil { return nil, err } @@ -1608,8 +1599,7 @@ func (c *ProjectsLocationsKeysUndeleteCall) Header() http.Header { func (c *ProjectsLocationsKeysUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v2undeletekeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v2undeletekeyrequest) if err != nil { return nil, err } diff --git a/apim/v1alpha/apim-gen.go b/apim/v1alpha/apim-gen.go index 31bbfc9e4b0..efb7a2ddcf5 100644 --- a/apim/v1alpha/apim-gen.go +++ b/apim/v1alpha/apim-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1191,12 +1190,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1322,12 +1320,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1471,12 +1468,11 @@ func (c *ProjectsLocationsListApiObservationTagsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}:listApiObservationTags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1617,8 +1613,7 @@ func (c *ProjectsLocationsObservationJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsObservationJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.observationjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.observationjob) if err != nil { return nil, err } @@ -1719,12 +1714,11 @@ func (c *ProjectsLocationsObservationJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsObservationJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1817,8 +1811,7 @@ func (c *ProjectsLocationsObservationJobsDisableCall) Header() http.Header { func (c *ProjectsLocationsObservationJobsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableobservationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableobservationjobrequest) if err != nil { return nil, err } @@ -1919,8 +1912,7 @@ func (c *ProjectsLocationsObservationJobsEnableCall) Header() http.Header { func (c *ProjectsLocationsObservationJobsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableobservationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableobservationjobrequest) if err != nil { return nil, err } @@ -2031,12 +2023,11 @@ func (c *ProjectsLocationsObservationJobsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2158,12 +2149,11 @@ func (c *ProjectsLocationsObservationJobsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/observationJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2280,8 +2270,7 @@ func (c *ProjectsLocationsObservationJobsApiObservationsBatchEditTagsCall) Heade func (c *ProjectsLocationsObservationJobsApiObservationsBatchEditTagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchedittagsapiobservationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchedittagsapiobservationsrequest) if err != nil { return nil, err } @@ -2394,12 +2383,11 @@ func (c *ProjectsLocationsObservationJobsApiObservationsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2521,12 +2509,11 @@ func (c *ProjectsLocationsObservationJobsApiObservationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/apiObservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2652,12 +2639,11 @@ func (c *ProjectsLocationsObservationJobsApiObservationsApiOperationsGetCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2780,12 +2766,11 @@ func (c *ProjectsLocationsObservationJobsApiObservationsApiOperationsListCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/apiOperations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2926,8 +2911,7 @@ func (c *ProjectsLocationsObservationSourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsObservationSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.observationsource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.observationsource) if err != nil { return nil, err } @@ -3028,12 +3012,11 @@ func (c *ProjectsLocationsObservationSourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsObservationSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3136,12 +3119,11 @@ func (c *ProjectsLocationsObservationSourcesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3264,12 +3246,11 @@ func (c *ProjectsLocationsObservationSourcesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/observationSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3391,8 +3372,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3493,12 +3473,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3602,12 +3581,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3730,12 +3708,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/appengine/v1/appengine-gen.go b/appengine/v1/appengine-gen.go index f9a3199de57..a4cd5ce3120 100644 --- a/appengine/v1/appengine-gen.go +++ b/appengine/v1/appengine-gen.go @@ -129,7 +129,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -148,10 +150,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Apps = NewAppsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -3658,8 +3657,7 @@ func (c *AppsCreateCall) Header() http.Header { func (c *AppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -3785,12 +3783,11 @@ func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3906,12 +3903,11 @@ func (c *AppsListRuntimesCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}:listRuntimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4016,8 +4012,7 @@ func (c *AppsPatchCall) Header() http.Header { func (c *AppsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -4127,8 +4122,7 @@ func (c *AppsRepairCall) Header() http.Header { func (c *AppsRepairCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairapplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repairapplicationrequest) if err != nil { return nil, err } @@ -4229,8 +4223,7 @@ func (c *AppsAuthorizedCertificatesCreateCall) Header() http.Header { func (c *AppsAuthorizedCertificatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedcertificate) if err != nil { return nil, err } @@ -4333,12 +4326,11 @@ func (c *AppsAuthorizedCertificatesDeleteCall) Header() http.Header { func (c *AppsAuthorizedCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4462,12 +4454,11 @@ func (c *AppsAuthorizedCertificatesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4603,12 +4594,11 @@ func (c *AppsAuthorizedCertificatesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/authorizedCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4737,8 +4727,7 @@ func (c *AppsAuthorizedCertificatesPatchCall) Header() http.Header { func (c *AppsAuthorizedCertificatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedcertificate) if err != nil { return nil, err } @@ -4865,12 +4854,11 @@ func (c *AppsAuthorizedDomainsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/authorizedDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5012,8 +5000,7 @@ func (c *AppsDomainMappingsCreateCall) Header() http.Header { func (c *AppsDomainMappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -5117,12 +5104,11 @@ func (c *AppsDomainMappingsDeleteCall) Header() http.Header { func (c *AppsDomainMappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/domainMappings/{domainMappingsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5229,12 +5215,11 @@ func (c *AppsDomainMappingsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/domainMappings/{domainMappingsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5352,12 +5337,11 @@ func (c *AppsDomainMappingsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/domainMappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5485,8 +5469,7 @@ func (c *AppsDomainMappingsPatchCall) Header() http.Header { func (c *AppsDomainMappingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -5591,8 +5574,7 @@ func (c *AppsFirewallIngressRulesBatchUpdateCall) Header() http.Header { func (c *AppsFirewallIngressRulesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdateingressrulesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdateingressrulesrequest) if err != nil { return nil, err } @@ -5694,8 +5676,7 @@ func (c *AppsFirewallIngressRulesCreateCall) Header() http.Header { func (c *AppsFirewallIngressRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallrule) if err != nil { return nil, err } @@ -5797,12 +5778,11 @@ func (c *AppsFirewallIngressRulesDeleteCall) Header() http.Header { func (c *AppsFirewallIngressRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5909,12 +5889,11 @@ func (c *AppsFirewallIngressRulesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6040,12 +6019,11 @@ func (c *AppsFirewallIngressRulesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/firewall/ingressRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6170,8 +6148,7 @@ func (c *AppsFirewallIngressRulesPatchCall) Header() http.Header { func (c *AppsFirewallIngressRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallrule) if err != nil { return nil, err } @@ -6285,12 +6262,11 @@ func (c *AppsLocationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/locations/{locationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6418,12 +6394,11 @@ func (c *AppsLocationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6552,12 +6527,11 @@ func (c *AppsOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/operations/{operationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6681,12 +6655,11 @@ func (c *AppsOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6802,12 +6775,11 @@ func (c *AppsServicesDeleteCall) Header() http.Header { func (c *AppsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6914,12 +6886,11 @@ func (c *AppsServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7037,12 +7008,11 @@ func (c *AppsServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7186,8 +7156,7 @@ func (c *AppsServicesPatchCall) Header() http.Header { func (c *AppsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -7292,8 +7261,7 @@ func (c *AppsServicesVersionsCreateCall) Header() http.Header { func (c *AppsServicesVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -7399,12 +7367,11 @@ func (c *AppsServicesVersionsDeleteCall) Header() http.Header { func (c *AppsServicesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7534,12 +7501,11 @@ func (c *AppsServicesVersionsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7679,12 +7645,11 @@ func (c *AppsServicesVersionsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7844,8 +7809,7 @@ func (c *AppsServicesVersionsPatchCall) Header() http.Header { func (c *AppsServicesVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -7962,8 +7926,7 @@ func (c *AppsServicesVersionsInstancesDebugCall) Header() http.Header { func (c *AppsServicesVersionsInstancesDebugCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.debuginstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.debuginstancerequest) if err != nil { return nil, err } @@ -8084,12 +8047,11 @@ func (c *AppsServicesVersionsInstancesDeleteCall) Header() http.Header { func (c *AppsServicesVersionsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8204,12 +8166,11 @@ func (c *AppsServicesVersionsInstancesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8337,12 +8298,11 @@ func (c *AppsServicesVersionsInstancesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8489,12 +8449,11 @@ func (c *ProjectsLocationsApplicationsAuthorizedDomainsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/authorizedDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8618,12 +8577,11 @@ func (c *ProjectsLocationsApplicationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8729,12 +8687,11 @@ func (c *ProjectsLocationsApplicationsServicesVersionsDeleteCall) Header() http. func (c *ProjectsLocationsApplicationsServicesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } diff --git a/appengine/v1alpha/appengine-gen.go b/appengine/v1alpha/appengine-gen.go index 38b90e1c564..fff917f5d94 100644 --- a/appengine/v1alpha/appengine-gen.go +++ b/appengine/v1alpha/appengine-gen.go @@ -129,7 +129,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -148,10 +150,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Apps = NewAppsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -1473,8 +1472,7 @@ func (c *AppsAuthorizedCertificatesCreateCall) Header() http.Header { func (c *AppsAuthorizedCertificatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedcertificate) if err != nil { return nil, err } @@ -1577,12 +1575,11 @@ func (c *AppsAuthorizedCertificatesDeleteCall) Header() http.Header { func (c *AppsAuthorizedCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1706,12 +1703,11 @@ func (c *AppsAuthorizedCertificatesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1847,12 +1843,11 @@ func (c *AppsAuthorizedCertificatesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/authorizedCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1981,8 +1976,7 @@ func (c *AppsAuthorizedCertificatesPatchCall) Header() http.Header { func (c *AppsAuthorizedCertificatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedcertificate) if err != nil { return nil, err } @@ -2109,12 +2103,11 @@ func (c *AppsAuthorizedDomainsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/authorizedDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2266,8 +2259,7 @@ func (c *AppsDomainMappingsCreateCall) Header() http.Header { func (c *AppsDomainMappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -2371,12 +2363,11 @@ func (c *AppsDomainMappingsDeleteCall) Header() http.Header { func (c *AppsDomainMappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2483,12 +2474,11 @@ func (c *AppsDomainMappingsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2606,12 +2596,11 @@ func (c *AppsDomainMappingsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/domainMappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2750,8 +2739,7 @@ func (c *AppsDomainMappingsPatchCall) Header() http.Header { func (c *AppsDomainMappingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -2865,12 +2853,11 @@ func (c *AppsLocationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/locations/{locationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2998,12 +2985,11 @@ func (c *AppsLocationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3132,12 +3118,11 @@ func (c *AppsOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/operations/{operationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3261,12 +3246,11 @@ func (c *AppsOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{appsId}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3393,12 +3377,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/projects/{projectsId}/locations/{locationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3526,12 +3509,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/projects/{projectsId}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3676,12 +3658,11 @@ func (c *ProjectsLocationsApplicationsAuthorizedDomainsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/authorizedDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3815,12 +3796,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3948,12 +3928,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/projects/{projectsId}/locations/{locationsId}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/appengine/v1beta/appengine-gen.go b/appengine/v1beta/appengine-gen.go index 9293e77a5fb..096e0bf2ffd 100644 --- a/appengine/v1beta/appengine-gen.go +++ b/appengine/v1beta/appengine-gen.go @@ -129,7 +129,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -148,10 +150,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Apps = NewAppsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -3748,8 +3747,7 @@ func (c *AppsCreateCall) Header() http.Header { func (c *AppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -3875,12 +3873,11 @@ func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3996,12 +3993,11 @@ func (c *AppsListRuntimesCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}:listRuntimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4106,8 +4102,7 @@ func (c *AppsPatchCall) Header() http.Header { func (c *AppsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -4217,8 +4212,7 @@ func (c *AppsRepairCall) Header() http.Header { func (c *AppsRepairCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairapplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repairapplicationrequest) if err != nil { return nil, err } @@ -4319,8 +4313,7 @@ func (c *AppsAuthorizedCertificatesCreateCall) Header() http.Header { func (c *AppsAuthorizedCertificatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedcertificate) if err != nil { return nil, err } @@ -4423,12 +4416,11 @@ func (c *AppsAuthorizedCertificatesDeleteCall) Header() http.Header { func (c *AppsAuthorizedCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4552,12 +4544,11 @@ func (c *AppsAuthorizedCertificatesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4693,12 +4684,11 @@ func (c *AppsAuthorizedCertificatesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/authorizedCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4827,8 +4817,7 @@ func (c *AppsAuthorizedCertificatesPatchCall) Header() http.Header { func (c *AppsAuthorizedCertificatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedcertificate) if err != nil { return nil, err } @@ -4955,12 +4944,11 @@ func (c *AppsAuthorizedDomainsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/authorizedDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5102,8 +5090,7 @@ func (c *AppsDomainMappingsCreateCall) Header() http.Header { func (c *AppsDomainMappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -5207,12 +5194,11 @@ func (c *AppsDomainMappingsDeleteCall) Header() http.Header { func (c *AppsDomainMappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5319,12 +5305,11 @@ func (c *AppsDomainMappingsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5442,12 +5427,11 @@ func (c *AppsDomainMappingsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/domainMappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5575,8 +5559,7 @@ func (c *AppsDomainMappingsPatchCall) Header() http.Header { func (c *AppsDomainMappingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -5681,8 +5664,7 @@ func (c *AppsFirewallIngressRulesBatchUpdateCall) Header() http.Header { func (c *AppsFirewallIngressRulesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdateingressrulesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdateingressrulesrequest) if err != nil { return nil, err } @@ -5784,8 +5766,7 @@ func (c *AppsFirewallIngressRulesCreateCall) Header() http.Header { func (c *AppsFirewallIngressRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallrule) if err != nil { return nil, err } @@ -5887,12 +5868,11 @@ func (c *AppsFirewallIngressRulesDeleteCall) Header() http.Header { func (c *AppsFirewallIngressRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5999,12 +5979,11 @@ func (c *AppsFirewallIngressRulesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6130,12 +6109,11 @@ func (c *AppsFirewallIngressRulesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/firewall/ingressRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6260,8 +6238,7 @@ func (c *AppsFirewallIngressRulesPatchCall) Header() http.Header { func (c *AppsFirewallIngressRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallrule) if err != nil { return nil, err } @@ -6375,12 +6352,11 @@ func (c *AppsLocationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/locations/{locationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6508,12 +6484,11 @@ func (c *AppsLocationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6642,12 +6617,11 @@ func (c *AppsOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/operations/{operationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6771,12 +6745,11 @@ func (c *AppsOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6892,12 +6865,11 @@ func (c *AppsServicesDeleteCall) Header() http.Header { func (c *AppsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7022,12 +6994,11 @@ func (c *AppsServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7145,12 +7116,11 @@ func (c *AppsServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7294,8 +7264,7 @@ func (c *AppsServicesPatchCall) Header() http.Header { func (c *AppsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -7400,8 +7369,7 @@ func (c *AppsServicesVersionsCreateCall) Header() http.Header { func (c *AppsServicesVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -7507,12 +7475,11 @@ func (c *AppsServicesVersionsDeleteCall) Header() http.Header { func (c *AppsServicesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7660,12 +7627,11 @@ func (c *AppsServicesVersionsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7805,12 +7771,11 @@ func (c *AppsServicesVersionsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7970,8 +7935,7 @@ func (c *AppsServicesVersionsPatchCall) Header() http.Header { func (c *AppsServicesVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -8088,8 +8052,7 @@ func (c *AppsServicesVersionsInstancesDebugCall) Header() http.Header { func (c *AppsServicesVersionsInstancesDebugCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.debuginstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.debuginstancerequest) if err != nil { return nil, err } @@ -8210,12 +8173,11 @@ func (c *AppsServicesVersionsInstancesDeleteCall) Header() http.Header { func (c *AppsServicesVersionsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8330,12 +8292,11 @@ func (c *AppsServicesVersionsInstancesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8463,12 +8424,11 @@ func (c *AppsServicesVersionsInstancesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8597,12 +8557,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations/{locationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8730,12 +8689,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8880,12 +8838,11 @@ func (c *ProjectsLocationsApplicationsAuthorizedDomainsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/authorizedDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9009,12 +8966,11 @@ func (c *ProjectsLocationsApplicationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9120,12 +9076,11 @@ func (c *ProjectsLocationsApplicationsServicesVersionsDeleteCall) Header() http. func (c *ProjectsLocationsApplicationsServicesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations/{locationsId}/applications/{applicationsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9239,12 +9194,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9372,12 +9326,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/projects/{projectsId}/locations/{locationsId}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/apphub/v1/apphub-gen.go b/apphub/v1/apphub-gen.go index 4471271d1b9..21af75a60c3 100644 --- a/apphub/v1/apphub-gen.go +++ b/apphub/v1/apphub-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -2205,8 +2204,7 @@ func (c *ProjectsLocationsDetachServiceProjectAttachmentCall) Header() http.Head func (c *ProjectsLocationsDetachServiceProjectAttachmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detachserviceprojectattachmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detachserviceprojectattachmentrequest) if err != nil { return nil, err } @@ -2317,12 +2315,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2448,12 +2445,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2581,12 +2577,11 @@ func (c *ProjectsLocationsLookupServiceProjectAttachmentCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:lookupServiceProjectAttachment") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2705,8 +2700,7 @@ func (c *ProjectsLocationsApplicationsCreateCall) Header() http.Header { func (c *ProjectsLocationsApplicationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -2821,12 +2815,11 @@ func (c *ProjectsLocationsApplicationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApplicationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2929,12 +2922,11 @@ func (c *ProjectsLocationsApplicationsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3056,12 +3048,11 @@ func (c *ProjectsLocationsApplicationsGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3192,12 +3183,11 @@ func (c *ProjectsLocationsApplicationsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/applications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3342,8 +3332,7 @@ func (c *ProjectsLocationsApplicationsPatchCall) Header() http.Header { func (c *ProjectsLocationsApplicationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -3447,8 +3436,7 @@ func (c *ProjectsLocationsApplicationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApplicationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3555,8 +3543,7 @@ func (c *ProjectsLocationsApplicationsTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsApplicationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3684,8 +3671,7 @@ func (c *ProjectsLocationsApplicationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -3802,12 +3788,11 @@ func (c *ProjectsLocationsApplicationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3911,12 +3896,11 @@ func (c *ProjectsLocationsApplicationsServicesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4048,12 +4032,11 @@ func (c *ProjectsLocationsApplicationsServicesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4198,8 +4181,7 @@ func (c *ProjectsLocationsApplicationsServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -4326,8 +4308,7 @@ func (c *ProjectsLocationsApplicationsWorkloadsCreateCall) Header() http.Header func (c *ProjectsLocationsApplicationsWorkloadsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workload) if err != nil { return nil, err } @@ -4444,12 +4425,11 @@ func (c *ProjectsLocationsApplicationsWorkloadsDeleteCall) Header() http.Header func (c *ProjectsLocationsApplicationsWorkloadsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4553,12 +4533,11 @@ func (c *ProjectsLocationsApplicationsWorkloadsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4690,12 +4669,11 @@ func (c *ProjectsLocationsApplicationsWorkloadsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4840,8 +4818,7 @@ func (c *ProjectsLocationsApplicationsWorkloadsPatchCall) Header() http.Header { func (c *ProjectsLocationsApplicationsWorkloadsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workload) if err != nil { return nil, err } @@ -4954,12 +4931,11 @@ func (c *ProjectsLocationsDiscoveredServicesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5092,12 +5068,11 @@ func (c *ProjectsLocationsDiscoveredServicesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/discoveredServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5231,12 +5206,11 @@ func (c *ProjectsLocationsDiscoveredServicesLookupCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/discoveredServices:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5342,12 +5316,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5480,12 +5453,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/discoveredWorkloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5619,12 +5591,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsLookupCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/discoveredWorkloads:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5725,8 +5696,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5827,12 +5797,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5936,12 +5905,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6064,12 +6032,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6210,8 +6177,7 @@ func (c *ProjectsLocationsServiceProjectAttachmentsCreateCall) Header() http.Hea func (c *ProjectsLocationsServiceProjectAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceprojectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceprojectattachment) if err != nil { return nil, err } @@ -6328,12 +6294,11 @@ func (c *ProjectsLocationsServiceProjectAttachmentsDeleteCall) Header() http.Hea func (c *ProjectsLocationsServiceProjectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6438,12 +6403,11 @@ func (c *ProjectsLocationsServiceProjectAttachmentsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6576,12 +6540,11 @@ func (c *ProjectsLocationsServiceProjectAttachmentsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceProjectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/apphub/v1alpha/apphub-gen.go b/apphub/v1alpha/apphub-gen.go index f3f0b2eb938..b3a407c4f1e 100644 --- a/apphub/v1alpha/apphub-gen.go +++ b/apphub/v1alpha/apphub-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -2270,8 +2269,7 @@ func (c *ProjectsLocationsDetachServiceProjectAttachmentCall) Header() http.Head func (c *ProjectsLocationsDetachServiceProjectAttachmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detachserviceprojectattachmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detachserviceprojectattachmentrequest) if err != nil { return nil, err } @@ -2382,12 +2380,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2513,12 +2510,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2646,12 +2642,11 @@ func (c *ProjectsLocationsLookupServiceProjectAttachmentCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:lookupServiceProjectAttachment") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2770,8 +2765,7 @@ func (c *ProjectsLocationsApplicationsCreateCall) Header() http.Header { func (c *ProjectsLocationsApplicationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -2886,12 +2880,11 @@ func (c *ProjectsLocationsApplicationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsApplicationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2994,12 +2987,11 @@ func (c *ProjectsLocationsApplicationsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3121,12 +3113,11 @@ func (c *ProjectsLocationsApplicationsGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3257,12 +3248,11 @@ func (c *ProjectsLocationsApplicationsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/applications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3407,8 +3397,7 @@ func (c *ProjectsLocationsApplicationsPatchCall) Header() http.Header { func (c *ProjectsLocationsApplicationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.application) if err != nil { return nil, err } @@ -3512,8 +3501,7 @@ func (c *ProjectsLocationsApplicationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApplicationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3620,8 +3608,7 @@ func (c *ProjectsLocationsApplicationsTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsApplicationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3749,8 +3736,7 @@ func (c *ProjectsLocationsApplicationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -3867,12 +3853,11 @@ func (c *ProjectsLocationsApplicationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3976,12 +3961,11 @@ func (c *ProjectsLocationsApplicationsServicesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4113,12 +4097,11 @@ func (c *ProjectsLocationsApplicationsServicesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4263,8 +4246,7 @@ func (c *ProjectsLocationsApplicationsServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsApplicationsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -4391,8 +4373,7 @@ func (c *ProjectsLocationsApplicationsWorkloadsCreateCall) Header() http.Header func (c *ProjectsLocationsApplicationsWorkloadsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workload) if err != nil { return nil, err } @@ -4509,12 +4490,11 @@ func (c *ProjectsLocationsApplicationsWorkloadsDeleteCall) Header() http.Header func (c *ProjectsLocationsApplicationsWorkloadsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4618,12 +4598,11 @@ func (c *ProjectsLocationsApplicationsWorkloadsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4755,12 +4734,11 @@ func (c *ProjectsLocationsApplicationsWorkloadsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4905,8 +4883,7 @@ func (c *ProjectsLocationsApplicationsWorkloadsPatchCall) Header() http.Header { func (c *ProjectsLocationsApplicationsWorkloadsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workload) if err != nil { return nil, err } @@ -5046,12 +5023,11 @@ func (c *ProjectsLocationsDiscoveredServicesFindUnregisteredCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/discoveredServices:findUnregistered") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5178,12 +5154,11 @@ func (c *ProjectsLocationsDiscoveredServicesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5316,12 +5291,11 @@ func (c *ProjectsLocationsDiscoveredServicesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/discoveredServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5455,12 +5429,11 @@ func (c *ProjectsLocationsDiscoveredServicesLookupCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/discoveredServices:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5593,12 +5566,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsFindUnregisteredCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/discoveredWorkloads:findUnregistered") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5725,12 +5697,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5863,12 +5834,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/discoveredWorkloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6002,12 +5972,11 @@ func (c *ProjectsLocationsDiscoveredWorkloadsLookupCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/discoveredWorkloads:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6108,8 +6077,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6210,12 +6178,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6319,12 +6286,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6447,12 +6413,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6593,8 +6558,7 @@ func (c *ProjectsLocationsServiceProjectAttachmentsCreateCall) Header() http.Hea func (c *ProjectsLocationsServiceProjectAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceprojectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceprojectattachment) if err != nil { return nil, err } @@ -6711,12 +6675,11 @@ func (c *ProjectsLocationsServiceProjectAttachmentsDeleteCall) Header() http.Hea func (c *ProjectsLocationsServiceProjectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6821,12 +6784,11 @@ func (c *ProjectsLocationsServiceProjectAttachmentsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6959,12 +6921,11 @@ func (c *ProjectsLocationsServiceProjectAttachmentsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/serviceProjectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/area120tables/v1alpha1/area120tables-gen.go b/area120tables/v1alpha1/area120tables-gen.go index 32daec23751..f6f8ba67cb5 100644 --- a/area120tables/v1alpha1/area120tables-gen.go +++ b/area120tables/v1alpha1/area120tables-gen.go @@ -140,7 +140,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Tables = NewTablesService(s) + s.Workspaces = NewWorkspacesService(s) if err != nil { return nil, err } @@ -159,10 +161,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Tables = NewTablesService(s) - s.Workspaces = NewWorkspacesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -821,12 +820,11 @@ func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -949,12 +947,11 @@ func (c *TablesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/tables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1066,8 +1063,7 @@ func (c *TablesRowsBatchCreateCall) Header() http.Header { func (c *TablesRowsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreaterowsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreaterowsrequest) if err != nil { return nil, err } @@ -1169,8 +1165,7 @@ func (c *TablesRowsBatchDeleteCall) Header() http.Header { func (c *TablesRowsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleterowsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeleterowsrequest) if err != nil { return nil, err } @@ -1271,8 +1266,7 @@ func (c *TablesRowsBatchUpdateCall) Header() http.Header { func (c *TablesRowsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdaterowsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdaterowsrequest) if err != nil { return nil, err } @@ -1386,8 +1380,7 @@ func (c *TablesRowsCreateCall) Header() http.Header { func (c *TablesRowsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.row) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.row) if err != nil { return nil, err } @@ -1485,12 +1478,11 @@ func (c *TablesRowsDeleteCall) Header() http.Header { func (c *TablesRowsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1604,12 +1596,11 @@ func (c *TablesRowsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1756,12 +1747,11 @@ func (c *TablesRowsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/rows") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1895,8 +1885,7 @@ func (c *TablesRowsPatchCall) Header() http.Header { func (c *TablesRowsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.row) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.row) if err != nil { return nil, err } @@ -2007,12 +1996,11 @@ func (c *WorkspacesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2128,12 +2116,11 @@ func (c *WorkspacesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/workspaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/artifactregistry/v1/artifactregistry-gen.go b/artifactregistry/v1/artifactregistry-gen.go index 410cb41a5c8..ce1230c8a26 100644 --- a/artifactregistry/v1/artifactregistry-gen.go +++ b/artifactregistry/v1/artifactregistry-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3593,12 +3592,11 @@ func (c *ProjectsGetProjectSettingsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3700,8 +3698,7 @@ func (c *ProjectsUpdateProjectSettingsCall) Header() http.Header { func (c *ProjectsUpdateProjectSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsettings) if err != nil { return nil, err } @@ -3812,12 +3809,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3919,12 +3915,11 @@ func (c *ProjectsLocationsGetVpcscConfigCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4050,12 +4045,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4178,8 +4172,7 @@ func (c *ProjectsLocationsUpdateVpcscConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateVpcscConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpcscconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpcscconfig) if err != nil { return nil, err } @@ -4291,12 +4284,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4397,8 +4389,7 @@ func (c *ProjectsLocationsRepositoriesCreateCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -4498,12 +4489,11 @@ func (c *ProjectsLocationsRepositoriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4605,12 +4595,11 @@ func (c *ProjectsLocationsRepositoriesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4731,12 +4720,11 @@ func (c *ProjectsLocationsRepositoriesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4876,12 +4864,11 @@ func (c *ProjectsLocationsRepositoriesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/repositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5005,8 +4992,7 @@ func (c *ProjectsLocationsRepositoriesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -5108,8 +5094,7 @@ func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5213,8 +5198,7 @@ func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5319,8 +5303,7 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsImportCall) Header() http.Head func (c *ProjectsLocationsRepositoriesAptArtifactsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importaptartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importaptartifactsrequest) if err != nil { return nil, err } @@ -5463,8 +5446,7 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) Header() http.Head func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadaptartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadaptartifactrequest) if err != nil { return nil, err } @@ -5475,14 +5457,10 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) doRequest(alt stri urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/aptArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -5602,8 +5580,7 @@ func (c *ProjectsLocationsRepositoriesAttachmentsCreateCall) Header() http.Heade func (c *ProjectsLocationsRepositoriesAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attachment) if err != nil { return nil, err } @@ -5703,12 +5680,11 @@ func (c *ProjectsLocationsRepositoriesAttachmentsDeleteCall) Header() http.Heade func (c *ProjectsLocationsRepositoriesAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5810,12 +5786,11 @@ func (c *ProjectsLocationsRepositoriesAttachmentsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5939,12 +5914,11 @@ func (c *ProjectsLocationsRepositoriesAttachmentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6068,12 +6042,11 @@ func (c *ProjectsLocationsRepositoriesDockerImagesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6197,12 +6170,11 @@ func (c *ProjectsLocationsRepositoriesDockerImagesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dockerImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6316,12 +6288,11 @@ func (c *ProjectsLocationsRepositoriesFilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesFilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6423,12 +6394,11 @@ func (c *ProjectsLocationsRepositoriesFilesDownloadCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6547,12 +6517,11 @@ func (c *ProjectsLocationsRepositoriesFilesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6715,12 +6684,11 @@ func (c *ProjectsLocationsRepositoriesFilesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6844,8 +6812,7 @@ func (c *ProjectsLocationsRepositoriesFilesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesFilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledevtoolsartifactregistryv1file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledevtoolsartifactregistryv1file) if err != nil { return nil, err } @@ -6987,8 +6954,7 @@ func (c *ProjectsLocationsRepositoriesFilesUploadCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesFilesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadfilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadfilerequest) if err != nil { return nil, err } @@ -6999,14 +6965,10 @@ func (c *ProjectsLocationsRepositoriesFilesUploadCall) doRequest(alt string) (*h urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/files:upload") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -7160,8 +7122,7 @@ func (c *ProjectsLocationsRepositoriesGenericArtifactsUploadCall) Header() http. func (c *ProjectsLocationsRepositoriesGenericArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadgenericartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadgenericartifactrequest) if err != nil { return nil, err } @@ -7172,14 +7133,10 @@ func (c *ProjectsLocationsRepositoriesGenericArtifactsUploadCall) doRequest(alt urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/genericArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -7332,8 +7289,7 @@ func (c *ProjectsLocationsRepositoriesGoModulesUploadCall) Header() http.Header func (c *ProjectsLocationsRepositoriesGoModulesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadgomodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadgomodulerequest) if err != nil { return nil, err } @@ -7344,14 +7300,10 @@ func (c *ProjectsLocationsRepositoriesGoModulesUploadCall) doRequest(alt string) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/goModules:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -7466,8 +7418,7 @@ func (c *ProjectsLocationsRepositoriesGoogetArtifactsImportCall) Header() http.H func (c *ProjectsLocationsRepositoriesGoogetArtifactsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importgoogetartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importgoogetartifactsrequest) if err != nil { return nil, err } @@ -7610,8 +7561,7 @@ func (c *ProjectsLocationsRepositoriesGoogetArtifactsUploadCall) Header() http.H func (c *ProjectsLocationsRepositoriesGoogetArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadgoogetartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadgoogetartifactrequest) if err != nil { return nil, err } @@ -7622,14 +7572,10 @@ func (c *ProjectsLocationsRepositoriesGoogetArtifactsUploadCall) doRequest(alt s urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/googetArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -7783,8 +7729,7 @@ func (c *ProjectsLocationsRepositoriesKfpArtifactsUploadCall) Header() http.Head func (c *ProjectsLocationsRepositoriesKfpArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadkfpartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadkfpartifactrequest) if err != nil { return nil, err } @@ -7795,14 +7740,10 @@ func (c *ProjectsLocationsRepositoriesKfpArtifactsUploadCall) doRequest(alt stri urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/kfpArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -7923,12 +7864,11 @@ func (c *ProjectsLocationsRepositoriesMavenArtifactsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8045,12 +7985,11 @@ func (c *ProjectsLocationsRepositoriesMavenArtifactsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/mavenArtifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8174,12 +8113,11 @@ func (c *ProjectsLocationsRepositoriesNpmPackagesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8295,12 +8233,11 @@ func (c *ProjectsLocationsRepositoriesNpmPackagesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/npmPackages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8413,12 +8350,11 @@ func (c *ProjectsLocationsRepositoriesPackagesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPackagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8520,12 +8456,11 @@ func (c *ProjectsLocationsRepositoriesPackagesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8683,12 +8618,11 @@ func (c *ProjectsLocationsRepositoriesPackagesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/packages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8812,8 +8746,7 @@ func (c *ProjectsLocationsRepositoriesPackagesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPackagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.package_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.package_) if err != nil { return nil, err } @@ -8920,8 +8853,7 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsCreateCall) Header() http.Head func (c *ProjectsLocationsRepositoriesPackagesTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -9019,12 +8951,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsDeleteCall) Header() http.Head func (c *ProjectsLocationsRepositoriesPackagesTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9126,12 +9057,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9273,12 +9203,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9404,8 +9333,7 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) Header() http.Heade func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -9506,8 +9434,7 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsBatchDeleteCall) Header() func (c *ProjectsLocationsRepositoriesPackagesVersionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleteversionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeleteversionsrequest) if err != nil { return nil, err } @@ -9614,12 +9541,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsDeleteCall) Header() http. func (c *ProjectsLocationsRepositoriesPackagesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9740,12 +9666,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9922,12 +9847,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10052,8 +9976,7 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsPatchCall) Header() http.H func (c *ProjectsLocationsRepositoriesPackagesVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -10163,12 +10086,11 @@ func (c *ProjectsLocationsRepositoriesPythonPackagesGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10285,12 +10207,11 @@ func (c *ProjectsLocationsRepositoriesPythonPackagesListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pythonPackages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10411,8 +10332,7 @@ func (c *ProjectsLocationsRepositoriesRulesCreateCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledevtoolsartifactregistryv1rule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledevtoolsartifactregistryv1rule) if err != nil { return nil, err } @@ -10511,12 +10431,11 @@ func (c *ProjectsLocationsRepositoriesRulesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10618,12 +10537,11 @@ func (c *ProjectsLocationsRepositoriesRulesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10741,12 +10659,11 @@ func (c *ProjectsLocationsRepositoriesRulesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10869,8 +10786,7 @@ func (c *ProjectsLocationsRepositoriesRulesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledevtoolsartifactregistryv1rule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledevtoolsartifactregistryv1rule) if err != nil { return nil, err } @@ -10975,8 +10891,7 @@ func (c *ProjectsLocationsRepositoriesYumArtifactsImportCall) Header() http.Head func (c *ProjectsLocationsRepositoriesYumArtifactsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importyumartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importyumartifactsrequest) if err != nil { return nil, err } @@ -11119,8 +11034,7 @@ func (c *ProjectsLocationsRepositoriesYumArtifactsUploadCall) Header() http.Head func (c *ProjectsLocationsRepositoriesYumArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadyumartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadyumartifactrequest) if err != nil { return nil, err } @@ -11131,14 +11045,10 @@ func (c *ProjectsLocationsRepositoriesYumArtifactsUploadCall) doRequest(alt stri urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/yumArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/artifactregistry/v1beta1/artifactregistry-gen.go b/artifactregistry/v1beta1/artifactregistry-gen.go index ddd1a61aa90..626125653d8 100644 --- a/artifactregistry/v1beta1/artifactregistry-gen.go +++ b/artifactregistry/v1beta1/artifactregistry-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1162,12 +1161,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1293,12 +1291,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1424,12 +1421,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1530,8 +1526,7 @@ func (c *ProjectsLocationsRepositoriesCreateCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -1631,12 +1626,11 @@ func (c *ProjectsLocationsRepositoriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1738,12 +1732,11 @@ func (c *ProjectsLocationsRepositoriesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1864,12 +1857,11 @@ func (c *ProjectsLocationsRepositoriesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1992,12 +1984,11 @@ func (c *ProjectsLocationsRepositoriesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/repositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2121,8 +2112,7 @@ func (c *ProjectsLocationsRepositoriesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -2224,8 +2214,7 @@ func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2329,8 +2318,7 @@ func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2441,12 +2429,11 @@ func (c *ProjectsLocationsRepositoriesFilesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2601,12 +2588,11 @@ func (c *ProjectsLocationsRepositoriesFilesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2719,12 +2705,11 @@ func (c *ProjectsLocationsRepositoriesPackagesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPackagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2826,12 +2811,11 @@ func (c *ProjectsLocationsRepositoriesPackagesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2954,12 +2938,11 @@ func (c *ProjectsLocationsRepositoriesPackagesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/packages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3080,8 +3063,7 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsCreateCall) Header() http.Head func (c *ProjectsLocationsRepositoriesPackagesTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -3179,12 +3161,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsDeleteCall) Header() http.Head func (c *ProjectsLocationsRepositoriesPackagesTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3286,12 +3267,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3433,12 +3413,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3564,8 +3543,7 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) Header() http.Heade func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -3672,12 +3650,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsDeleteCall) Header() http. func (c *ProjectsLocationsRepositoriesPackagesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3798,12 +3775,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3945,12 +3921,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/artifactregistry/v1beta2/artifactregistry-gen.go b/artifactregistry/v1beta2/artifactregistry-gen.go index a1480905be0..ae09204aecd 100644 --- a/artifactregistry/v1beta2/artifactregistry-gen.go +++ b/artifactregistry/v1beta2/artifactregistry-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1676,12 +1675,11 @@ func (c *ProjectsGetProjectSettingsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1783,8 +1781,7 @@ func (c *ProjectsUpdateProjectSettingsCall) Header() http.Header { func (c *ProjectsUpdateProjectSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsettings) if err != nil { return nil, err } @@ -1895,12 +1892,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2026,12 +2022,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2157,12 +2152,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2263,8 +2257,7 @@ func (c *ProjectsLocationsRepositoriesCreateCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -2364,12 +2357,11 @@ func (c *ProjectsLocationsRepositoriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2471,12 +2463,11 @@ func (c *ProjectsLocationsRepositoriesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2597,12 +2588,11 @@ func (c *ProjectsLocationsRepositoriesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2725,12 +2715,11 @@ func (c *ProjectsLocationsRepositoriesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/repositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2854,8 +2843,7 @@ func (c *ProjectsLocationsRepositoriesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -2957,8 +2945,7 @@ func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3062,8 +3049,7 @@ func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3168,8 +3154,7 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsImportCall) Header() http.Head func (c *ProjectsLocationsRepositoriesAptArtifactsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importaptartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importaptartifactsrequest) if err != nil { return nil, err } @@ -3312,8 +3297,7 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) Header() http.Head func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadaptartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadaptartifactrequest) if err != nil { return nil, err } @@ -3324,14 +3308,10 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) doRequest(alt stri urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1beta2/{+parent}/aptArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -3452,12 +3432,11 @@ func (c *ProjectsLocationsRepositoriesFilesDownloadCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3576,12 +3555,11 @@ func (c *ProjectsLocationsRepositoriesFilesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3737,12 +3715,11 @@ func (c *ProjectsLocationsRepositoriesFilesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3855,12 +3832,11 @@ func (c *ProjectsLocationsRepositoriesPackagesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPackagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3962,12 +3938,11 @@ func (c *ProjectsLocationsRepositoriesPackagesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4090,12 +4065,11 @@ func (c *ProjectsLocationsRepositoriesPackagesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/packages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4219,8 +4193,7 @@ func (c *ProjectsLocationsRepositoriesPackagesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPackagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.package_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.package_) if err != nil { return nil, err } @@ -4327,8 +4300,7 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsCreateCall) Header() http.Head func (c *ProjectsLocationsRepositoriesPackagesTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -4426,12 +4398,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsDeleteCall) Header() http.Head func (c *ProjectsLocationsRepositoriesPackagesTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4533,12 +4504,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4680,12 +4650,11 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4811,8 +4780,7 @@ func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) Header() http.Heade func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -4919,12 +4887,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsDeleteCall) Header() http. func (c *ProjectsLocationsRepositoriesPackagesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5045,12 +5012,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5192,12 +5158,11 @@ func (c *ProjectsLocationsRepositoriesPackagesVersionsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5315,8 +5280,7 @@ func (c *ProjectsLocationsRepositoriesYumArtifactsImportCall) Header() http.Head func (c *ProjectsLocationsRepositoriesYumArtifactsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importyumartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importyumartifactsrequest) if err != nil { return nil, err } @@ -5459,8 +5423,7 @@ func (c *ProjectsLocationsRepositoriesYumArtifactsUploadCall) Header() http.Head func (c *ProjectsLocationsRepositoriesYumArtifactsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadyumartifactrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadyumartifactrequest) if err != nil { return nil, err } @@ -5471,14 +5434,10 @@ func (c *ProjectsLocationsRepositoriesYumArtifactsUploadCall) doRequest(alt stri urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1beta2/{+parent}/yumArtifacts:create") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/assuredworkloads/v1/assuredworkloads-gen.go b/assuredworkloads/v1/assuredworkloads-gen.go index 96678f1d4dd..70596a678be 100644 --- a/assuredworkloads/v1/assuredworkloads-gen.go +++ b/assuredworkloads/v1/assuredworkloads-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1496,12 +1495,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1625,12 +1623,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1795,12 +1792,11 @@ func (c *OrganizationsLocationsWorkloadsAnalyzeWorkloadMoveCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+target}:analyzeWorkloadMove") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1925,8 +1921,7 @@ func (c *OrganizationsLocationsWorkloadsCreateCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1workload) if err != nil { return nil, err } @@ -2037,12 +2032,11 @@ func (c *OrganizationsLocationsWorkloadsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2135,12 +2129,11 @@ func (c *OrganizationsLocationsWorkloadsEnableResourceMonitoringCall) Header() h func (c *OrganizationsLocationsWorkloadsEnableResourceMonitoringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:enableResourceMonitoring") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2247,12 +2240,11 @@ func (c *OrganizationsLocationsWorkloadsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2378,12 +2370,11 @@ func (c *OrganizationsLocationsWorkloadsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2500,8 +2491,7 @@ func (c *OrganizationsLocationsWorkloadsMutatePartnerPermissionsCall) Header() h func (c *OrganizationsLocationsWorkloadsMutatePartnerPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1mutatepartnerpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1mutatepartnerpermissionsrequest) if err != nil { return nil, err } @@ -2613,8 +2603,7 @@ func (c *OrganizationsLocationsWorkloadsPatchCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1workload) if err != nil { return nil, err } @@ -2724,8 +2713,7 @@ func (c *OrganizationsLocationsWorkloadsRestrictAllowedResourcesCall) Header() h func (c *OrganizationsLocationsWorkloadsRestrictAllowedResourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1restrictallowedresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1restrictallowedresourcesrequest) if err != nil { return nil, err } @@ -2832,8 +2820,7 @@ func (c *OrganizationsLocationsWorkloadsViolationsAcknowledgeCall) Header() http func (c *OrganizationsLocationsWorkloadsViolationsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1acknowledgeviolationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1acknowledgeviolationrequest) if err != nil { return nil, err } @@ -2947,12 +2934,11 @@ func (c *OrganizationsLocationsWorkloadsViolationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3094,12 +3080,11 @@ func (c *OrganizationsLocationsWorkloadsViolationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/violations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/assuredworkloads/v1beta1/assuredworkloads-gen.go b/assuredworkloads/v1beta1/assuredworkloads-gen.go index 6ace2cf5b43..3762ac22073 100644 --- a/assuredworkloads/v1beta1/assuredworkloads-gen.go +++ b/assuredworkloads/v1beta1/assuredworkloads-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1896,12 +1895,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2025,12 +2023,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2195,12 +2192,11 @@ func (c *OrganizationsLocationsWorkloadsAnalyzeWorkloadMoveCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+target}:analyzeWorkloadMove") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2325,8 +2321,7 @@ func (c *OrganizationsLocationsWorkloadsCreateCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1beta1workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1beta1workload) if err != nil { return nil, err } @@ -2437,12 +2432,11 @@ func (c *OrganizationsLocationsWorkloadsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2540,12 +2534,11 @@ func (c *OrganizationsLocationsWorkloadsEnableComplianceUpdatesCall) Header() ht func (c *OrganizationsLocationsWorkloadsEnableComplianceUpdatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:enableComplianceUpdates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, nil) if err != nil { return nil, err } @@ -2638,12 +2631,11 @@ func (c *OrganizationsLocationsWorkloadsEnableResourceMonitoringCall) Header() h func (c *OrganizationsLocationsWorkloadsEnableResourceMonitoringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:enableResourceMonitoring") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2750,12 +2742,11 @@ func (c *OrganizationsLocationsWorkloadsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2881,12 +2872,11 @@ func (c *OrganizationsLocationsWorkloadsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3011,8 +3001,7 @@ func (c *OrganizationsLocationsWorkloadsPatchCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1beta1workload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1beta1workload) if err != nil { return nil, err } @@ -3122,8 +3111,7 @@ func (c *OrganizationsLocationsWorkloadsRestrictAllowedResourcesCall) Header() h func (c *OrganizationsLocationsWorkloadsRestrictAllowedResourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1beta1restrictallowedresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1beta1restrictallowedresourcesrequest) if err != nil { return nil, err } @@ -3226,8 +3214,7 @@ func (c *OrganizationsLocationsWorkloadsUpdatesApplyCall) Header() http.Header { func (c *OrganizationsLocationsWorkloadsUpdatesApplyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1beta1applyworkloadupdaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1beta1applyworkloadupdaterequest) if err != nil { return nil, err } @@ -3353,12 +3340,11 @@ func (c *OrganizationsLocationsWorkloadsUpdatesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/updates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3478,8 +3464,7 @@ func (c *OrganizationsLocationsWorkloadsViolationsAcknowledgeCall) Header() http func (c *OrganizationsLocationsWorkloadsViolationsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1beta1acknowledgeviolationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassuredworkloadsv1beta1acknowledgeviolationrequest) if err != nil { return nil, err } @@ -3593,12 +3578,11 @@ func (c *OrganizationsLocationsWorkloadsViolationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3740,12 +3724,11 @@ func (c *OrganizationsLocationsWorkloadsViolationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/violations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go index 0ef1093fee6..f13f7bcff0a 100644 --- a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go +++ b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Bidders = NewBiddersService(s) + s.Buyers = NewBuyersService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Bidders = NewBiddersService(s) - s.Buyers = NewBuyersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2533,12 +2532,11 @@ func (c *BiddersAuctionPackagesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/auctionPackages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2709,12 +2707,11 @@ func (c *BiddersFinalizedDealsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/finalizedDeals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2839,12 +2836,11 @@ func (c *BuyersAuctionPackagesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2989,12 +2985,11 @@ func (c *BuyersAuctionPackagesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/auctionPackages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3112,8 +3107,7 @@ func (c *BuyersAuctionPackagesSubscribeCall) Header() http.Header { func (c *BuyersAuctionPackagesSubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribeauctionpackagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribeauctionpackagerequest) if err != nil { return nil, err } @@ -3218,8 +3212,7 @@ func (c *BuyersAuctionPackagesSubscribeClientsCall) Header() http.Header { func (c *BuyersAuctionPackagesSubscribeClientsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribeclientsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribeclientsrequest) if err != nil { return nil, err } @@ -3322,8 +3315,7 @@ func (c *BuyersAuctionPackagesUnsubscribeCall) Header() http.Header { func (c *BuyersAuctionPackagesUnsubscribeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsubscribeauctionpackagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unsubscribeauctionpackagerequest) if err != nil { return nil, err } @@ -3426,8 +3418,7 @@ func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Header() http.Header { func (c *BuyersAuctionPackagesUnsubscribeClientsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsubscribeclientsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unsubscribeclientsrequest) if err != nil { return nil, err } @@ -3529,8 +3520,7 @@ func (c *BuyersClientsActivateCall) Header() http.Header { func (c *BuyersClientsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activateclientrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activateclientrequest) if err != nil { return nil, err } @@ -3630,8 +3620,7 @@ func (c *BuyersClientsCreateCall) Header() http.Header { func (c *BuyersClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client) if err != nil { return nil, err } @@ -3733,8 +3722,7 @@ func (c *BuyersClientsDeactivateCall) Header() http.Header { func (c *BuyersClientsDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivateclientrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivateclientrequest) if err != nil { return nil, err } @@ -3844,12 +3832,11 @@ func (c *BuyersClientsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3980,12 +3967,11 @@ func (c *BuyersClientsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4115,8 +4101,7 @@ func (c *BuyersClientsPatchCall) Header() http.Header { func (c *BuyersClientsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client) if err != nil { return nil, err } @@ -4220,8 +4205,7 @@ func (c *BuyersClientsUsersActivateCall) Header() http.Header { func (c *BuyersClientsUsersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activateclientuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activateclientuserrequest) if err != nil { return nil, err } @@ -4323,8 +4307,7 @@ func (c *BuyersClientsUsersCreateCall) Header() http.Header { func (c *BuyersClientsUsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientuser) if err != nil { return nil, err } @@ -4428,8 +4411,7 @@ func (c *BuyersClientsUsersDeactivateCall) Header() http.Header { func (c *BuyersClientsUsersDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivateclientuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivateclientuserrequest) if err != nil { return nil, err } @@ -4531,12 +4513,11 @@ func (c *BuyersClientsUsersDeleteCall) Header() http.Header { func (c *BuyersClientsUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4639,12 +4620,11 @@ func (c *BuyersClientsUsersGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4763,12 +4743,11 @@ func (c *BuyersClientsUsersListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4890,8 +4869,7 @@ func (c *BuyersFinalizedDealsAddCreativeCall) Header() http.Header { func (c *BuyersFinalizedDealsAddCreativeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addcreativerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addcreativerequest) if err != nil { return nil, err } @@ -5001,12 +4979,11 @@ func (c *BuyersFinalizedDealsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5155,12 +5132,11 @@ func (c *BuyersFinalizedDealsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/finalizedDeals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5277,8 +5253,7 @@ func (c *BuyersFinalizedDealsPauseCall) Header() http.Header { func (c *BuyersFinalizedDealsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausefinalizeddealrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausefinalizeddealrequest) if err != nil { return nil, err } @@ -5382,8 +5357,7 @@ func (c *BuyersFinalizedDealsResumeCall) Header() http.Header { func (c *BuyersFinalizedDealsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumefinalizeddealrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumefinalizeddealrequest) if err != nil { return nil, err } @@ -5491,8 +5465,7 @@ func (c *BuyersFinalizedDealsSetReadyToServeCall) Header() http.Header { func (c *BuyersFinalizedDealsSetReadyToServeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setreadytoserverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setreadytoserverequest) if err != nil { return nil, err } @@ -5600,8 +5573,7 @@ func (c *BuyersProposalsAcceptCall) Header() http.Header { func (c *BuyersProposalsAcceptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acceptproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acceptproposalrequest) if err != nil { return nil, err } @@ -5704,8 +5676,7 @@ func (c *BuyersProposalsAddNoteCall) Header() http.Header { func (c *BuyersProposalsAddNoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addnoterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addnoterequest) if err != nil { return nil, err } @@ -5814,8 +5785,7 @@ func (c *BuyersProposalsCancelNegotiationCall) Header() http.Header { func (c *BuyersProposalsCancelNegotiationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelnegotiationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelnegotiationrequest) if err != nil { return nil, err } @@ -5927,12 +5897,11 @@ func (c *BuyersProposalsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6063,12 +6032,11 @@ func (c *BuyersProposalsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/proposals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6205,8 +6173,7 @@ func (c *BuyersProposalsPatchCall) Header() http.Header { func (c *BuyersProposalsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.proposal) if err != nil { return nil, err } @@ -6312,8 +6279,7 @@ func (c *BuyersProposalsSendRfpCall) Header() http.Header { func (c *BuyersProposalsSendRfpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendrfprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendrfprequest) if err != nil { return nil, err } @@ -6414,8 +6380,7 @@ func (c *BuyersProposalsDealsBatchUpdateCall) Header() http.Header { func (c *BuyersProposalsDealsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatedealsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatedealsrequest) if err != nil { return nil, err } @@ -6526,12 +6491,11 @@ func (c *BuyersProposalsDealsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6652,12 +6616,11 @@ func (c *BuyersProposalsDealsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6797,8 +6760,7 @@ func (c *BuyersProposalsDealsPatchCall) Header() http.Header { func (c *BuyersProposalsDealsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deal) if err != nil { return nil, err } @@ -6909,12 +6871,11 @@ func (c *BuyersPublisherProfilesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7045,12 +7006,11 @@ func (c *BuyersPublisherProfilesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/publisherProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/backupdr/v1/backupdr-gen.go b/backupdr/v1/backupdr-gen.go index cb7bc026deb..4c607b47c2a 100644 --- a/backupdr/v1/backupdr-gen.go +++ b/backupdr/v1/backupdr-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3832,12 +3831,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3963,12 +3961,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4108,8 +4105,7 @@ func (c *ProjectsLocationsBackupPlanAssociationsCreateCall) Header() http.Header func (c *ProjectsLocationsBackupPlanAssociationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupplanassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupplanassociation) if err != nil { return nil, err } @@ -4225,12 +4221,11 @@ func (c *ProjectsLocationsBackupPlanAssociationsDeleteCall) Header() http.Header func (c *ProjectsLocationsBackupPlanAssociationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4334,12 +4329,11 @@ func (c *ProjectsLocationsBackupPlanAssociationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4467,12 +4461,11 @@ func (c *ProjectsLocationsBackupPlanAssociationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupPlanAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4588,8 +4581,7 @@ func (c *ProjectsLocationsBackupPlanAssociationsTriggerBackupCall) Header() http func (c *ProjectsLocationsBackupPlanAssociationsTriggerBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.triggerbackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.triggerbackuprequest) if err != nil { return nil, err } @@ -4716,8 +4708,7 @@ func (c *ProjectsLocationsBackupPlansCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupplan) if err != nil { return nil, err } @@ -4832,12 +4823,11 @@ func (c *ProjectsLocationsBackupPlansDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4940,12 +4930,11 @@ func (c *ProjectsLocationsBackupPlansGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5085,12 +5074,11 @@ func (c *ProjectsLocationsBackupPlansListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupPlans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5235,8 +5223,7 @@ func (c *ProjectsLocationsBackupVaultsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupVaultsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupvault) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupvault) if err != nil { return nil, err } @@ -5389,12 +5376,11 @@ func (c *ProjectsLocationsBackupVaultsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupVaultsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5530,12 +5516,11 @@ func (c *ProjectsLocationsBackupVaultsFetchUsableCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupVaults:fetchUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5681,12 +5666,11 @@ func (c *ProjectsLocationsBackupVaultsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5841,12 +5825,11 @@ func (c *ProjectsLocationsBackupVaultsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupVaults") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6004,8 +5987,7 @@ func (c *ProjectsLocationsBackupVaultsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupVaultsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupvault) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupvault) if err != nil { return nil, err } @@ -6110,8 +6092,7 @@ func (c *ProjectsLocationsBackupVaultsTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsBackupVaultsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6213,8 +6194,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesAbandonBackupCall) Header() htt func (c *ProjectsLocationsBackupVaultsDataSourcesAbandonBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.abandonbackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abandonbackuprequest) if err != nil { return nil, err } @@ -6316,8 +6296,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesFetchAccessTokenCall) Header() func (c *ProjectsLocationsBackupVaultsDataSourcesFetchAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchaccesstokenrequest) if err != nil { return nil, err } @@ -6420,8 +6399,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesFinalizeBackupCall) Header() ht func (c *ProjectsLocationsBackupVaultsDataSourcesFinalizeBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finalizebackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finalizebackuprequest) if err != nil { return nil, err } @@ -6533,12 +6511,11 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6631,8 +6608,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesInitiateBackupCall) Header() ht func (c *ProjectsLocationsBackupVaultsDataSourcesInitiateBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiatebackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initiatebackuprequest) if err != nil { return nil, err } @@ -6775,12 +6751,11 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6931,8 +6906,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesPatchCall) Header() http.Header func (c *ProjectsLocationsBackupVaultsDataSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -7034,8 +7008,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesRemoveCall) Header() http.Heade func (c *ProjectsLocationsBackupVaultsDataSourcesRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removedatasourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removedatasourcerequest) if err != nil { return nil, err } @@ -7136,8 +7109,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesSetInternalStatusCall) Header() func (c *ProjectsLocationsBackupVaultsDataSourcesSetInternalStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinternalstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setinternalstatusrequest) if err != nil { return nil, err } @@ -7251,12 +7223,11 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsDeleteCall) Header() htt func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7381,12 +7352,11 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7541,12 +7511,11 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7690,8 +7659,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsPatchCall) Header() http func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -7792,8 +7760,7 @@ func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsRestoreCall) Header() ht func (c *ProjectsLocationsBackupVaultsDataSourcesBackupsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restorebackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restorebackuprequest) if err != nil { return nil, err } @@ -7919,8 +7886,7 @@ func (c *ProjectsLocationsManagementServersCreateCall) Header() http.Header { func (c *ProjectsLocationsManagementServersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managementserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managementserver) if err != nil { return nil, err } @@ -8034,12 +8000,11 @@ func (c *ProjectsLocationsManagementServersDeleteCall) Header() http.Header { func (c *ProjectsLocationsManagementServersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8143,12 +8108,11 @@ func (c *ProjectsLocationsManagementServersGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8271,12 +8235,11 @@ func (c *ProjectsLocationsManagementServersGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8410,12 +8373,11 @@ func (c *ProjectsLocationsManagementServersListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/managementServers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8533,8 +8495,7 @@ func (c *ProjectsLocationsManagementServersSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsManagementServersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8641,8 +8602,7 @@ func (c *ProjectsLocationsManagementServersTestIamPermissionsCall) Header() http func (c *ProjectsLocationsManagementServersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8751,8 +8711,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -8853,12 +8812,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8962,12 +8920,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9090,12 +9047,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/baremetalsolution/v2/baremetalsolution-gen.go b/baremetalsolution/v2/baremetalsolution-gen.go index 22dbe242ffb..a94930b4175 100644 --- a/baremetalsolution/v2/baremetalsolution-gen.go +++ b/baremetalsolution/v2/baremetalsolution-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2578,12 +2577,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2709,12 +2707,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2828,8 +2825,7 @@ func (c *ProjectsLocationsInstancesDetachLunCall) Header() http.Header { func (c *ProjectsLocationsInstancesDetachLunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detachlunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detachlunrequest) if err != nil { return nil, err } @@ -2931,8 +2927,7 @@ func (c *ProjectsLocationsInstancesDisableHyperthreadingCall) Header() http.Head func (c *ProjectsLocationsInstancesDisableHyperthreadingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablehyperthreadingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablehyperthreadingrequest) if err != nil { return nil, err } @@ -3033,8 +3028,7 @@ func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) Header() func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableinteractiveserialconsolerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableinteractiveserialconsolerequest) if err != nil { return nil, err } @@ -3136,8 +3130,7 @@ func (c *ProjectsLocationsInstancesEnableHyperthreadingCall) Header() http.Heade func (c *ProjectsLocationsInstancesEnableHyperthreadingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablehyperthreadingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablehyperthreadingrequest) if err != nil { return nil, err } @@ -3238,8 +3231,7 @@ func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) Header() func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableinteractiveserialconsolerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableinteractiveserialconsolerequest) if err != nil { return nil, err } @@ -3349,12 +3341,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3477,12 +3468,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3606,12 +3596,11 @@ func (c *ProjectsLocationsInstancesLoadAuthInfoCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:loadAuthInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3715,8 +3704,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3817,8 +3805,7 @@ func (c *ProjectsLocationsInstancesReimageCall) Header() http.Header { func (c *ProjectsLocationsInstancesReimageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reimageinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reimageinstancerequest) if err != nil { return nil, err } @@ -3920,8 +3907,7 @@ func (c *ProjectsLocationsInstancesRenameCall) Header() http.Header { func (c *ProjectsLocationsInstancesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renameinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renameinstancerequest) if err != nil { return nil, err } @@ -4022,8 +4008,7 @@ func (c *ProjectsLocationsInstancesResetCall) Header() http.Header { func (c *ProjectsLocationsInstancesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetinstancerequest) if err != nil { return nil, err } @@ -4123,8 +4108,7 @@ func (c *ProjectsLocationsInstancesStartCall) Header() http.Header { func (c *ProjectsLocationsInstancesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startinstancerequest) if err != nil { return nil, err } @@ -4224,8 +4208,7 @@ func (c *ProjectsLocationsInstancesStopCall) Header() http.Header { func (c *ProjectsLocationsInstancesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopinstancerequest) if err != nil { return nil, err } @@ -4335,12 +4318,11 @@ func (c *ProjectsLocationsNetworksGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4463,12 +4445,11 @@ func (c *ProjectsLocationsNetworksListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/networks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4593,12 +4574,11 @@ func (c *ProjectsLocationsNetworksListNetworkUsageCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+location}/networks:listNetworkUsage") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4702,8 +4682,7 @@ func (c *ProjectsLocationsNetworksPatchCall) Header() http.Header { func (c *ProjectsLocationsNetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network) if err != nil { return nil, err } @@ -4805,8 +4784,7 @@ func (c *ProjectsLocationsNetworksRenameCall) Header() http.Header { func (c *ProjectsLocationsNetworksRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renamenetworkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renamenetworkrequest) if err != nil { return nil, err } @@ -4906,8 +4884,7 @@ func (c *ProjectsLocationsNfsSharesCreateCall) Header() http.Header { func (c *ProjectsLocationsNfsSharesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nfsshare) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nfsshare) if err != nil { return nil, err } @@ -5005,12 +4982,11 @@ func (c *ProjectsLocationsNfsSharesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNfsSharesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5112,12 +5088,11 @@ func (c *ProjectsLocationsNfsSharesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5240,12 +5215,11 @@ func (c *ProjectsLocationsNfsSharesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/nfsShares") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5366,8 +5340,7 @@ func (c *ProjectsLocationsNfsSharesPatchCall) Header() http.Header { func (c *ProjectsLocationsNfsSharesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nfsshare) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nfsshare) if err != nil { return nil, err } @@ -5469,8 +5442,7 @@ func (c *ProjectsLocationsNfsSharesRenameCall) Header() http.Header { func (c *ProjectsLocationsNfsSharesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renamenfssharerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renamenfssharerequest) if err != nil { return nil, err } @@ -5580,12 +5552,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5687,12 +5658,11 @@ func (c *ProjectsLocationsOsImagesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5811,12 +5781,11 @@ func (c *ProjectsLocationsOsImagesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/osImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5937,8 +5906,7 @@ func (c *ProjectsLocationsProvisioningConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsProvisioningConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.provisioningconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.provisioningconfig) if err != nil { return nil, err } @@ -6049,12 +6017,11 @@ func (c *ProjectsLocationsProvisioningConfigsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6162,8 +6129,7 @@ func (c *ProjectsLocationsProvisioningConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsProvisioningConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.provisioningconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.provisioningconfig) if err != nil { return nil, err } @@ -6264,8 +6230,7 @@ func (c *ProjectsLocationsProvisioningConfigsSubmitCall) Header() http.Header { func (c *ProjectsLocationsProvisioningConfigsSubmitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitprovisioningconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.submitprovisioningconfigrequest) if err != nil { return nil, err } @@ -6393,12 +6358,11 @@ func (c *ProjectsLocationsProvisioningQuotasListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/provisioningQuotas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6521,8 +6485,7 @@ func (c *ProjectsLocationsSshKeysCreateCall) Header() http.Header { func (c *ProjectsLocationsSshKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshkey) if err != nil { return nil, err } @@ -6621,12 +6584,11 @@ func (c *ProjectsLocationsSshKeysDeleteCall) Header() http.Header { func (c *ProjectsLocationsSshKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6744,12 +6706,11 @@ func (c *ProjectsLocationsSshKeysListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sshKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6864,8 +6825,7 @@ func (c *ProjectsLocationsVolumesEvictCall) Header() http.Header { func (c *ProjectsLocationsVolumesEvictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evictvolumerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evictvolumerequest) if err != nil { return nil, err } @@ -6975,12 +6935,11 @@ func (c *ProjectsLocationsVolumesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7103,12 +7062,11 @@ func (c *ProjectsLocationsVolumesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/volumes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7232,8 +7190,7 @@ func (c *ProjectsLocationsVolumesPatchCall) Header() http.Header { func (c *ProjectsLocationsVolumesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.volume) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.volume) if err != nil { return nil, err } @@ -7335,8 +7292,7 @@ func (c *ProjectsLocationsVolumesRenameCall) Header() http.Header { func (c *ProjectsLocationsVolumesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renamevolumerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renamevolumerequest) if err != nil { return nil, err } @@ -7436,8 +7392,7 @@ func (c *ProjectsLocationsVolumesResizeCall) Header() http.Header { func (c *ProjectsLocationsVolumesResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resizevolumerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resizevolumerequest) if err != nil { return nil, err } @@ -7537,8 +7492,7 @@ func (c *ProjectsLocationsVolumesLunsEvictCall) Header() http.Header { func (c *ProjectsLocationsVolumesLunsEvictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evictlunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evictlunrequest) if err != nil { return nil, err } @@ -7648,12 +7602,11 @@ func (c *ProjectsLocationsVolumesLunsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7770,12 +7723,11 @@ func (c *ProjectsLocationsVolumesLunsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/luns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7890,8 +7842,7 @@ func (c *ProjectsLocationsVolumesSnapshotsCreateCall) Header() http.Header { func (c *ProjectsLocationsVolumesSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.volumesnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.volumesnapshot) if err != nil { return nil, err } @@ -7990,12 +7941,11 @@ func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) Header() http.Header { func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8098,12 +8048,11 @@ func (c *ProjectsLocationsVolumesSnapshotsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8221,12 +8170,11 @@ func (c *ProjectsLocationsVolumesSnapshotsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8342,8 +8290,7 @@ func (c *ProjectsLocationsVolumesSnapshotsRestoreVolumeSnapshotCall) Header() ht func (c *ProjectsLocationsVolumesSnapshotsRestoreVolumeSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restorevolumesnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restorevolumesnapshotrequest) if err != nil { return nil, err } diff --git a/batch/v1/batch-gen.go b/batch/v1/batch-gen.go index c916f829252..0cd0686616d 100644 --- a/batch/v1/batch-gen.go +++ b/batch/v1/batch-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2588,12 +2587,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2719,12 +2717,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2867,8 +2864,7 @@ func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -2988,12 +2984,11 @@ func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3095,12 +3090,11 @@ func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3227,12 +3221,11 @@ func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3356,12 +3349,11 @@ func (c *ProjectsLocationsJobsTaskGroupsTasksGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3485,12 +3477,11 @@ func (c *ProjectsLocationsJobsTaskGroupsTasksListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3612,8 +3603,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3714,12 +3704,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3823,12 +3812,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3951,12 +3939,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4071,8 +4058,7 @@ func (c *ProjectsLocationsStateReportCall) Header() http.Header { func (c *ProjectsLocationsStateReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportagentstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportagentstaterequest) if err != nil { return nil, err } diff --git a/beyondcorp/v1/beyondcorp-gen.go b/beyondcorp/v1/beyondcorp-gen.go index 0939de82e77..852dcf1f392 100644 --- a/beyondcorp/v1/beyondcorp-gen.go +++ b/beyondcorp/v1/beyondcorp-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2752,12 +2751,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsGetIamPolicyCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2854,8 +2852,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsSetIamPolicyCall) Header() ht func (c *OrganizationsLocationsGlobalPartnerTenantsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -2963,8 +2960,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsTestIamPermissionsCall) Heade func (c *OrganizationsLocationsGlobalPartnerTenantsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -3095,12 +3091,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesGetIamPolicyCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3197,8 +3192,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesSetIamPolicyCa func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -3306,8 +3300,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesTestIamPermiss func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -3438,12 +3431,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsGetIamPolicyCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3540,8 +3532,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsSetIamPolicyCall) func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -3649,8 +3640,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsTestIamPermission func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -3759,8 +3749,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -3861,12 +3850,11 @@ func (c *OrganizationsLocationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3970,12 +3958,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4099,12 +4086,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4228,12 +4214,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4360,12 +4345,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4512,8 +4496,7 @@ func (c *ProjectsLocationsAppConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectionsv1appconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectionsv1appconnection) if err != nil { return nil, err } @@ -4638,12 +4621,11 @@ func (c *ProjectsLocationsAppConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4748,12 +4730,11 @@ func (c *ProjectsLocationsAppConnectionsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4876,12 +4857,11 @@ func (c *ProjectsLocationsAppConnectionsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5018,12 +4998,11 @@ func (c *ProjectsLocationsAppConnectionsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/appConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5179,8 +5158,7 @@ func (c *ProjectsLocationsAppConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectionsv1appconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectionsv1appconnection) if err != nil { return nil, err } @@ -5320,12 +5298,11 @@ func (c *ProjectsLocationsAppConnectionsResolveCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/appConnections:resolve") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5443,8 +5420,7 @@ func (c *ProjectsLocationsAppConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -5552,8 +5528,7 @@ func (c *ProjectsLocationsAppConnectionsTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsAppConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -5687,8 +5662,7 @@ func (c *ProjectsLocationsAppConnectorsCreateCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectorsv1appconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectorsv1appconnector) if err != nil { return nil, err } @@ -5813,12 +5787,11 @@ func (c *ProjectsLocationsAppConnectorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5923,12 +5896,11 @@ func (c *ProjectsLocationsAppConnectorsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6051,12 +6023,11 @@ func (c *ProjectsLocationsAppConnectorsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6193,12 +6164,11 @@ func (c *ProjectsLocationsAppConnectorsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/appConnectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6346,8 +6316,7 @@ func (c *ProjectsLocationsAppConnectorsPatchCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectorsv1appconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectorsv1appconnector) if err != nil { return nil, err } @@ -6449,8 +6418,7 @@ func (c *ProjectsLocationsAppConnectorsReportStatusCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsReportStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectorsv1reportstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectorsv1reportstatusrequest) if err != nil { return nil, err } @@ -6564,12 +6532,11 @@ func (c *ProjectsLocationsAppConnectorsResolveInstanceConfigCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+appConnector}:resolveInstanceConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6666,8 +6633,7 @@ func (c *ProjectsLocationsAppConnectorsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -6775,8 +6741,7 @@ func (c *ProjectsLocationsAppConnectorsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsAppConnectorsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -6910,8 +6875,7 @@ func (c *ProjectsLocationsAppGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsAppGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appgateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appgateway) if err != nil { return nil, err } @@ -7036,12 +7000,11 @@ func (c *ProjectsLocationsAppGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7146,12 +7109,11 @@ func (c *ProjectsLocationsAppGatewaysGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7273,12 +7235,11 @@ func (c *ProjectsLocationsAppGatewaysGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7415,12 +7376,11 @@ func (c *ProjectsLocationsAppGatewaysListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/appGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7538,8 +7498,7 @@ func (c *ProjectsLocationsAppGatewaysSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAppGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -7664,12 +7623,11 @@ func (c *ProjectsLocationsAppGatewaysShouldThrottleCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:shouldThrottle") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7769,8 +7727,7 @@ func (c *ProjectsLocationsAppGatewaysTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsAppGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -7901,12 +7858,11 @@ func (c *ProjectsLocationsClientConnectorServicesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8003,8 +7959,7 @@ func (c *ProjectsLocationsClientConnectorServicesSetIamPolicyCall) Header() http func (c *ProjectsLocationsClientConnectorServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -8112,8 +8067,7 @@ func (c *ProjectsLocationsClientConnectorServicesTestIamPermissionsCall) Header( func (c *ProjectsLocationsClientConnectorServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -8244,12 +8198,11 @@ func (c *ProjectsLocationsClientGatewaysGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8346,8 +8299,7 @@ func (c *ProjectsLocationsClientGatewaysSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsClientGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -8455,8 +8407,7 @@ func (c *ProjectsLocationsClientGatewaysTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsClientGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -8577,8 +8528,7 @@ func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsCreateCall) Header() func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1application) if err != nil { return nil, err } @@ -8702,8 +8652,7 @@ func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsPatchCall) Header() func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1application) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1application) if err != nil { return nil, err } @@ -8811,8 +8760,7 @@ func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsTestIamPermissionsCa func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -8921,8 +8869,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -9023,12 +8970,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9132,12 +9078,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9261,12 +9206,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9400,8 +9344,7 @@ func (c *ProjectsLocationsSecurityGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsSecurityGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1securitygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1securitygateway) if err != nil { return nil, err } @@ -9526,12 +9469,11 @@ func (c *ProjectsLocationsSecurityGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsSecurityGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9636,12 +9578,11 @@ func (c *ProjectsLocationsSecurityGatewaysGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9766,12 +9707,11 @@ func (c *ProjectsLocationsSecurityGatewaysGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9911,12 +9851,11 @@ func (c *ProjectsLocationsSecurityGatewaysListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10053,8 +9992,7 @@ func (c *ProjectsLocationsSecurityGatewaysPatchCall) Header() http.Header { func (c *ProjectsLocationsSecurityGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1securitygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1securitygateway) if err != nil { return nil, err } @@ -10159,8 +10097,7 @@ func (c *ProjectsLocationsSecurityGatewaysSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsSecurityGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -10268,8 +10205,7 @@ func (c *ProjectsLocationsSecurityGatewaysTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsSecurityGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -10392,12 +10328,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsDeleteCall) Header() http. func (c *ProjectsLocationsSecurityGatewaysApplicationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10502,12 +10437,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10630,12 +10564,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsGetIamPolicyCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10776,12 +10709,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/applications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10899,8 +10831,7 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsSetIamPolicyCall) Header() func (c *ProjectsLocationsSecurityGatewaysApplicationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } diff --git a/beyondcorp/v1alpha/beyondcorp-gen.go b/beyondcorp/v1alpha/beyondcorp-gen.go index 1a8c60fcef8..87f9072d979 100644 --- a/beyondcorp/v1alpha/beyondcorp-gen.go +++ b/beyondcorp/v1alpha/beyondcorp-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4210,8 +4209,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsCreateCall) Header() http.Hea func (c *OrganizationsLocationsGlobalPartnerTenantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorppartnerservicesv1alphapartnertenant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorppartnerservicesv1alphapartnertenant) if err != nil { return nil, err } @@ -4326,12 +4324,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsDeleteCall) Header() http.Hea func (c *OrganizationsLocationsGlobalPartnerTenantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4436,12 +4433,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4564,12 +4560,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsGetIamPolicyCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4714,12 +4709,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/partnerTenants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4862,8 +4856,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsPatchCall) Header() http.Head func (c *OrganizationsLocationsGlobalPartnerTenantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorppartnerservicesv1alphapartnertenant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorppartnerservicesv1alphapartnertenant) if err != nil { return nil, err } @@ -4968,8 +4961,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsSetIamPolicyCall) Header() ht func (c *OrganizationsLocationsGlobalPartnerTenantsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -5077,8 +5069,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsTestIamPermissionsCall) Heade func (c *OrganizationsLocationsGlobalPartnerTenantsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -5198,8 +5189,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesCreateCall) He func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorppartnerservicesv1alphabrowserdlprule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorppartnerservicesv1alphabrowserdlprule) if err != nil { return nil, err } @@ -5316,12 +5306,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesDeleteCall) He func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5426,12 +5415,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5554,12 +5542,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesGetIamPolicyCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5665,12 +5652,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesListCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/browserDlpRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5788,8 +5774,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesPatchCall) Hea func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorppartnerservicesv1alphabrowserdlprule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorppartnerservicesv1alphabrowserdlprule) if err != nil { return nil, err } @@ -5894,8 +5879,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesSetIamPolicyCa func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -6003,8 +5987,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesTestIamPermiss func (c *OrganizationsLocationsGlobalPartnerTenantsBrowserDlpRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -6125,8 +6108,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsCreateCall) Heade func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorppartnerservicesv1alphaproxyconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorppartnerservicesv1alphaproxyconfig) if err != nil { return nil, err } @@ -6241,12 +6223,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsDeleteCall) Heade func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6351,12 +6332,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6481,12 +6461,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsGetIamPolicyCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6633,12 +6612,11 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/proxyConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6776,8 +6754,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsPatchCall) Header func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorppartnerservicesv1alphaproxyconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorppartnerservicesv1alphaproxyconfig) if err != nil { return nil, err } @@ -6882,8 +6859,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsSetIamPolicyCall) func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -6991,8 +6967,7 @@ func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsTestIamPermission func (c *OrganizationsLocationsGlobalPartnerTenantsProxyConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -7203,12 +7178,11 @@ func (c *OrganizationsLocationsInsightsConfiguredInsightCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+insight}:configuredInsight") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7360,12 +7334,11 @@ func (c *OrganizationsLocationsInsightsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7562,12 +7535,11 @@ func (c *OrganizationsLocationsInsightsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7689,8 +7661,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -7791,12 +7762,11 @@ func (c *OrganizationsLocationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7900,12 +7870,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8029,12 +7998,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8177,12 +8145,11 @@ func (c *OrganizationsLocationsSubscriptionsCancelCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8278,8 +8245,7 @@ func (c *OrganizationsLocationsSubscriptionsCreateCall) Header() http.Header { func (c *OrganizationsLocationsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsaasplatformsubscriptionsv1alphasubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsaasplatformsubscriptionsv1alphasubscription) if err != nil { return nil, err } @@ -8392,12 +8358,11 @@ func (c *OrganizationsLocationsSubscriptionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8518,12 +8483,11 @@ func (c *OrganizationsLocationsSubscriptionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8666,8 +8630,7 @@ func (c *OrganizationsLocationsSubscriptionsPatchCall) Header() http.Header { func (c *OrganizationsLocationsSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsaasplatformsubscriptionsv1alphasubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsaasplatformsubscriptionsv1alphasubscription) if err != nil { return nil, err } @@ -8797,12 +8760,11 @@ func (c *OrganizationsLocationsSubscriptionsRestartCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:restart") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8905,12 +8867,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9037,12 +8998,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9189,8 +9149,7 @@ func (c *ProjectsLocationsAppConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectionsv1alphaappconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectionsv1alphaappconnection) if err != nil { return nil, err } @@ -9315,12 +9274,11 @@ func (c *ProjectsLocationsAppConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9425,12 +9383,11 @@ func (c *ProjectsLocationsAppConnectionsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9553,12 +9510,11 @@ func (c *ProjectsLocationsAppConnectionsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9695,12 +9651,11 @@ func (c *ProjectsLocationsAppConnectionsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/appConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9856,8 +9811,7 @@ func (c *ProjectsLocationsAppConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectionsv1alphaappconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectionsv1alphaappconnection) if err != nil { return nil, err } @@ -9997,12 +9951,11 @@ func (c *ProjectsLocationsAppConnectionsResolveCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/appConnections:resolve") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10120,8 +10073,7 @@ func (c *ProjectsLocationsAppConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAppConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -10229,8 +10181,7 @@ func (c *ProjectsLocationsAppConnectionsTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsAppConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -10364,8 +10315,7 @@ func (c *ProjectsLocationsAppConnectorsCreateCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectorsv1alphaappconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectorsv1alphaappconnector) if err != nil { return nil, err } @@ -10490,12 +10440,11 @@ func (c *ProjectsLocationsAppConnectorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10600,12 +10549,11 @@ func (c *ProjectsLocationsAppConnectorsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10728,12 +10676,11 @@ func (c *ProjectsLocationsAppConnectorsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10870,12 +10817,11 @@ func (c *ProjectsLocationsAppConnectorsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/appConnectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11023,8 +10969,7 @@ func (c *ProjectsLocationsAppConnectorsPatchCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectorsv1alphaappconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectorsv1alphaappconnector) if err != nil { return nil, err } @@ -11126,8 +11071,7 @@ func (c *ProjectsLocationsAppConnectorsReportStatusCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsReportStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpappconnectorsv1alphareportstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpappconnectorsv1alphareportstatusrequest) if err != nil { return nil, err } @@ -11241,12 +11185,11 @@ func (c *ProjectsLocationsAppConnectorsResolveInstanceConfigCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+appConnector}:resolveInstanceConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11343,8 +11286,7 @@ func (c *ProjectsLocationsAppConnectorsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAppConnectorsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -11452,8 +11394,7 @@ func (c *ProjectsLocationsAppConnectorsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsAppConnectorsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -11587,8 +11528,7 @@ func (c *ProjectsLocationsAppGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsAppGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appgateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appgateway) if err != nil { return nil, err } @@ -11713,12 +11653,11 @@ func (c *ProjectsLocationsAppGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsAppGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11823,12 +11762,11 @@ func (c *ProjectsLocationsAppGatewaysGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11950,12 +11888,11 @@ func (c *ProjectsLocationsAppGatewaysGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12092,12 +12029,11 @@ func (c *ProjectsLocationsAppGatewaysListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/appGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12215,8 +12151,7 @@ func (c *ProjectsLocationsAppGatewaysSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAppGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -12341,12 +12276,11 @@ func (c *ProjectsLocationsAppGatewaysShouldThrottleCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:shouldThrottle") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12446,8 +12380,7 @@ func (c *ProjectsLocationsAppGatewaysTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsAppGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -12578,12 +12511,11 @@ func (c *ProjectsLocationsApplicationDomainsGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12680,8 +12612,7 @@ func (c *ProjectsLocationsApplicationDomainsSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsApplicationDomainsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -12789,8 +12720,7 @@ func (c *ProjectsLocationsApplicationDomainsTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsApplicationDomainsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -12921,12 +12851,11 @@ func (c *ProjectsLocationsApplicationsGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13023,8 +12952,7 @@ func (c *ProjectsLocationsApplicationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsApplicationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -13132,8 +13060,7 @@ func (c *ProjectsLocationsApplicationsTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsApplicationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -13264,12 +13191,11 @@ func (c *ProjectsLocationsClientConnectorServicesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13366,8 +13292,7 @@ func (c *ProjectsLocationsClientConnectorServicesSetIamPolicyCall) Header() http func (c *ProjectsLocationsClientConnectorServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -13475,8 +13400,7 @@ func (c *ProjectsLocationsClientConnectorServicesTestIamPermissionsCall) Header( func (c *ProjectsLocationsClientConnectorServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -13607,12 +13531,11 @@ func (c *ProjectsLocationsClientGatewaysGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13709,8 +13632,7 @@ func (c *ProjectsLocationsClientGatewaysSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsClientGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -13818,8 +13740,7 @@ func (c *ProjectsLocationsClientGatewaysTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsClientGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -13953,8 +13874,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -14078,12 +13998,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14187,12 +14106,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14314,12 +14232,11 @@ func (c *ProjectsLocationsConnectionsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14456,12 +14373,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14617,8 +14533,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -14757,12 +14672,11 @@ func (c *ProjectsLocationsConnectionsResolveCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/connections:resolve") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14880,8 +14794,7 @@ func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -14989,8 +14902,7 @@ func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -15124,8 +15036,7 @@ func (c *ProjectsLocationsConnectorsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connector) if err != nil { return nil, err } @@ -15249,12 +15160,11 @@ func (c *ProjectsLocationsConnectorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15358,12 +15268,11 @@ func (c *ProjectsLocationsConnectorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15485,12 +15394,11 @@ func (c *ProjectsLocationsConnectorsGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15627,12 +15535,11 @@ func (c *ProjectsLocationsConnectorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/connectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15780,8 +15687,7 @@ func (c *ProjectsLocationsConnectorsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connector) if err != nil { return nil, err } @@ -15883,8 +15789,7 @@ func (c *ProjectsLocationsConnectorsReportStatusCall) Header() http.Header { func (c *ProjectsLocationsConnectorsReportStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportstatusrequest) if err != nil { return nil, err } @@ -15997,12 +15902,11 @@ func (c *ProjectsLocationsConnectorsResolveInstanceConfigCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+connector}:resolveInstanceConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16099,8 +16003,7 @@ func (c *ProjectsLocationsConnectorsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectorsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -16208,8 +16111,7 @@ func (c *ProjectsLocationsConnectorsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsConnectorsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -16330,8 +16232,7 @@ func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsCreateCall) Header() func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1alphaapplication) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1alphaapplication) if err != nil { return nil, err } @@ -16455,8 +16356,7 @@ func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsPatchCall) Header() func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1alphaapplication) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1alphaapplication) if err != nil { return nil, err } @@ -16564,8 +16464,7 @@ func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsTestIamPermissionsCa func (c *ProjectsLocationsGlobalSecurityGatewaysApplicationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -16776,12 +16675,11 @@ func (c *ProjectsLocationsInsightsConfiguredInsightCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+insight}:configuredInsight") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16933,12 +16831,11 @@ func (c *ProjectsLocationsInsightsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17135,12 +17032,11 @@ func (c *ProjectsLocationsInsightsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17262,8 +17158,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -17364,12 +17259,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17473,12 +17367,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17602,12 +17495,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17741,8 +17633,7 @@ func (c *ProjectsLocationsSecurityGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsSecurityGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1alphasecuritygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1alphasecuritygateway) if err != nil { return nil, err } @@ -17867,12 +17758,11 @@ func (c *ProjectsLocationsSecurityGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsSecurityGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17977,12 +17867,11 @@ func (c *ProjectsLocationsSecurityGatewaysGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18105,12 +17994,11 @@ func (c *ProjectsLocationsSecurityGatewaysGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18250,12 +18138,11 @@ func (c *ProjectsLocationsSecurityGatewaysListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/securityGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18392,8 +18279,7 @@ func (c *ProjectsLocationsSecurityGatewaysPatchCall) Header() http.Header { func (c *ProjectsLocationsSecurityGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbeyondcorpsecuritygatewaysv1alphasecuritygateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbeyondcorpsecuritygatewaysv1alphasecuritygateway) if err != nil { return nil, err } @@ -18498,8 +18384,7 @@ func (c *ProjectsLocationsSecurityGatewaysSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsSecurityGatewaysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -18607,8 +18492,7 @@ func (c *ProjectsLocationsSecurityGatewaysTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsSecurityGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -18731,12 +18615,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsDeleteCall) Header() http. func (c *ProjectsLocationsSecurityGatewaysApplicationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18841,12 +18724,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18969,12 +18851,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsGetIamPolicyCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19115,12 +18996,11 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/applications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19238,8 +19118,7 @@ func (c *ProjectsLocationsSecurityGatewaysApplicationsSetIamPolicyCall) Header() func (c *ProjectsLocationsSecurityGatewaysApplicationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } diff --git a/biglake/v1/biglake-gen.go b/biglake/v1/biglake-gen.go index 870c987b220..f6edb1b18a9 100644 --- a/biglake/v1/biglake-gen.go +++ b/biglake/v1/biglake-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -619,8 +618,7 @@ func (c *ProjectsLocationsCatalogsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.catalog) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.catalog) if err != nil { return nil, err } @@ -720,12 +718,11 @@ func (c *ProjectsLocationsCatalogsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -829,12 +826,11 @@ func (c *ProjectsLocationsCatalogsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -955,12 +951,11 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/catalogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1084,8 +1079,7 @@ func (c *ProjectsLocationsCatalogsDatabasesCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsDatabasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database) if err != nil { return nil, err } @@ -1185,12 +1179,11 @@ func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1294,12 +1287,11 @@ func (c *ProjectsLocationsCatalogsDatabasesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1421,12 +1413,11 @@ func (c *ProjectsLocationsCatalogsDatabasesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1551,8 +1542,7 @@ func (c *ProjectsLocationsCatalogsDatabasesPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsDatabasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database) if err != nil { return nil, err } @@ -1662,8 +1652,7 @@ func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) Header() http.Heade func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table) if err != nil { return nil, err } @@ -1763,12 +1752,11 @@ func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) Header() http.Heade func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1872,12 +1860,11 @@ func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2014,12 +2001,11 @@ func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2144,8 +2130,7 @@ func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) Header() http.Header func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table) if err != nil { return nil, err } @@ -2248,8 +2233,7 @@ func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) Header() http.Heade func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renametablerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renametablerequest) if err != nil { return nil, err } diff --git a/bigquery/v2/bigquery-gen.go b/bigquery/v2/bigquery-gen.go index be5e1b7f40b..ae8f186406a 100644 --- a/bigquery/v2/bigquery-gen.go +++ b/bigquery/v2/bigquery-gen.go @@ -150,7 +150,15 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Datasets = NewDatasetsService(s) + s.Jobs = NewJobsService(s) + s.Models = NewModelsService(s) + s.Projects = NewProjectsService(s) + s.Routines = NewRoutinesService(s) + s.RowAccessPolicies = NewRowAccessPoliciesService(s) + s.Tabledata = NewTabledataService(s) + s.Tables = NewTablesService(s) if err != nil { return nil, err } @@ -169,16 +177,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Datasets = NewDatasetsService(s) - s.Jobs = NewJobsService(s) - s.Models = NewModelsService(s) - s.Projects = NewProjectsService(s) - s.Routines = NewRoutinesService(s) - s.RowAccessPolicies = NewRowAccessPoliciesService(s) - s.Tabledata = NewTabledataService(s) - s.Tables = NewTablesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -10427,12 +10426,11 @@ func (c *DatasetsDeleteCall) Header() http.Header { func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10555,12 +10553,11 @@ func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10670,8 +10667,7 @@ func (c *DatasetsInsertCall) Header() http.Header { func (c *DatasetsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -10816,12 +10812,11 @@ func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10960,8 +10955,7 @@ func (c *DatasetsPatchCall) Header() http.Header { func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -11067,8 +11061,7 @@ func (c *DatasetsUndeleteCall) Header() http.Header { func (c *DatasetsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletedatasetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletedatasetrequest) if err != nil { return nil, err } @@ -11194,8 +11187,7 @@ func (c *DatasetsUpdateCall) Header() http.Header { func (c *DatasetsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -11310,12 +11302,11 @@ func (c *JobsCancelCall) Header() http.Header { func (c *JobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/jobs/{+jobId}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11422,12 +11413,11 @@ func (c *JobsDeleteCall) Header() http.Header { func (c *JobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/jobs/{+jobId}/delete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11523,12 +11513,11 @@ func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/jobs/{+jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11690,12 +11679,11 @@ func (c *JobsGetQueryResultsCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/queries/{+jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11855,8 +11843,7 @@ func (c *JobsInsertCall) Header() http.Header { func (c *JobsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -11867,14 +11854,10 @@ func (c *JobsInsertCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/bigquery/v2/projects/{+projectId}/jobs") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -12067,12 +12050,11 @@ func (c *JobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12186,8 +12168,7 @@ func (c *JobsQueryCall) Header() http.Header { func (c *JobsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryrequest) if err != nil { return nil, err } @@ -12291,12 +12272,11 @@ func (c *ModelsDeleteCall) Header() http.Header { func (c *ModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12383,12 +12363,11 @@ func (c *ModelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12512,12 +12491,11 @@ func (c *ModelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12638,8 +12616,7 @@ func (c *ModelsPatchCall) Header() http.Header { func (c *ModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.model) if err != nil { return nil, err } @@ -12752,12 +12729,11 @@ func (c *ProjectsGetServiceAccountCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/serviceAccount") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12876,12 +12852,11 @@ func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12995,12 +12970,11 @@ func (c *RoutinesDeleteCall) Header() http.Header { func (c *RoutinesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13095,12 +13069,11 @@ func (c *RoutinesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13197,8 +13170,7 @@ func (c *RoutinesGetIamPolicyCall) Header() http.Header { func (c *RoutinesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -13301,8 +13273,7 @@ func (c *RoutinesInsertCall) Header() http.Header { func (c *RoutinesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.routine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.routine) if err != nil { return nil, err } @@ -13451,12 +13422,11 @@ func (c *RoutinesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13575,8 +13545,7 @@ func (c *RoutinesSetIamPolicyCall) Header() http.Header { func (c *RoutinesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13683,8 +13652,7 @@ func (c *RoutinesUpdateCall) Header() http.Header { func (c *RoutinesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.routine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.routine) if err != nil { return nil, err } @@ -13789,8 +13757,7 @@ func (c *RowAccessPoliciesGetIamPolicyCall) Header() http.Header { func (c *RowAccessPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -13921,12 +13888,11 @@ func (c *RowAccessPoliciesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/tables/{+tableId}/rowAccessPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14049,8 +14015,7 @@ func (c *RowAccessPoliciesTestIamPermissionsCall) Header() http.Header { func (c *RowAccessPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -14158,8 +14123,7 @@ func (c *TabledataInsertAllCall) Header() http.Header { func (c *TabledataInsertAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tabledatainsertallrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tabledatainsertallrequest) if err != nil { return nil, err } @@ -14315,12 +14279,11 @@ func (c *TabledataListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/tables/{+tableId}/data") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14440,12 +14403,11 @@ func (c *TablesDeleteCall) Header() http.Header { func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/tables/{+tableId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14575,12 +14537,11 @@ func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/tables/{+tableId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14677,8 +14638,7 @@ func (c *TablesGetIamPolicyCall) Header() http.Header { func (c *TablesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -14781,8 +14741,7 @@ func (c *TablesInsertCall) Header() http.Header { func (c *TablesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table) if err != nil { return nil, err } @@ -14912,12 +14871,11 @@ func (c *TablesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/tables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15047,8 +15005,7 @@ func (c *TablesPatchCall) Header() http.Header { func (c *TablesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table) if err != nil { return nil, err } @@ -15154,8 +15111,7 @@ func (c *TablesSetIamPolicyCall) Header() http.Header { func (c *TablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -15262,8 +15218,7 @@ func (c *TablesTestIamPermissionsCall) Header() http.Header { func (c *TablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -15379,8 +15334,7 @@ func (c *TablesUpdateCall) Header() http.Header { func (c *TablesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table) if err != nil { return nil, err } diff --git a/bigqueryconnection/v1/bigqueryconnection-gen.go b/bigqueryconnection/v1/bigqueryconnection-gen.go index e9246c939c0..7a8585d6dff 100644 --- a/bigqueryconnection/v1/bigqueryconnection-gen.go +++ b/bigqueryconnection/v1/bigqueryconnection-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1352,8 +1351,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -1452,12 +1450,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1560,12 +1557,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1660,8 +1656,7 @@ func (c *ProjectsLocationsConnectionsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1784,12 +1779,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1912,8 +1906,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -2017,8 +2010,7 @@ func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2125,8 +2117,7 @@ func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/bigqueryconnection/v1beta1/bigqueryconnection-gen.go b/bigqueryconnection/v1beta1/bigqueryconnection-gen.go index 8bffbc91355..67c3e98182c 100644 --- a/bigqueryconnection/v1beta1/bigqueryconnection-gen.go +++ b/bigqueryconnection/v1beta1/bigqueryconnection-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -860,8 +859,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -960,12 +958,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1068,12 +1065,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1168,8 +1164,7 @@ func (c *ProjectsLocationsConnectionsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1293,12 +1288,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1421,8 +1415,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -1526,8 +1519,7 @@ func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -1634,8 +1626,7 @@ func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -1738,8 +1729,7 @@ func (c *ProjectsLocationsConnectionsUpdateCredentialCall) Header() http.Header func (c *ProjectsLocationsConnectionsUpdateCredentialCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectioncredential) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectioncredential) if err != nil { return nil, err } diff --git a/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go b/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go index 5a447f57b71..99657fca854 100644 --- a/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go +++ b/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -858,8 +857,7 @@ func (c *ProjectsLocationsDataPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsDataPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datapolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datapolicy) if err != nil { return nil, err } @@ -966,12 +964,11 @@ func (c *ProjectsLocationsDataPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1075,12 +1072,11 @@ func (c *ProjectsLocationsDataPoliciesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1174,8 +1170,7 @@ func (c *ProjectsLocationsDataPoliciesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1314,12 +1309,11 @@ func (c *ProjectsLocationsDataPoliciesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1454,8 +1448,7 @@ func (c *ProjectsLocationsDataPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsDataPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datapolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datapolicy) if err != nil { return nil, err } @@ -1557,8 +1550,7 @@ func (c *ProjectsLocationsDataPoliciesRenameCall) Header() http.Header { func (c *ProjectsLocationsDataPoliciesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renamedatapolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renamedatapolicyrequest) if err != nil { return nil, err } @@ -1660,8 +1652,7 @@ func (c *ProjectsLocationsDataPoliciesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -1765,8 +1756,7 @@ func (c *ProjectsLocationsDataPoliciesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsDataPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/bigquerydatatransfer/v1/bigquerydatatransfer-gen.go b/bigquerydatatransfer/v1/bigquerydatatransfer-gen.go index adf9fe08078..ca6c2a9343f 100644 --- a/bigquerydatatransfer/v1/bigquerydatatransfer-gen.go +++ b/bigquerydatatransfer/v1/bigquerydatatransfer-gen.go @@ -130,7 +130,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -149,9 +150,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1408,8 +1407,7 @@ func (c *ProjectsEnrollDataSourcesCall) Header() http.Header { func (c *ProjectsEnrollDataSourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrolldatasourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrolldatasourcesrequest) if err != nil { return nil, err } @@ -1513,8 +1511,7 @@ func (c *ProjectsDataSourcesCheckValidCredsCall) Header() http.Header { func (c *ProjectsDataSourcesCheckValidCredsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkvalidcredsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkvalidcredsrequest) if err != nil { return nil, err } @@ -1628,12 +1625,11 @@ func (c *ProjectsDataSourcesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1754,12 +1750,11 @@ func (c *ProjectsDataSourcesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1880,8 +1875,7 @@ func (c *ProjectsLocationsEnrollDataSourcesCall) Header() http.Header { func (c *ProjectsLocationsEnrollDataSourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrolldatasourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrolldatasourcesrequest) if err != nil { return nil, err } @@ -1991,12 +1985,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2122,12 +2115,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2246,8 +2238,7 @@ func (c *ProjectsLocationsUnenrollDataSourcesCall) Header() http.Header { func (c *ProjectsLocationsUnenrollDataSourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unenrolldatasourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unenrolldatasourcesrequest) if err != nil { return nil, err } @@ -2351,8 +2342,7 @@ func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) Header() http.Header { func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkvalidcredsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkvalidcredsrequest) if err != nil { return nil, err } @@ -2466,12 +2456,11 @@ func (c *ProjectsLocationsDataSourcesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2592,12 +2581,11 @@ func (c *ProjectsLocationsDataSourcesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2762,8 +2750,7 @@ func (c *ProjectsLocationsTransferConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsTransferConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferconfig) if err != nil { return nil, err } @@ -2864,12 +2851,11 @@ func (c *ProjectsLocationsTransferConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTransferConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2973,12 +2959,11 @@ func (c *ProjectsLocationsTransferConfigsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3107,12 +3092,11 @@ func (c *ProjectsLocationsTransferConfigsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3286,8 +3270,7 @@ func (c *ProjectsLocationsTransferConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsTransferConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferconfig) if err != nil { return nil, err } @@ -3393,8 +3376,7 @@ func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) Header() http.Header func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduletransferrunsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scheduletransferrunsrequest) if err != nil { return nil, err } @@ -3501,8 +3483,7 @@ func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) Header() http.Head func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmanualtransferrunsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmanualtransferrunsrequest) if err != nil { return nil, err } @@ -3604,12 +3585,11 @@ func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3714,12 +3694,11 @@ func (c *ProjectsLocationsTransferConfigsRunsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3873,12 +3852,11 @@ func (c *ProjectsLocationsTransferConfigsRunsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4036,12 +4014,11 @@ func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferLogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4206,8 +4183,7 @@ func (c *ProjectsTransferConfigsCreateCall) Header() http.Header { func (c *ProjectsTransferConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferconfig) if err != nil { return nil, err } @@ -4308,12 +4284,11 @@ func (c *ProjectsTransferConfigsDeleteCall) Header() http.Header { func (c *ProjectsTransferConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4417,12 +4392,11 @@ func (c *ProjectsTransferConfigsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4551,12 +4525,11 @@ func (c *ProjectsTransferConfigsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4730,8 +4703,7 @@ func (c *ProjectsTransferConfigsPatchCall) Header() http.Header { func (c *ProjectsTransferConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferconfig) if err != nil { return nil, err } @@ -4837,8 +4809,7 @@ func (c *ProjectsTransferConfigsScheduleRunsCall) Header() http.Header { func (c *ProjectsTransferConfigsScheduleRunsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduletransferrunsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scheduletransferrunsrequest) if err != nil { return nil, err } @@ -4945,8 +4916,7 @@ func (c *ProjectsTransferConfigsStartManualRunsCall) Header() http.Header { func (c *ProjectsTransferConfigsStartManualRunsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmanualtransferrunsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmanualtransferrunsrequest) if err != nil { return nil, err } @@ -5048,12 +5018,11 @@ func (c *ProjectsTransferConfigsRunsDeleteCall) Header() http.Header { func (c *ProjectsTransferConfigsRunsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5158,12 +5127,11 @@ func (c *ProjectsTransferConfigsRunsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5317,12 +5285,11 @@ func (c *ProjectsTransferConfigsRunsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5480,12 +5447,11 @@ func (c *ProjectsTransferConfigsRunsTransferLogsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferLogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/bigqueryreservation/v1/bigqueryreservation-gen.go b/bigqueryreservation/v1/bigqueryreservation-gen.go index 1d578649d8c..8ea8c84af32 100644 --- a/bigqueryreservation/v1/bigqueryreservation-gen.go +++ b/bigqueryreservation/v1/bigqueryreservation-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -984,12 +983,11 @@ func (c *ProjectsLocationsGetBiReservationCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1125,12 +1123,11 @@ func (c *ProjectsLocationsSearchAllAssignmentsCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:searchAllAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1289,12 +1286,11 @@ func (c *ProjectsLocationsSearchAssignmentsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:searchAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1421,8 +1417,7 @@ func (c *ProjectsLocationsUpdateBiReservationCall) Header() http.Header { func (c *ProjectsLocationsUpdateBiReservationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bireservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bireservation) if err != nil { return nil, err } @@ -1542,8 +1537,7 @@ func (c *ProjectsLocationsCapacityCommitmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsCapacityCommitmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.capacitycommitment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.capacitycommitment) if err != nil { return nil, err } @@ -1653,12 +1647,11 @@ func (c *ProjectsLocationsCapacityCommitmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCapacityCommitmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1761,12 +1754,11 @@ func (c *ProjectsLocationsCapacityCommitmentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1884,12 +1876,11 @@ func (c *ProjectsLocationsCapacityCommitmentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/capacityCommitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2008,8 +1999,7 @@ func (c *ProjectsLocationsCapacityCommitmentsMergeCall) Header() http.Header { func (c *ProjectsLocationsCapacityCommitmentsMergeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mergecapacitycommitmentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mergecapacitycommitmentsrequest) if err != nil { return nil, err } @@ -2125,8 +2115,7 @@ func (c *ProjectsLocationsCapacityCommitmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsCapacityCommitmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.capacitycommitment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.capacitycommitment) if err != nil { return nil, err } @@ -2232,8 +2221,7 @@ func (c *ProjectsLocationsCapacityCommitmentsSplitCall) Header() http.Header { func (c *ProjectsLocationsCapacityCommitmentsSplitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.splitcapacitycommitmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.splitcapacitycommitmentrequest) if err != nil { return nil, err } @@ -2343,8 +2331,7 @@ func (c *ProjectsLocationsReservationsCreateCall) Header() http.Header { func (c *ProjectsLocationsReservationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -2444,12 +2431,11 @@ func (c *ProjectsLocationsReservationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2546,8 +2532,7 @@ func (c *ProjectsLocationsReservationsFailoverReservationCall) Header() http.Hea func (c *ProjectsLocationsReservationsFailoverReservationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverreservationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.failoverreservationrequest) if err != nil { return nil, err } @@ -2658,12 +2643,11 @@ func (c *ProjectsLocationsReservationsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2780,12 +2764,11 @@ func (c *ProjectsLocationsReservationsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2910,8 +2893,7 @@ func (c *ProjectsLocationsReservationsPatchCall) Header() http.Header { func (c *ProjectsLocationsReservationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -3041,8 +3023,7 @@ func (c *ProjectsLocationsReservationsAssignmentsCreateCall) Header() http.Heade func (c *ProjectsLocationsReservationsAssignmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignment) if err != nil { return nil, err } @@ -3148,12 +3129,11 @@ func (c *ProjectsLocationsReservationsAssignmentsDeleteCall) Header() http.Heade func (c *ProjectsLocationsReservationsAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3280,12 +3260,11 @@ func (c *ProjectsLocationsReservationsAssignmentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3403,8 +3382,7 @@ func (c *ProjectsLocationsReservationsAssignmentsMoveCall) Header() http.Header func (c *ProjectsLocationsReservationsAssignmentsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moveassignmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moveassignmentrequest) if err != nil { return nil, err } @@ -3515,8 +3493,7 @@ func (c *ProjectsLocationsReservationsAssignmentsPatchCall) Header() http.Header func (c *ProjectsLocationsReservationsAssignmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignment) if err != nil { return nil, err } diff --git a/bigtableadmin/v2/bigtableadmin-gen.go b/bigtableadmin/v2/bigtableadmin-gen.go index 96aa8ea394e..1012077e6b3 100644 --- a/bigtableadmin/v2/bigtableadmin-gen.go +++ b/bigtableadmin/v2/bigtableadmin-gen.go @@ -153,7 +153,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -172,10 +174,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3861,12 +3860,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3989,12 +3987,11 @@ func (c *OperationsProjectsOperationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4113,8 +4110,7 @@ func (c *ProjectsInstancesCreateCall) Header() http.Header { func (c *ProjectsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createinstancerequest) if err != nil { return nil, err } @@ -4213,12 +4209,11 @@ func (c *ProjectsInstancesDeleteCall) Header() http.Header { func (c *ProjectsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4321,12 +4316,11 @@ func (c *ProjectsInstancesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4422,8 +4416,7 @@ func (c *ProjectsInstancesGetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -4541,12 +4534,11 @@ func (c *ProjectsInstancesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4670,8 +4662,7 @@ func (c *ProjectsInstancesPartialUpdateInstanceCall) Header() http.Header { func (c *ProjectsInstancesPartialUpdateInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -4774,8 +4765,7 @@ func (c *ProjectsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4879,8 +4869,7 @@ func (c *ProjectsInstancesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4984,8 +4973,7 @@ func (c *ProjectsInstancesUpdateCall) Header() http.Header { func (c *ProjectsInstancesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -5102,8 +5090,7 @@ func (c *ProjectsInstancesAppProfilesCreateCall) Header() http.Header { func (c *ProjectsInstancesAppProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appprofile) if err != nil { return nil, err } @@ -5209,12 +5196,11 @@ func (c *ProjectsInstancesAppProfilesDeleteCall) Header() http.Header { func (c *ProjectsInstancesAppProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5317,12 +5303,11 @@ func (c *ProjectsInstancesAppProfilesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5447,12 +5432,11 @@ func (c *ProjectsInstancesAppProfilesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/appProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5582,8 +5566,7 @@ func (c *ProjectsInstancesAppProfilesPatchCall) Header() http.Header { func (c *ProjectsInstancesAppProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.appprofile) if err != nil { return nil, err } @@ -5697,8 +5680,7 @@ func (c *ProjectsInstancesClustersCreateCall) Header() http.Header { func (c *ProjectsInstancesClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5797,12 +5779,11 @@ func (c *ProjectsInstancesClustersDeleteCall) Header() http.Header { func (c *ProjectsInstancesClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5905,12 +5886,11 @@ func (c *ProjectsInstancesClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6023,12 +6003,11 @@ func (c *ProjectsInstancesClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6158,8 +6137,7 @@ func (c *ProjectsInstancesClustersPartialUpdateClusterCall) Header() http.Header func (c *ProjectsInstancesClustersPartialUpdateClusterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -6262,8 +6240,7 @@ func (c *ProjectsInstancesClustersUpdateCall) Header() http.Header { func (c *ProjectsInstancesClustersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -6366,8 +6343,7 @@ func (c *ProjectsInstancesClustersBackupsCopyCall) Header() http.Header { func (c *ProjectsInstancesClustersBackupsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copybackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.copybackuprequest) if err != nil { return nil, err } @@ -6485,8 +6461,7 @@ func (c *ProjectsInstancesClustersBackupsCreateCall) Header() http.Header { func (c *ProjectsInstancesClustersBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -6586,12 +6561,11 @@ func (c *ProjectsInstancesClustersBackupsDeleteCall) Header() http.Header { func (c *ProjectsInstancesClustersBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6695,12 +6669,11 @@ func (c *ProjectsInstancesClustersBackupsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6796,8 +6769,7 @@ func (c *ProjectsInstancesClustersBackupsGetIamPolicyCall) Header() http.Header func (c *ProjectsInstancesClustersBackupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -6969,12 +6941,11 @@ func (c *ProjectsInstancesClustersBackupsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7105,8 +7076,7 @@ func (c *ProjectsInstancesClustersBackupsPatchCall) Header() http.Header { func (c *ProjectsInstancesClustersBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -7209,8 +7179,7 @@ func (c *ProjectsInstancesClustersBackupsSetIamPolicyCall) Header() http.Header func (c *ProjectsInstancesClustersBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7314,8 +7283,7 @@ func (c *ProjectsInstancesClustersBackupsTestIamPermissionsCall) Header() http.H func (c *ProjectsInstancesClustersBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7466,12 +7434,11 @@ func (c *ProjectsInstancesClustersHotTabletsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/hotTablets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7589,8 +7556,7 @@ func (c *ProjectsInstancesTablesCheckConsistencyCall) Header() http.Header { func (c *ProjectsInstancesTablesCheckConsistencyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkconsistencyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkconsistencyrequest) if err != nil { return nil, err } @@ -7694,8 +7660,7 @@ func (c *ProjectsInstancesTablesCreateCall) Header() http.Header { func (c *ProjectsInstancesTablesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtablerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtablerequest) if err != nil { return nil, err } @@ -7794,12 +7759,11 @@ func (c *ProjectsInstancesTablesDeleteCall) Header() http.Header { func (c *ProjectsInstancesTablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7898,8 +7862,7 @@ func (c *ProjectsInstancesTablesDropRowRangeCall) Header() http.Header { func (c *ProjectsInstancesTablesDropRowRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.droprowrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.droprowrangerequest) if err != nil { return nil, err } @@ -8004,8 +7967,7 @@ func (c *ProjectsInstancesTablesGenerateConsistencyTokenCall) Header() http.Head func (c *ProjectsInstancesTablesGenerateConsistencyTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateconsistencytokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateconsistencytokenrequest) if err != nil { return nil, err } @@ -8151,12 +8113,11 @@ func (c *ProjectsInstancesTablesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8252,8 +8213,7 @@ func (c *ProjectsInstancesTablesGetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesTablesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -8418,12 +8378,11 @@ func (c *ProjectsInstancesTablesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8542,8 +8501,7 @@ func (c *ProjectsInstancesTablesModifyColumnFamiliesCall) Header() http.Header { func (c *ProjectsInstancesTablesModifyColumnFamiliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycolumnfamiliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifycolumnfamiliesrequest) if err != nil { return nil, err } @@ -8659,8 +8617,7 @@ func (c *ProjectsInstancesTablesPatchCall) Header() http.Header { func (c *ProjectsInstancesTablesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table) if err != nil { return nil, err } @@ -8764,8 +8721,7 @@ func (c *ProjectsInstancesTablesRestoreCall) Header() http.Header { func (c *ProjectsInstancesTablesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoretablerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoretablerequest) if err != nil { return nil, err } @@ -8868,8 +8824,7 @@ func (c *ProjectsInstancesTablesSetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesTablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8973,8 +8928,7 @@ func (c *ProjectsInstancesTablesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsInstancesTablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9076,8 +9030,7 @@ func (c *ProjectsInstancesTablesUndeleteCall) Header() http.Header { func (c *ProjectsInstancesTablesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletetablerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletetablerequest) if err != nil { return nil, err } @@ -9190,8 +9143,7 @@ func (c *ProjectsInstancesTablesAuthorizedViewsCreateCall) Header() http.Header func (c *ProjectsInstancesTablesAuthorizedViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedview) if err != nil { return nil, err } @@ -9301,12 +9253,11 @@ func (c *ProjectsInstancesTablesAuthorizedViewsDeleteCall) Header() http.Header func (c *ProjectsInstancesTablesAuthorizedViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9431,12 +9382,11 @@ func (c *ProjectsInstancesTablesAuthorizedViewsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9532,8 +9482,7 @@ func (c *ProjectsInstancesTablesAuthorizedViewsGetIamPolicyCall) Header() http.H func (c *ProjectsInstancesTablesAuthorizedViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -9684,12 +9633,11 @@ func (c *ProjectsInstancesTablesAuthorizedViewsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/authorizedViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9823,8 +9771,7 @@ func (c *ProjectsInstancesTablesAuthorizedViewsPatchCall) Header() http.Header { func (c *ProjectsInstancesTablesAuthorizedViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizedview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizedview) if err != nil { return nil, err } @@ -9927,8 +9874,7 @@ func (c *ProjectsInstancesTablesAuthorizedViewsSetIamPolicyCall) Header() http.H func (c *ProjectsInstancesTablesAuthorizedViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10032,8 +9978,7 @@ func (c *ProjectsInstancesTablesAuthorizedViewsTestIamPermissionsCall) Header() func (c *ProjectsInstancesTablesAuthorizedViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10168,12 +10113,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/billingbudgets/v1/billingbudgets-gen.go b/billingbudgets/v1/billingbudgets-gen.go index 771c869bb7f..d9b0e824776 100644 --- a/billingbudgets/v1/billingbudgets-gen.go +++ b/billingbudgets/v1/billingbudgets-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -703,8 +702,7 @@ func (c *BillingAccountsBudgetsCreateCall) Header() http.Header { func (c *BillingAccountsBudgetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbillingbudgetsv1budget) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbillingbudgetsv1budget) if err != nil { return nil, err } @@ -804,12 +802,11 @@ func (c *BillingAccountsBudgetsDeleteCall) Header() http.Header { func (c *BillingAccountsBudgetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -916,12 +913,11 @@ func (c *BillingAccountsBudgetsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1056,12 +1052,11 @@ func (c *BillingAccountsBudgetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/budgets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1191,8 +1186,7 @@ func (c *BillingAccountsBudgetsPatchCall) Header() http.Header { func (c *BillingAccountsBudgetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbillingbudgetsv1budget) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbillingbudgetsv1budget) if err != nil { return nil, err } diff --git a/billingbudgets/v1beta1/billingbudgets-gen.go b/billingbudgets/v1beta1/billingbudgets-gen.go index dbf7db271e8..25a5ea44f6b 100644 --- a/billingbudgets/v1beta1/billingbudgets-gen.go +++ b/billingbudgets/v1beta1/billingbudgets-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -738,8 +737,7 @@ func (c *BillingAccountsBudgetsCreateCall) Header() http.Header { func (c *BillingAccountsBudgetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbillingbudgetsv1beta1createbudgetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbillingbudgetsv1beta1createbudgetrequest) if err != nil { return nil, err } @@ -839,12 +837,11 @@ func (c *BillingAccountsBudgetsDeleteCall) Header() http.Header { func (c *BillingAccountsBudgetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -951,12 +948,11 @@ func (c *BillingAccountsBudgetsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1091,12 +1087,11 @@ func (c *BillingAccountsBudgetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/budgets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1215,8 +1210,7 @@ func (c *BillingAccountsBudgetsPatchCall) Header() http.Header { func (c *BillingAccountsBudgetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudbillingbudgetsv1beta1updatebudgetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudbillingbudgetsv1beta1updatebudgetrequest) if err != nil { return nil, err } diff --git a/binaryauthorization/v1/binaryauthorization-gen.go b/binaryauthorization/v1/binaryauthorization-gen.go index 2d0df4a372f..4c27727f88e 100644 --- a/binaryauthorization/v1/binaryauthorization-gen.go +++ b/binaryauthorization/v1/binaryauthorization-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.Systempolicy = NewSystempolicyService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.Systempolicy = NewSystempolicyService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2182,12 +2181,11 @@ func (c *ProjectsGetPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2284,8 +2282,7 @@ func (c *ProjectsUpdatePolicyCall) Header() http.Header { func (c *ProjectsUpdatePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -2394,8 +2391,7 @@ func (c *ProjectsAttestorsCreateCall) Header() http.Header { func (c *ProjectsAttestorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attestor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attestor) if err != nil { return nil, err } @@ -2495,12 +2491,11 @@ func (c *ProjectsAttestorsDeleteCall) Header() http.Header { func (c *ProjectsAttestorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2603,12 +2598,11 @@ func (c *ProjectsAttestorsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2730,12 +2724,11 @@ func (c *ProjectsAttestorsGetIamPolicyCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2856,12 +2849,11 @@ func (c *ProjectsAttestorsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attestors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2979,8 +2971,7 @@ func (c *ProjectsAttestorsSetIamPolicyCall) Header() http.Header { func (c *ProjectsAttestorsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3087,8 +3078,7 @@ func (c *ProjectsAttestorsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsAttestorsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3191,8 +3181,7 @@ func (c *ProjectsAttestorsUpdateCall) Header() http.Header { func (c *ProjectsAttestorsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attestor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attestor) if err != nil { return nil, err } @@ -3294,8 +3283,7 @@ func (c *ProjectsAttestorsValidateAttestationOccurrenceCall) Header() http.Heade func (c *ProjectsAttestorsValidateAttestationOccurrenceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateattestationoccurrencerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateattestationoccurrencerequest) if err != nil { return nil, err } @@ -3400,8 +3388,7 @@ func (c *ProjectsPlatformsGkePoliciesEvaluateCall) Header() http.Header { func (c *ProjectsPlatformsGkePoliciesEvaluateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evaluategkepolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evaluategkepolicyrequest) if err != nil { return nil, err } @@ -3513,8 +3500,7 @@ func (c *ProjectsPlatformsPoliciesCreateCall) Header() http.Header { func (c *ProjectsPlatformsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.platformpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.platformpolicy) if err != nil { return nil, err } @@ -3621,12 +3607,11 @@ func (c *ProjectsPlatformsPoliciesDeleteCall) Header() http.Header { func (c *ProjectsPlatformsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3730,12 +3715,11 @@ func (c *ProjectsPlatformsPoliciesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3856,12 +3840,11 @@ func (c *ProjectsPlatformsPoliciesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3977,8 +3960,7 @@ func (c *ProjectsPlatformsPoliciesReplacePlatformPolicyCall) Header() http.Heade func (c *ProjectsPlatformsPoliciesReplacePlatformPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.platformpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.platformpolicy) if err != nil { return nil, err } @@ -4108,12 +4090,11 @@ func (c *ProjectsPolicyGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4209,8 +4190,7 @@ func (c *ProjectsPolicySetIamPolicyCall) Header() http.Header { func (c *ProjectsPolicySetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4317,8 +4297,7 @@ func (c *ProjectsPolicyTestIamPermissionsCall) Header() http.Header { func (c *ProjectsPolicyTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4430,12 +4409,11 @@ func (c *SystempolicyGetPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/binaryauthorization/v1beta1/binaryauthorization-gen.go b/binaryauthorization/v1beta1/binaryauthorization-gen.go index a359f5add1a..9649a37163e 100644 --- a/binaryauthorization/v1beta1/binaryauthorization-gen.go +++ b/binaryauthorization/v1beta1/binaryauthorization-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.Systempolicy = NewSystempolicyService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.Systempolicy = NewSystempolicyService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1130,12 +1129,11 @@ func (c *ProjectsGetPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1232,8 +1230,7 @@ func (c *ProjectsUpdatePolicyCall) Header() http.Header { func (c *ProjectsUpdatePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -1342,8 +1339,7 @@ func (c *ProjectsAttestorsCreateCall) Header() http.Header { func (c *ProjectsAttestorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attestor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attestor) if err != nil { return nil, err } @@ -1443,12 +1439,11 @@ func (c *ProjectsAttestorsDeleteCall) Header() http.Header { func (c *ProjectsAttestorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1551,12 +1546,11 @@ func (c *ProjectsAttestorsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1678,12 +1672,11 @@ func (c *ProjectsAttestorsGetIamPolicyCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1804,12 +1797,11 @@ func (c *ProjectsAttestorsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/attestors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1927,8 +1919,7 @@ func (c *ProjectsAttestorsSetIamPolicyCall) Header() http.Header { func (c *ProjectsAttestorsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2035,8 +2026,7 @@ func (c *ProjectsAttestorsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsAttestorsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2139,8 +2129,7 @@ func (c *ProjectsAttestorsUpdateCall) Header() http.Header { func (c *ProjectsAttestorsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attestor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attestor) if err != nil { return nil, err } @@ -2242,8 +2231,7 @@ func (c *ProjectsAttestorsValidateAttestationOccurrenceCall) Header() http.Heade func (c *ProjectsAttestorsValidateAttestationOccurrenceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateattestationoccurrencerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateattestationoccurrencerequest) if err != nil { return nil, err } @@ -2374,12 +2362,11 @@ func (c *ProjectsPolicyGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2475,8 +2462,7 @@ func (c *ProjectsPolicySetIamPolicyCall) Header() http.Header { func (c *ProjectsPolicySetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2583,8 +2569,7 @@ func (c *ProjectsPolicyTestIamPermissionsCall) Header() http.Header { func (c *ProjectsPolicyTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2696,12 +2681,11 @@ func (c *SystempolicyGetPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/blockchainnodeengine/v1/blockchainnodeengine-gen.go b/blockchainnodeengine/v1/blockchainnodeengine-gen.go index a2831264db1..e4e76311d96 100644 --- a/blockchainnodeengine/v1/blockchainnodeengine-gen.go +++ b/blockchainnodeengine/v1/blockchainnodeengine-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -821,12 +820,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -952,12 +950,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1094,8 +1091,7 @@ func (c *ProjectsLocationsBlockchainNodesCreateCall) Header() http.Header { func (c *ProjectsLocationsBlockchainNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockchainnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.blockchainnode) if err != nil { return nil, err } @@ -1210,12 +1206,11 @@ func (c *ProjectsLocationsBlockchainNodesDeleteCall) Header() http.Header { func (c *ProjectsLocationsBlockchainNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1318,12 +1313,11 @@ func (c *ProjectsLocationsBlockchainNodesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1453,12 +1447,11 @@ func (c *ProjectsLocationsBlockchainNodesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/blockchainNodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1600,8 +1593,7 @@ func (c *ProjectsLocationsBlockchainNodesPatchCall) Header() http.Header { func (c *ProjectsLocationsBlockchainNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockchainnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.blockchainnode) if err != nil { return nil, err } @@ -1709,8 +1701,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1812,12 +1803,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1922,12 +1912,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2050,12 +2039,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/blogger/v2/blogger-gen.go b/blogger/v2/blogger-gen.go index bd3ca321bde..3ba213c83db 100644 --- a/blogger/v2/blogger-gen.go +++ b/blogger/v2/blogger-gen.go @@ -114,7 +114,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.Pages = NewPagesService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -133,13 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Blogs = NewBlogsService(s) - s.Comments = NewCommentsService(s) - s.Pages = NewPagesService(s) - s.Posts = NewPostsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1196,12 +1195,11 @@ func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1303,12 +1301,11 @@ func (c *BlogsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/blogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1416,12 +1413,11 @@ func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1552,12 +1548,11 @@ func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1684,12 +1679,11 @@ func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1798,12 +1792,11 @@ func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1908,12 +1901,11 @@ func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2040,12 +2032,11 @@ func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2168,12 +2159,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/blogger/v3/blogger-gen.go b/blogger/v3/blogger-gen.go index f599e04be12..dd4df92ff87 100644 --- a/blogger/v3/blogger-gen.go +++ b/blogger/v3/blogger-gen.go @@ -123,7 +123,15 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BlogUserInfos = NewBlogUserInfosService(s) + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.PageViews = NewPageViewsService(s) + s.Pages = NewPagesService(s) + s.PostUserInfos = NewPostUserInfosService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -142,16 +150,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BlogUserInfos = NewBlogUserInfosService(s) - s.Blogs = NewBlogsService(s) - s.Comments = NewCommentsService(s) - s.PageViews = NewPageViewsService(s) - s.Pages = NewPagesService(s) - s.PostUserInfos = NewPostUserInfosService(s) - s.Posts = NewPostsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1394,12 +1393,11 @@ func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs/{blogId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1521,12 +1519,11 @@ func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1640,12 +1637,11 @@ func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/byurl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1788,12 +1784,11 @@ func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1889,12 +1884,11 @@ func (c *CommentsApproveCall) Header() http.Header { func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1992,12 +1986,11 @@ func (c *CommentsDeleteCall) Header() http.Header { func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2097,12 +2090,11 @@ func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2265,12 +2257,11 @@ func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2437,12 +2428,11 @@ func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2559,12 +2549,11 @@ func (c *CommentsMarkAsSpamCall) Header() http.Header { func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2663,12 +2652,11 @@ func (c *CommentsRemoveContentCall) Header() http.Header { func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2784,12 +2772,11 @@ func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pageviews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2888,12 +2875,11 @@ func (c *PagesDeleteCall) Header() http.Header { func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2989,12 +2975,11 @@ func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3093,8 +3078,7 @@ func (c *PagesInsertCall) Header() http.Header { func (c *PagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.page) if err != nil { return nil, err } @@ -3247,12 +3231,11 @@ func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3380,8 +3363,7 @@ func (c *PagesPatchCall) Header() http.Header { func (c *PagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.page) if err != nil { return nil, err } @@ -3483,12 +3465,11 @@ func (c *PagesPublishCall) Header() http.Header { func (c *PagesPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}/publish") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3582,12 +3563,11 @@ func (c *PagesRevertCall) Header() http.Header { func (c *PagesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}/revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3695,8 +3675,7 @@ func (c *PagesUpdateCall) Header() http.Header { func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.page) if err != nil { return nil, err } @@ -3819,12 +3798,11 @@ func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4005,12 +3983,11 @@ func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs/{blogId}/posts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4132,12 +4109,11 @@ func (c *PostsDeleteCall) Header() http.Header { func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4251,12 +4227,11 @@ func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4380,12 +4355,11 @@ func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/bypath") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4495,8 +4469,7 @@ func (c *PostsInsertCall) Header() http.Header { func (c *PostsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.post) if err != nil { return nil, err } @@ -4702,12 +4675,11 @@ func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4853,8 +4825,7 @@ func (c *PostsPatchCall) Header() http.Header { func (c *PostsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.post) if err != nil { return nil, err } @@ -4962,12 +4933,11 @@ func (c *PostsPublishCall) Header() http.Header { func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/publish") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5061,12 +5031,11 @@ func (c *PostsRevertCall) Header() http.Header { func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5189,12 +5158,11 @@ func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5319,8 +5287,7 @@ func (c *PostsUpdateCall) Header() http.Header { func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.post) if err != nil { return nil, err } @@ -5431,12 +5398,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/books/v1/books-gen.go b/books/v1/books-gen.go index fdf56b48012..33d666328b4 100644 --- a/books/v1/books-gen.go +++ b/books/v1/books-gen.go @@ -114,7 +114,20 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Bookshelves = NewBookshelvesService(s) + s.Cloudloading = NewCloudloadingService(s) + s.Dictionary = NewDictionaryService(s) + s.Familysharing = NewFamilysharingService(s) + s.Layers = NewLayersService(s) + s.Myconfig = NewMyconfigService(s) + s.Mylibrary = NewMylibraryService(s) + s.Notification = NewNotificationService(s) + s.Onboarding = NewOnboardingService(s) + s.Personalizedstream = NewPersonalizedstreamService(s) + s.Promooffer = NewPromoofferService(s) + s.Series = NewSeriesService(s) + s.Volumes = NewVolumesService(s) if err != nil { return nil, err } @@ -133,21 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Bookshelves = NewBookshelvesService(s) - s.Cloudloading = NewCloudloadingService(s) - s.Dictionary = NewDictionaryService(s) - s.Familysharing = NewFamilysharingService(s) - s.Layers = NewLayersService(s) - s.Myconfig = NewMyconfigService(s) - s.Mylibrary = NewMylibraryService(s) - s.Notification = NewNotificationService(s) - s.Onboarding = NewOnboardingService(s) - s.Personalizedstream = NewPersonalizedstreamService(s) - s.Promooffer = NewPromoofferService(s) - s.Series = NewSeriesService(s) - s.Volumes = NewVolumesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3849,12 +3848,11 @@ func (c *BookshelvesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/users/{userId}/bookshelves/{shelf}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3964,12 +3962,11 @@ func (c *BookshelvesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/users/{userId}/bookshelves") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4102,12 +4099,11 @@ func (c *BookshelvesVolumesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/users/{userId}/bookshelves/{shelf}/volumes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4222,12 +4218,11 @@ func (c *CloudloadingAddBookCall) Header() http.Header { func (c *CloudloadingAddBookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/cloudloading/addBook") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4314,12 +4309,11 @@ func (c *CloudloadingDeleteBookCall) Header() http.Header { func (c *CloudloadingDeleteBookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/cloudloading/deleteBook") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4404,8 +4398,7 @@ func (c *CloudloadingUpdateBookCall) Header() http.Header { func (c *CloudloadingUpdateBookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bookscloudloadingresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bookscloudloadingresource) if err != nil { return nil, err } @@ -4512,12 +4505,11 @@ func (c *DictionaryListOfflineMetadataCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/dictionary/listOfflineMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4620,12 +4612,11 @@ func (c *FamilysharingGetFamilyInfoCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/familysharing/getFamilyInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4728,12 +4719,11 @@ func (c *FamilysharingShareCall) Header() http.Header { func (c *FamilysharingShareCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/familysharing/share") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4836,12 +4826,11 @@ func (c *FamilysharingUnshareCall) Header() http.Header { func (c *FamilysharingUnshareCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/familysharing/unshare") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4957,12 +4946,11 @@ func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/layersummary/{summaryId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5093,12 +5081,11 @@ func (c *LayersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/layersummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5251,12 +5238,11 @@ func (c *LayersAnnotationDataGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5436,12 +5422,11 @@ func (c *LayersAnnotationDataListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/layers/{layerId}/data") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5586,12 +5571,11 @@ func (c *LayersVolumeAnnotationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5787,12 +5771,11 @@ func (c *LayersVolumeAnnotationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/layers/{layerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5920,12 +5903,11 @@ func (c *MyconfigGetUserSettingsCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/myconfig/getUserSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6027,12 +6009,11 @@ func (c *MyconfigReleaseDownloadAccessCall) Header() http.Header { func (c *MyconfigReleaseDownloadAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/myconfig/releaseDownloadAccess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6146,12 +6127,11 @@ func (c *MyconfigRequestAccessCall) Header() http.Header { func (c *MyconfigRequestAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/myconfig/requestAccess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6283,12 +6263,11 @@ func (c *MyconfigSyncVolumeLicensesCall) Header() http.Header { func (c *MyconfigSyncVolumeLicensesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/myconfig/syncVolumeLicenses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6375,8 +6354,7 @@ func (c *MyconfigUpdateUserSettingsCall) Header() http.Header { func (c *MyconfigUpdateUserSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.usersettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.usersettings) if err != nil { return nil, err } @@ -6478,12 +6456,11 @@ func (c *MylibraryAnnotationsDeleteCall) Header() http.Header { func (c *MylibraryAnnotationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/annotations/{annotationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6600,8 +6577,7 @@ func (c *MylibraryAnnotationsInsertCall) Header() http.Header { func (c *MylibraryAnnotationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotation) if err != nil { return nil, err } @@ -6775,12 +6751,11 @@ func (c *MylibraryAnnotationsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/annotations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6896,12 +6871,11 @@ func (c *MylibraryAnnotationsSummaryCall) Header() http.Header { func (c *MylibraryAnnotationsSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/annotations/summary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6998,8 +6972,7 @@ func (c *MylibraryAnnotationsUpdateCall) Header() http.Header { func (c *MylibraryAnnotationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotation) if err != nil { return nil, err } @@ -7120,12 +7093,11 @@ func (c *MylibraryBookshelvesAddVolumeCall) Header() http.Header { func (c *MylibraryBookshelvesAddVolumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves/{shelf}/addVolume") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7222,12 +7194,11 @@ func (c *MylibraryBookshelvesClearVolumesCall) Header() http.Header { func (c *MylibraryBookshelvesClearVolumesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves/{shelf}/clearVolumes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7337,12 +7308,11 @@ func (c *MylibraryBookshelvesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves/{shelf}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7447,12 +7417,11 @@ func (c *MylibraryBookshelvesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7552,12 +7521,11 @@ func (c *MylibraryBookshelvesMoveVolumeCall) Header() http.Header { func (c *MylibraryBookshelvesMoveVolumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves/{shelf}/moveVolume") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7668,12 +7636,11 @@ func (c *MylibraryBookshelvesRemoveVolumeCall) Header() http.Header { func (c *MylibraryBookshelvesRemoveVolumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves/{shelf}/removeVolume") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7830,12 +7797,11 @@ func (c *MylibraryBookshelvesVolumesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/bookshelves/{shelf}/volumes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7951,12 +7917,11 @@ func (c *MylibraryReadingpositionsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/readingpositions/{volumeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8090,12 +8055,11 @@ func (c *MylibraryReadingpositionsSetPositionCall) Header() http.Header { func (c *MylibraryReadingpositionsSetPositionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/mylibrary/readingpositions/{volumeId}/setPosition") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8211,12 +8175,11 @@ func (c *NotificationGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/notification/get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8318,12 +8281,11 @@ func (c *OnboardingListCategoriesCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/onboarding/listCategories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8461,12 +8423,11 @@ func (c *OnboardingListCategoryVolumesCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/onboarding/listCategoryVolumes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8610,12 +8571,11 @@ func (c *PersonalizedstreamGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/personalizedstream/get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8748,12 +8708,11 @@ func (c *PromoofferAcceptCall) Header() http.Header { func (c *PromoofferAcceptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/promooffer/accept") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8878,12 +8837,11 @@ func (c *PromoofferDismissCall) Header() http.Header { func (c *PromoofferDismissCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/promooffer/dismiss") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9014,12 +8972,11 @@ func (c *PromoofferGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/promooffer/get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9117,12 +9074,11 @@ func (c *SeriesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/series/get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9234,12 +9190,11 @@ func (c *SeriesMembershipGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/series/membership/get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9386,12 +9341,11 @@ func (c *VolumesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9627,12 +9581,11 @@ func (c *VolumesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9772,12 +9725,11 @@ func (c *VolumesAssociatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/{volumeId}/associated") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9944,12 +9896,11 @@ func (c *VolumesMybooksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/mybooks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10072,12 +10023,11 @@ func (c *VolumesRecommendedListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/recommended") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10179,12 +10129,11 @@ func (c *VolumesRecommendedRateCall) Header() http.Header { func (c *VolumesRecommendedRateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/recommended/rate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10330,12 +10279,11 @@ func (c *VolumesUseruploadedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "books/v1/volumes/useruploaded") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/businessprofileperformance/v1/businessprofileperformance-gen.go b/businessprofileperformance/v1/businessprofileperformance-gen.go index 59060db47eb..a48325f5628 100644 --- a/businessprofileperformance/v1/businessprofileperformance-gen.go +++ b/businessprofileperformance/v1/businessprofileperformance-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Locations = NewLocationsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Locations = NewLocationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -730,12 +729,11 @@ func (c *LocationsFetchMultiDailyMetricsTimeSeriesCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}:fetchMultiDailyMetricsTimeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1005,12 +1003,11 @@ func (c *LocationsGetDailyMetricsTimeSeriesCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getDailyMetricsTimeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1182,12 +1179,11 @@ func (c *LocationsSearchkeywordsImpressionsMonthlyListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/searchkeywords/impressions/monthly") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/calendar/v3/calendar-gen.go b/calendar/v3/calendar-gen.go index 59f2cffa68e..a08c49381e5 100644 --- a/calendar/v3/calendar-gen.go +++ b/calendar/v3/calendar-gen.go @@ -134,7 +134,15 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Acl = NewAclService(s) + s.CalendarList = NewCalendarListService(s) + s.Calendars = NewCalendarsService(s) + s.Channels = NewChannelsService(s) + s.Colors = NewColorsService(s) + s.Events = NewEventsService(s) + s.Freebusy = NewFreebusyService(s) + s.Settings = NewSettingsService(s) if err != nil { return nil, err } @@ -153,16 +161,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Acl = NewAclService(s) - s.CalendarList = NewCalendarListService(s) - s.Calendars = NewCalendarsService(s) - s.Channels = NewChannelsService(s) - s.Colors = NewColorsService(s) - s.Events = NewEventsService(s) - s.Freebusy = NewFreebusyService(s) - s.Settings = NewSettingsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2169,12 +2168,11 @@ func (c *AclDeleteCall) Header() http.Header { func (c *AclDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2259,12 +2257,11 @@ func (c *AclGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2367,8 +2364,7 @@ func (c *AclInsertCall) Header() http.Header { func (c *AclInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.aclrule) if err != nil { return nil, err } @@ -2521,12 +2517,11 @@ func (c *AclListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2652,8 +2647,7 @@ func (c *AclPatchCall) Header() http.Header { func (c *AclPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.aclrule) if err != nil { return nil, err } @@ -2767,8 +2761,7 @@ func (c *AclUpdateCall) Header() http.Header { func (c *AclUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.aclrule) if err != nil { return nil, err } @@ -2912,8 +2905,7 @@ func (c *AclWatchCall) Header() http.Header { func (c *AclWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -3013,12 +3005,11 @@ func (c *CalendarListDeleteCall) Header() http.Header { func (c *CalendarListDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3099,12 +3090,11 @@ func (c *CalendarListGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3202,8 +3192,7 @@ func (c *CalendarListInsertCall) Header() http.Header { func (c *CalendarListInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendarlistentry) if err != nil { return nil, err } @@ -3372,12 +3361,11 @@ func (c *CalendarListListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3499,8 +3487,7 @@ func (c *CalendarListPatchCall) Header() http.Header { func (c *CalendarListPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendarlistentry) if err != nil { return nil, err } @@ -3612,8 +3599,7 @@ func (c *CalendarListUpdateCall) Header() http.Header { func (c *CalendarListUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendarlistentry) if err != nil { return nil, err } @@ -3775,8 +3761,7 @@ func (c *CalendarListWatchCall) Header() http.Header { func (c *CalendarListWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -3874,12 +3859,11 @@ func (c *CalendarsClearCall) Header() http.Header { func (c *CalendarsClearCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/clear") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3949,12 +3933,11 @@ func (c *CalendarsDeleteCall) Header() http.Header { func (c *CalendarsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4035,12 +4018,11 @@ func (c *CalendarsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4128,8 +4110,7 @@ func (c *CalendarsInsertCall) Header() http.Header { func (c *CalendarsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendar) if err != nil { return nil, err } @@ -4229,8 +4210,7 @@ func (c *CalendarsPatchCall) Header() http.Header { func (c *CalendarsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendar) if err != nil { return nil, err } @@ -4332,8 +4312,7 @@ func (c *CalendarsUpdateCall) Header() http.Header { func (c *CalendarsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.calendar) if err != nil { return nil, err } @@ -4429,8 +4408,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4510,12 +4488,11 @@ func (c *ColorsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "colors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4636,12 +4613,11 @@ func (c *EventsDeleteCall) Header() http.Header { func (c *EventsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4752,12 +4728,11 @@ func (c *EventsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4876,8 +4851,7 @@ func (c *EventsImportCall) Header() http.Header { func (c *EventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.event) if err != nil { return nil, err } @@ -5038,8 +5012,7 @@ func (c *EventsInsertCall) Header() http.Header { func (c *EventsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.event) if err != nil { return nil, err } @@ -5225,12 +5198,11 @@ func (c *EventsInstancesCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5569,12 +5541,11 @@ func (c *EventsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5723,12 +5694,11 @@ func (c *EventsMoveCall) Header() http.Header { func (c *EventsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5892,8 +5862,7 @@ func (c *EventsPatchCall) Header() http.Header { func (c *EventsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.event) if err != nil { return nil, err } @@ -6025,12 +5994,11 @@ func (c *EventsQuickAddCall) Header() http.Header { func (c *EventsQuickAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/quickAdd") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6193,8 +6161,7 @@ func (c *EventsUpdateCall) Header() http.Header { func (c *EventsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.event) if err != nil { return nil, err } @@ -6510,8 +6477,7 @@ func (c *EventsWatchCall) Header() http.Header { func (c *EventsWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -6607,8 +6573,7 @@ func (c *FreebusyQueryCall) Header() http.Header { func (c *FreebusyQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.freebusyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.freebusyrequest) if err != nil { return nil, err } @@ -6716,12 +6681,11 @@ func (c *SettingsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/{setting}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6849,12 +6813,11 @@ func (c *SettingsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6990,8 +6953,7 @@ func (c *SettingsWatchCall) Header() http.Header { func (c *SettingsWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } diff --git a/certificatemanager/v1/certificatemanager-gen.go b/certificatemanager/v1/certificatemanager-gen.go index 991f20e2622..b8d51978c7c 100644 --- a/certificatemanager/v1/certificatemanager-gen.go +++ b/certificatemanager/v1/certificatemanager-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1465,12 +1464,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1596,12 +1594,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1725,8 +1722,7 @@ func (c *ProjectsLocationsCertificateIssuanceConfigsCreateCall) Header() http.He func (c *ProjectsLocationsCertificateIssuanceConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificateissuanceconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificateissuanceconfig) if err != nil { return nil, err } @@ -1825,12 +1821,11 @@ func (c *ProjectsLocationsCertificateIssuanceConfigsDeleteCall) Header() http.He func (c *ProjectsLocationsCertificateIssuanceConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1933,12 +1928,11 @@ func (c *ProjectsLocationsCertificateIssuanceConfigsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2074,12 +2068,11 @@ func (c *ProjectsLocationsCertificateIssuanceConfigsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificateIssuanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2203,8 +2196,7 @@ func (c *ProjectsLocationsCertificateIssuanceConfigsPatchCall) Header() http.Hea func (c *ProjectsLocationsCertificateIssuanceConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificateissuanceconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificateissuanceconfig) if err != nil { return nil, err } @@ -2312,8 +2304,7 @@ func (c *ProjectsLocationsCertificateMapsCreateCall) Header() http.Header { func (c *ProjectsLocationsCertificateMapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificatemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificatemap) if err != nil { return nil, err } @@ -2414,12 +2405,11 @@ func (c *ProjectsLocationsCertificateMapsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCertificateMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2522,12 +2512,11 @@ func (c *ProjectsLocationsCertificateMapsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2662,12 +2651,11 @@ func (c *ProjectsLocationsCertificateMapsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificateMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2791,8 +2779,7 @@ func (c *ProjectsLocationsCertificateMapsPatchCall) Header() http.Header { func (c *ProjectsLocationsCertificateMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificatemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificatemap) if err != nil { return nil, err } @@ -2900,8 +2887,7 @@ func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesCreateCall) Header func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificatemapentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificatemapentry) if err != nil { return nil, err } @@ -3000,12 +2986,11 @@ func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesDeleteCall) Header func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3108,12 +3093,11 @@ func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3252,12 +3236,11 @@ func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesListCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificateMapEntries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3381,8 +3364,7 @@ func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesPatchCall) Header( func (c *ProjectsLocationsCertificateMapsCertificateMapEntriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificatemapentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificatemapentry) if err != nil { return nil, err } @@ -3490,8 +3472,7 @@ func (c *ProjectsLocationsCertificatesCreateCall) Header() http.Header { func (c *ProjectsLocationsCertificatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificate) if err != nil { return nil, err } @@ -3590,12 +3571,11 @@ func (c *ProjectsLocationsCertificatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3698,12 +3678,11 @@ func (c *ProjectsLocationsCertificatesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3838,12 +3817,11 @@ func (c *ProjectsLocationsCertificatesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3967,8 +3945,7 @@ func (c *ProjectsLocationsCertificatesPatchCall) Header() http.Header { func (c *ProjectsLocationsCertificatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificate) if err != nil { return nil, err } @@ -4076,8 +4053,7 @@ func (c *ProjectsLocationsDnsAuthorizationsCreateCall) Header() http.Header { func (c *ProjectsLocationsDnsAuthorizationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dnsauthorization) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dnsauthorization) if err != nil { return nil, err } @@ -4176,12 +4152,11 @@ func (c *ProjectsLocationsDnsAuthorizationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDnsAuthorizationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4284,12 +4259,11 @@ func (c *ProjectsLocationsDnsAuthorizationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4425,12 +4399,11 @@ func (c *ProjectsLocationsDnsAuthorizationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsAuthorizations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4554,8 +4527,7 @@ func (c *ProjectsLocationsDnsAuthorizationsPatchCall) Header() http.Header { func (c *ProjectsLocationsDnsAuthorizationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dnsauthorization) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dnsauthorization) if err != nil { return nil, err } @@ -4663,8 +4635,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4765,12 +4736,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4874,12 +4844,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5002,12 +4971,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5130,8 +5098,7 @@ func (c *ProjectsLocationsTrustConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsTrustConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trustconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trustconfig) if err != nil { return nil, err } @@ -5239,12 +5206,11 @@ func (c *ProjectsLocationsTrustConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTrustConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5347,12 +5313,11 @@ func (c *ProjectsLocationsTrustConfigsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5487,12 +5452,11 @@ func (c *ProjectsLocationsTrustConfigsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/trustConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5616,8 +5580,7 @@ func (c *ProjectsLocationsTrustConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsTrustConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trustconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trustconfig) if err != nil { return nil, err } diff --git a/chat/v1/chat-gen.go b/chat/v1/chat-gen.go index 01cbfa3f83b..ccdd648f97b 100644 --- a/chat/v1/chat-gen.go +++ b/chat/v1/chat-gen.go @@ -232,7 +232,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Media = NewMediaService(s) + s.Spaces = NewSpacesService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -251,11 +254,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Media = NewMediaService(s) - s.Spaces = NewSpacesService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6021,12 +6020,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/media/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6181,8 +6179,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadattachmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadattachmentrequest) if err != nil { return nil, err } @@ -6193,14 +6190,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+parent}/attachments:upload") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -6317,8 +6310,7 @@ func (c *SpacesCompleteImportCall) Header() http.Header { func (c *SpacesCompleteImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeimportspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completeimportspacerequest) if err != nil { return nil, err } @@ -6443,8 +6435,7 @@ func (c *SpacesCreateCall) Header() http.Header { func (c *SpacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.space) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.space) if err != nil { return nil, err } @@ -6564,12 +6555,11 @@ func (c *SpacesDeleteCall) Header() http.Header { func (c *SpacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6699,12 +6689,11 @@ func (c *SpacesFindDirectMessageCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/spaces:findDirectMessage") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6825,12 +6814,11 @@ func (c *SpacesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6974,12 +6962,11 @@ func (c *SpacesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/spaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7171,8 +7158,7 @@ func (c *SpacesPatchCall) Header() http.Header { func (c *SpacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.space) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.space) if err != nil { return nil, err } @@ -7375,12 +7361,11 @@ func (c *SpacesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/spaces:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7525,8 +7510,7 @@ func (c *SpacesSetupCall) Header() http.Header { func (c *SpacesSetupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setupspacerequest) if err != nil { return nil, err } @@ -7659,8 +7643,7 @@ func (c *SpacesMembersCreateCall) Header() http.Header { func (c *SpacesMembersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -7792,12 +7775,11 @@ func (c *SpacesMembersDeleteCall) Header() http.Header { func (c *SpacesMembersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7930,12 +7912,11 @@ func (c *SpacesMembersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8131,12 +8112,11 @@ func (c *SpacesMembersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/members") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8282,8 +8262,7 @@ func (c *SpacesMembersPatchCall) Header() http.Header { func (c *SpacesMembersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -8469,8 +8448,7 @@ func (c *SpacesMessagesCreateCall) Header() http.Header { func (c *SpacesMessagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -8592,12 +8570,11 @@ func (c *SpacesMessagesDeleteCall) Header() http.Header { func (c *SpacesMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8711,12 +8688,11 @@ func (c *SpacesMessagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8886,12 +8862,11 @@ func (c *SpacesMessagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9050,8 +9025,7 @@ func (c *SpacesMessagesPatchCall) Header() http.Header { func (c *SpacesMessagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -9196,8 +9170,7 @@ func (c *SpacesMessagesUpdateCall) Header() http.Header { func (c *SpacesMessagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -9314,12 +9287,11 @@ func (c *SpacesMessagesAttachmentsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9416,8 +9388,7 @@ func (c *SpacesMessagesReactionsCreateCall) Header() http.Header { func (c *SpacesMessagesReactionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reaction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reaction) if err != nil { return nil, err } @@ -9520,12 +9491,11 @@ func (c *SpacesMessagesReactionsDeleteCall) Header() http.Header { func (c *SpacesMessagesReactionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9678,12 +9648,11 @@ func (c *SpacesMessagesReactionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reactions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9819,12 +9788,11 @@ func (c *SpacesSpaceEventsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9990,12 +9958,11 @@ func (c *SpacesSpaceEventsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/spaceEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10131,12 +10098,11 @@ func (c *UsersSpacesGetSpaceReadStateCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10248,8 +10214,7 @@ func (c *UsersSpacesUpdateSpaceReadStateCall) Header() http.Header { func (c *UsersSpacesUpdateSpaceReadStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.spacereadstate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.spacereadstate) if err != nil { return nil, err } @@ -10372,12 +10337,11 @@ func (c *UsersSpacesThreadsGetThreadReadStateCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/checks/v1alpha/checks-gen.go b/checks/v1alpha/checks-gen.go index 31536b3a7f2..35f7e2bfc7a 100644 --- a/checks/v1alpha/checks-gen.go +++ b/checks/v1alpha/checks-gen.go @@ -103,7 +103,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Aisafety = NewAisafetyService(s) + s.Media = NewMediaService(s) if err != nil { return nil, err } @@ -122,11 +125,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Aisafety = NewAisafetyService(s) - s.Media = NewMediaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2714,12 +2713,11 @@ func (c *AccountsAppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2839,12 +2837,11 @@ func (c *AccountsAppsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2966,8 +2963,7 @@ func (c *AccountsAppsOperationsCancelCall) Header() http.Header { func (c *AccountsAppsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3068,12 +3064,11 @@ func (c *AccountsAppsOperationsDeleteCall) Header() http.Header { func (c *AccountsAppsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3177,12 +3172,11 @@ func (c *AccountsAppsOperationsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3305,12 +3299,11 @@ func (c *AccountsAppsOperationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3432,8 +3425,7 @@ func (c *AccountsAppsOperationsWaitCall) Header() http.Header { func (c *AccountsAppsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.waitoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.waitoperationrequest) if err != nil { return nil, err } @@ -3556,12 +3548,11 @@ func (c *AccountsAppsReportsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3701,12 +3692,11 @@ func (c *AccountsAppsReportsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3832,12 +3822,11 @@ func (c *AccountsReposOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3931,8 +3920,7 @@ func (c *AccountsReposScansGenerateCall) Header() http.Header { func (c *AccountsReposScansGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechecksreposcanv1alphageneratescanrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechecksreposcanv1alphageneratescanrequest) if err != nil { return nil, err } @@ -4046,12 +4034,11 @@ func (c *AccountsReposScansGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4179,12 +4166,11 @@ func (c *AccountsReposScansListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4295,8 +4281,7 @@ func (c *AisafetyClassifyContentCall) Header() http.Header { func (c *AisafetyClassifyContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechecksaisafetyv1alphaclassifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechecksaisafetyv1alphaclassifycontentrequest) if err != nil { return nil, err } @@ -4448,8 +4433,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechecksreportv1alphaanalyzeuploadrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechecksreportv1alphaanalyzeuploadrequest) if err != nil { return nil, err } @@ -4460,14 +4444,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1alpha/{+parent}/reports:analyzeUpload") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/chromemanagement/v1/chromemanagement-gen.go b/chromemanagement/v1/chromemanagement-gen.go index 0b5ca8a8ec8..fcc2ae8f2b1 100644 --- a/chromemanagement/v1/chromemanagement-gen.go +++ b/chromemanagement/v1/chromemanagement-gen.go @@ -130,7 +130,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) if err != nil { return nil, err } @@ -149,9 +150,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4797,12 +4796,11 @@ func (c *CustomersAppsCountChromeAppRequestsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/apps:countChromeAppRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4960,12 +4958,11 @@ func (c *CustomersAppsFetchDevicesRequestingExtensionCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/apps:fetchDevicesRequestingExtension") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5121,12 +5118,11 @@ func (c *CustomersAppsFetchUsersRequestingExtensionCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/apps:fetchUsersRequestingExtension") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5254,12 +5250,11 @@ func (c *CustomersAppsAndroidGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5366,12 +5361,11 @@ func (c *CustomersAppsChromeGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5478,12 +5472,11 @@ func (c *CustomersAppsWebGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5574,12 +5567,11 @@ func (c *CustomersProfilesDeleteCall) Header() http.Header { func (c *CustomersProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5683,12 +5675,11 @@ func (c *CustomersProfilesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5843,12 +5834,11 @@ func (c *CustomersProfilesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/profiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5980,12 +5970,11 @@ func (c *CustomersReportsCountChromeBrowsersNeedingAttentionCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countChromeBrowsersNeedingAttention") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6112,12 +6101,11 @@ func (c *CustomersReportsCountChromeCrashEventsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countChromeCrashEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6250,12 +6238,11 @@ func (c *CustomersReportsCountChromeDevicesReachingAutoExpirationDateCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countChromeDevicesReachingAutoExpirationDate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6375,12 +6362,11 @@ func (c *CustomersReportsCountChromeDevicesThatNeedAttentionCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countChromeDevicesThatNeedAttention") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6500,12 +6486,11 @@ func (c *CustomersReportsCountChromeHardwareFleetDevicesCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countChromeHardwareFleetDevices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6638,12 +6623,11 @@ func (c *CustomersReportsCountChromeVersionsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countChromeVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6809,12 +6793,11 @@ func (c *CustomersReportsCountInstalledAppsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countInstalledApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6981,12 +6964,11 @@ func (c *CustomersReportsCountPrintJobsByPrinterCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countPrintJobsByPrinter") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7153,12 +7135,11 @@ func (c *CustomersReportsCountPrintJobsByUserCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:countPrintJobsByUser") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7332,12 +7313,11 @@ func (c *CustomersReportsEnumeratePrintJobsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:enumeratePrintJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7523,12 +7503,11 @@ func (c *CustomersReportsFindInstalledAppDevicesCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}/reports:findInstalledAppDevices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7667,12 +7646,11 @@ func (c *CustomersTelemetryDevicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7820,12 +7798,11 @@ func (c *CustomersTelemetryDevicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/telemetry/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7991,12 +7968,11 @@ func (c *CustomersTelemetryEventsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/telemetry/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8111,8 +8087,7 @@ func (c *CustomersTelemetryNotificationConfigsCreateCall) Header() http.Header { func (c *CustomersTelemetryNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromemanagementv1telemetrynotificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromemanagementv1telemetrynotificationconfig) if err != nil { return nil, err } @@ -8212,12 +8187,11 @@ func (c *CustomersTelemetryNotificationConfigsDeleteCall) Header() http.Header { func (c *CustomersTelemetryNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8339,12 +8313,11 @@ func (c *CustomersTelemetryNotificationConfigsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/telemetry/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8479,12 +8452,11 @@ func (c *CustomersTelemetryUsersGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8620,12 +8592,11 @@ func (c *CustomersTelemetryUsersListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/telemetry/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/chromepolicy/v1/chromepolicy-gen.go b/chromepolicy/v1/chromepolicy-gen.go index fb1d58c4de3..52db36728ef 100644 --- a/chromepolicy/v1/chromepolicy-gen.go +++ b/chromepolicy/v1/chromepolicy-gen.go @@ -125,7 +125,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Media = NewMediaService(s) if err != nil { return nil, err } @@ -144,10 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Media = NewMediaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1903,8 +1902,7 @@ func (c *CustomersPoliciesResolveCall) Header() http.Header { func (c *CustomersPoliciesResolveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1resolverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1resolverequest) if err != nil { return nil, err } @@ -2032,8 +2030,7 @@ func (c *CustomersPoliciesGroupsBatchDeleteCall) Header() http.Header { func (c *CustomersPoliciesGroupsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1batchdeletegrouppoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1batchdeletegrouppoliciesrequest) if err != nil { return nil, err } @@ -2140,8 +2137,7 @@ func (c *CustomersPoliciesGroupsBatchModifyCall) Header() http.Header { func (c *CustomersPoliciesGroupsBatchModifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1batchmodifygrouppoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1batchmodifygrouppoliciesrequest) if err != nil { return nil, err } @@ -2246,8 +2242,7 @@ func (c *CustomersPoliciesGroupsListGroupPriorityOrderingCall) Header() http.Hea func (c *CustomersPoliciesGroupsListGroupPriorityOrderingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1listgrouppriorityorderingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1listgrouppriorityorderingrequest) if err != nil { return nil, err } @@ -2352,8 +2347,7 @@ func (c *CustomersPoliciesGroupsUpdateGroupPriorityOrderingCall) Header() http.H func (c *CustomersPoliciesGroupsUpdateGroupPriorityOrderingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1updategrouppriorityorderingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1updategrouppriorityorderingrequest) if err != nil { return nil, err } @@ -2454,8 +2448,7 @@ func (c *CustomersPoliciesNetworksDefineCertificateCall) Header() http.Header { func (c *CustomersPoliciesNetworksDefineCertificateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1definecertificaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1definecertificaterequest) if err != nil { return nil, err } @@ -2556,8 +2549,7 @@ func (c *CustomersPoliciesNetworksDefineNetworkCall) Header() http.Header { func (c *CustomersPoliciesNetworksDefineNetworkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1definenetworkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1definenetworkrequest) if err != nil { return nil, err } @@ -2658,8 +2650,7 @@ func (c *CustomersPoliciesNetworksRemoveCertificateCall) Header() http.Header { func (c *CustomersPoliciesNetworksRemoveCertificateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1removecertificaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1removecertificaterequest) if err != nil { return nil, err } @@ -2760,8 +2751,7 @@ func (c *CustomersPoliciesNetworksRemoveNetworkCall) Header() http.Header { func (c *CustomersPoliciesNetworksRemoveNetworkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1removenetworkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1removenetworkrequest) if err != nil { return nil, err } @@ -2869,8 +2859,7 @@ func (c *CustomersPoliciesOrgunitsBatchInheritCall) Header() http.Header { func (c *CustomersPoliciesOrgunitsBatchInheritCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1batchinheritorgunitpoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1batchinheritorgunitpoliciesrequest) if err != nil { return nil, err } @@ -2977,8 +2966,7 @@ func (c *CustomersPoliciesOrgunitsBatchModifyCall) Header() http.Header { func (c *CustomersPoliciesOrgunitsBatchModifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1batchmodifyorgunitpoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1batchmodifyorgunitpoliciesrequest) if err != nil { return nil, err } @@ -3089,12 +3077,11 @@ func (c *CustomersPolicySchemasGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3220,12 +3207,11 @@ func (c *CustomersPolicySchemasListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policySchemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3379,8 +3365,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechromepolicyversionsv1uploadpolicyfilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechromepolicyversionsv1uploadpolicyfilerequest) if err != nil { return nil, err } @@ -3391,14 +3376,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+customer}/policies/files:uploadPolicyFile") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/chromeuxreport/v1/chromeuxreport-gen.go b/chromeuxreport/v1/chromeuxreport-gen.go index c373a9f4f4a..aa6b8a18f6d 100644 --- a/chromeuxreport/v1/chromeuxreport-gen.go +++ b/chromeuxreport/v1/chromeuxreport-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Records = NewRecordsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Records = NewRecordsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -856,8 +855,7 @@ func (c *RecordsQueryHistoryRecordCall) Header() http.Header { func (c *RecordsQueryHistoryRecordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryhistoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryhistoryrequest) if err != nil { return nil, err } @@ -953,8 +951,7 @@ func (c *RecordsQueryRecordCall) Header() http.Header { func (c *RecordsQueryRecordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryrequest) if err != nil { return nil, err } diff --git a/civicinfo/v2/civicinfo-gen.go b/civicinfo/v2/civicinfo-gen.go index 36f28720112..79c406003e9 100644 --- a/civicinfo/v2/civicinfo-gen.go +++ b/civicinfo/v2/civicinfo-gen.go @@ -103,7 +103,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Divisions = NewDivisionsService(s) + s.Elections = NewElectionsService(s) + s.Representatives = NewRepresentativesService(s) if err != nil { return nil, err } @@ -122,11 +125,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Divisions = NewDivisionsService(s) - s.Elections = NewElectionsService(s) - s.Representatives = NewRepresentativesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1194,12 +1193,11 @@ func (c *DivisionsQueryDivisionByAddressCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "civicinfo/v2/divisionsByAddress") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1305,12 +1303,11 @@ func (c *DivisionsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "civicinfo/v2/divisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1413,12 +1410,11 @@ func (c *ElectionsElectionQueryCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "civicinfo/v2/elections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1558,12 +1554,11 @@ func (c *ElectionsVoterInfoQueryCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "civicinfo/v2/voterinfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1719,12 +1714,11 @@ func (c *RepresentativesRepresentativeInfoByAddressCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "civicinfo/v2/representatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1878,12 +1872,11 @@ func (c *RepresentativesRepresentativeInfoByDivisionCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "civicinfo/v2/representatives/{ocdId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/classroom/v1/classroom-gen.go b/classroom/v1/classroom-gen.go index 7ea23ee0fe9..e4fcb507738 100644 --- a/classroom/v1/classroom-gen.go +++ b/classroom/v1/classroom-gen.go @@ -207,7 +207,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Courses = NewCoursesService(s) + s.Invitations = NewInvitationsService(s) + s.Registrations = NewRegistrationsService(s) + s.UserProfiles = NewUserProfilesService(s) if err != nil { return nil, err } @@ -226,12 +230,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Courses = NewCoursesService(s) - s.Invitations = NewInvitationsService(s) - s.Registrations = NewRegistrationsService(s) - s.UserProfiles = NewUserProfilesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3270,8 +3269,7 @@ func (c *CoursesCreateCall) Header() http.Header { func (c *CoursesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.course) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.course) if err != nil { return nil, err } @@ -3370,12 +3368,11 @@ func (c *CoursesDeleteCall) Header() http.Header { func (c *CoursesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3481,12 +3478,11 @@ func (c *CoursesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3663,12 +3659,11 @@ func (c *CoursesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3800,8 +3795,7 @@ func (c *CoursesPatchCall) Header() http.Header { func (c *CoursesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.course) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.course) if err != nil { return nil, err } @@ -3906,8 +3900,7 @@ func (c *CoursesUpdateCall) Header() http.Header { func (c *CoursesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.course) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.course) if err != nil { return nil, err } @@ -4014,8 +4007,7 @@ func (c *CoursesAliasesCreateCall) Header() http.Header { func (c *CoursesAliasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursealias) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.coursealias) if err != nil { return nil, err } @@ -4122,12 +4114,11 @@ func (c *CoursesAliasesDeleteCall) Header() http.Header { func (c *CoursesAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases/{alias}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4251,12 +4242,11 @@ func (c *CoursesAliasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4377,8 +4367,7 @@ func (c *CoursesAnnouncementsCreateCall) Header() http.Header { func (c *CoursesAnnouncementsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.announcement) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.announcement) if err != nil { return nil, err } @@ -4489,12 +4478,11 @@ func (c *CoursesAnnouncementsDeleteCall) Header() http.Header { func (c *CoursesAnnouncementsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4605,12 +4593,11 @@ func (c *CoursesAnnouncementsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4752,12 +4739,11 @@ func (c *CoursesAnnouncementsGetAddOnContextCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnContext") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4922,12 +4908,11 @@ func (c *CoursesAnnouncementsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5050,8 +5035,7 @@ func (c *CoursesAnnouncementsModifyAssigneesCall) Header() http.Header { func (c *CoursesAnnouncementsModifyAssigneesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyannouncementassigneesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifyannouncementassigneesrequest) if err != nil { return nil, err } @@ -5174,8 +5158,7 @@ func (c *CoursesAnnouncementsPatchCall) Header() http.Header { func (c *CoursesAnnouncementsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.announcement) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.announcement) if err != nil { return nil, err } @@ -5304,8 +5287,7 @@ func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) Header() http.Header { func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -5424,12 +5406,11 @@ func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) Header() http.Header { func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5552,12 +5533,11 @@ func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5698,12 +5678,11 @@ func (c *CoursesAnnouncementsAddOnAttachmentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5849,8 +5828,7 @@ func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) Header() http.Header { func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -5965,8 +5943,7 @@ func (c *CoursesCourseWorkCreateCall) Header() http.Header { func (c *CoursesCourseWorkCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.coursework) if err != nil { return nil, err } @@ -6077,12 +6054,11 @@ func (c *CoursesCourseWorkDeleteCall) Header() http.Header { func (c *CoursesCourseWorkDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6193,12 +6169,11 @@ func (c *CoursesCourseWorkGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6340,12 +6315,11 @@ func (c *CoursesCourseWorkGetAddOnContextCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnContext") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6510,12 +6484,11 @@ func (c *CoursesCourseWorkListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6638,8 +6611,7 @@ func (c *CoursesCourseWorkModifyAssigneesCall) Header() http.Header { func (c *CoursesCourseWorkModifyAssigneesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycourseworkassigneesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifycourseworkassigneesrequest) if err != nil { return nil, err } @@ -6772,8 +6744,7 @@ func (c *CoursesCourseWorkPatchCall) Header() http.Header { func (c *CoursesCourseWorkPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.coursework) if err != nil { return nil, err } @@ -6916,8 +6887,7 @@ func (c *CoursesCourseWorkUpdateRubricCall) Header() http.Header { func (c *CoursesCourseWorkUpdateRubricCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rubric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rubric) if err != nil { return nil, err } @@ -7046,8 +7016,7 @@ func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) Header() http.Header { func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -7166,12 +7135,11 @@ func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) Header() http.Header { func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7294,12 +7262,11 @@ func (c *CoursesCourseWorkAddOnAttachmentsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7440,12 +7407,11 @@ func (c *CoursesCourseWorkAddOnAttachmentsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7591,8 +7557,7 @@ func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) Header() http.Header { func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -7726,12 +7691,11 @@ func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7861,8 +7825,7 @@ func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) Header() func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachmentstudentsubmission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachmentstudentsubmission) if err != nil { return nil, err } @@ -7983,8 +7946,7 @@ func (c *CoursesCourseWorkRubricsCreateCall) Header() http.Header { func (c *CoursesCourseWorkRubricsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rubric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rubric) if err != nil { return nil, err } @@ -8099,12 +8061,11 @@ func (c *CoursesCourseWorkRubricsDeleteCall) Header() http.Header { func (c *CoursesCourseWorkRubricsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8218,12 +8179,11 @@ func (c *CoursesCourseWorkRubricsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8351,12 +8311,11 @@ func (c *CoursesCourseWorkRubricsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8510,8 +8469,7 @@ func (c *CoursesCourseWorkRubricsPatchCall) Header() http.Header { func (c *CoursesCourseWorkRubricsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rubric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rubric) if err != nil { return nil, err } @@ -8634,12 +8592,11 @@ func (c *CoursesCourseWorkStudentSubmissionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8825,12 +8782,11 @@ func (c *CoursesCourseWorkStudentSubmissionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8962,8 +8918,7 @@ func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Header() http func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyattachmentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifyattachmentsrequest) if err != nil { return nil, err } @@ -9093,8 +9048,7 @@ func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Header() http.Header { func (c *CoursesCourseWorkStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.studentsubmission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.studentsubmission) if err != nil { return nil, err } @@ -9217,8 +9171,7 @@ func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Header() http.Header { func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reclaimstudentsubmissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reclaimstudentsubmissionrequest) if err != nil { return nil, err } @@ -9339,8 +9292,7 @@ func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Header() http.Header { func (c *CoursesCourseWorkStudentSubmissionsReturnCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnstudentsubmissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnstudentsubmissionrequest) if err != nil { return nil, err } @@ -9460,8 +9412,7 @@ func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Header() http.Header { func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.turninstudentsubmissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.turninstudentsubmissionrequest) if err != nil { return nil, err } @@ -9570,8 +9521,7 @@ func (c *CoursesCourseWorkMaterialsCreateCall) Header() http.Header { func (c *CoursesCourseWorkMaterialsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.courseworkmaterial) if err != nil { return nil, err } @@ -9683,12 +9633,11 @@ func (c *CoursesCourseWorkMaterialsDeleteCall) Header() http.Header { func (c *CoursesCourseWorkMaterialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9799,12 +9748,11 @@ func (c *CoursesCourseWorkMaterialsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9947,12 +9895,11 @@ func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnContext") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10136,12 +10083,11 @@ func (c *CoursesCourseWorkMaterialsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10278,8 +10224,7 @@ func (c *CoursesCourseWorkMaterialsPatchCall) Header() http.Header { func (c *CoursesCourseWorkMaterialsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.courseworkmaterial) if err != nil { return nil, err } @@ -10409,8 +10354,7 @@ func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) Header() http.Hea func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -10529,12 +10473,11 @@ func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) Header() http.Hea func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10657,12 +10600,11 @@ func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10803,12 +10745,11 @@ func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10954,8 +10895,7 @@ func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) Header() http.Head func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -11107,12 +11047,11 @@ func (c *CoursesPostsGetAddOnContextCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnContext") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11233,8 +11172,7 @@ func (c *CoursesPostsAddOnAttachmentsCreateCall) Header() http.Header { func (c *CoursesPostsAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -11353,12 +11291,11 @@ func (c *CoursesPostsAddOnAttachmentsDeleteCall) Header() http.Header { func (c *CoursesPostsAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11481,12 +11418,11 @@ func (c *CoursesPostsAddOnAttachmentsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11627,12 +11563,11 @@ func (c *CoursesPostsAddOnAttachmentsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11778,8 +11713,7 @@ func (c *CoursesPostsAddOnAttachmentsPatchCall) Header() http.Header { func (c *CoursesPostsAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachment) if err != nil { return nil, err } @@ -11913,12 +11847,11 @@ func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12048,8 +11981,7 @@ func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) Header() http. func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachmentstudentsubmission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addonattachmentstudentsubmission) if err != nil { return nil, err } @@ -12174,8 +12106,7 @@ func (c *CoursesStudentsCreateCall) Header() http.Header { func (c *CoursesStudentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.student) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.student) if err != nil { return nil, err } @@ -12282,12 +12213,11 @@ func (c *CoursesStudentsDeleteCall) Header() http.Header { func (c *CoursesStudentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12399,12 +12329,11 @@ func (c *CoursesStudentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12528,12 +12457,11 @@ func (c *CoursesStudentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12659,8 +12587,7 @@ func (c *CoursesTeachersCreateCall) Header() http.Header { func (c *CoursesTeachersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.teacher) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.teacher) if err != nil { return nil, err } @@ -12771,12 +12698,11 @@ func (c *CoursesTeachersDeleteCall) Header() http.Header { func (c *CoursesTeachersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12888,12 +12814,11 @@ func (c *CoursesTeachersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13017,12 +12942,11 @@ func (c *CoursesTeachersListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13141,8 +13065,7 @@ func (c *CoursesTopicsCreateCall) Header() http.Header { func (c *CoursesTopicsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -13248,12 +13171,11 @@ func (c *CoursesTopicsDeleteCall) Header() http.Header { func (c *CoursesTopicsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13363,12 +13285,11 @@ func (c *CoursesTopicsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13493,12 +13414,11 @@ func (c *CoursesTopicsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13632,8 +13552,7 @@ func (c *CoursesTopicsPatchCall) Header() http.Header { func (c *CoursesTopicsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -13740,12 +13659,11 @@ func (c *InvitationsAcceptCall) Header() http.Header { func (c *InvitationsAcceptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}:accept") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13841,8 +13759,7 @@ func (c *InvitationsCreateCall) Header() http.Header { func (c *InvitationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.invitation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.invitation) if err != nil { return nil, err } @@ -13940,12 +13857,11 @@ func (c *InvitationsDeleteCall) Header() http.Header { func (c *InvitationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14050,12 +13966,11 @@ func (c *InvitationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14190,12 +14105,11 @@ func (c *InvitationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14323,8 +14237,7 @@ func (c *RegistrationsCreateCall) Header() http.Header { func (c *RegistrationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registration) if err != nil { return nil, err } @@ -14420,12 +14333,11 @@ func (c *RegistrationsDeleteCall) Header() http.Header { func (c *RegistrationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/registrations/{registrationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14532,12 +14444,11 @@ func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14651,8 +14562,7 @@ func (c *UserProfilesGuardianInvitationsCreateCall) Header() http.Header { func (c *UserProfilesGuardianInvitationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guardianinvitation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guardianinvitation) if err != nil { return nil, err } @@ -14776,12 +14686,11 @@ func (c *UserProfilesGuardianInvitationsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14942,12 +14851,11 @@ func (c *UserProfilesGuardianInvitationsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardianInvitations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15087,8 +14995,7 @@ func (c *UserProfilesGuardianInvitationsPatchCall) Header() http.Header { func (c *UserProfilesGuardianInvitationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guardianinvitation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guardianinvitation) if err != nil { return nil, err } @@ -15204,12 +15111,11 @@ func (c *UserProfilesGuardiansDeleteCall) Header() http.Header { func (c *UserProfilesGuardiansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardians/{guardianId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15327,12 +15233,11 @@ func (c *UserProfilesGuardiansGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardians/{guardianId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15480,12 +15385,11 @@ func (c *UserProfilesGuardiansListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardians") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudasset/v1/cloudasset-gen.go b/cloudasset/v1/cloudasset-gen.go index 2d85986f19d..af0f9fc58f5 100644 --- a/cloudasset/v1/cloudasset-gen.go +++ b/cloudasset/v1/cloudasset-gen.go @@ -115,7 +115,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Assets = NewAssetsService(s) + s.EffectiveIamPolicies = NewEffectiveIamPoliciesService(s) + s.Feeds = NewFeedsService(s) + s.Operations = NewOperationsService(s) + s.SavedQueries = NewSavedQueriesService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -134,14 +140,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Assets = NewAssetsService(s) - s.EffectiveIamPolicies = NewEffectiveIamPoliciesService(s) - s.Feeds = NewFeedsService(s) - s.Operations = NewOperationsService(s) - s.SavedQueries = NewSavedQueriesService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6019,12 +6018,11 @@ func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6166,12 +6164,11 @@ func (c *EffectiveIamPoliciesBatchGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}/effectiveIamPolicies:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6269,8 +6266,7 @@ func (c *FeedsCreateCall) Header() http.Header { func (c *FeedsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createfeedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createfeedrequest) if err != nil { return nil, err } @@ -6370,12 +6366,11 @@ func (c *FeedsDeleteCall) Header() http.Header { func (c *FeedsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6479,12 +6474,11 @@ func (c *FeedsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6588,12 +6582,11 @@ func (c *FeedsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/feeds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6691,8 +6684,7 @@ func (c *FeedsPatchCall) Header() http.Header { func (c *FeedsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatefeedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatefeedrequest) if err != nil { return nil, err } @@ -6804,12 +6796,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6916,8 +6907,7 @@ func (c *SavedQueriesCreateCall) Header() http.Header { func (c *SavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -7018,12 +7008,11 @@ func (c *SavedQueriesDeleteCall) Header() http.Header { func (c *SavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7128,12 +7117,11 @@ func (c *SavedQueriesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7266,12 +7254,11 @@ func (c *SavedQueriesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7395,8 +7382,7 @@ func (c *SavedQueriesPatchCall) Header() http.Header { func (c *SavedQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -7689,12 +7675,11 @@ func (c *V1AnalyzeIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}:analyzeIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7803,8 +7788,7 @@ func (c *V1AnalyzeIamPolicyLongrunningCall) Header() http.Header { func (c *V1AnalyzeIamPolicyLongrunningCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeiampolicylongrunningrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeiampolicylongrunningrequest) if err != nil { return nil, err } @@ -7954,12 +7938,11 @@ func (c *V1AnalyzeMoveCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:analyzeMove") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8102,12 +8085,11 @@ func (c *V1AnalyzeOrgPoliciesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}:analyzeOrgPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8326,12 +8308,11 @@ func (c *V1AnalyzeOrgPolicyGovernedAssetsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}:analyzeOrgPolicyGovernedAssets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8495,12 +8476,11 @@ func (c *V1AnalyzeOrgPolicyGovernedContainersCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}:analyzeOrgPolicyGovernedContainers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8691,12 +8671,11 @@ func (c *V1BatchGetAssetsHistoryCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:batchGetAssetsHistory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8801,8 +8780,7 @@ func (c *V1ExportAssetsCall) Header() http.Header { func (c *V1ExportAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportassetsrequest) if err != nil { return nil, err } @@ -8915,8 +8893,7 @@ func (c *V1QueryAssetsCall) Header() http.Header { func (c *V1QueryAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryassetsrequest) if err != nil { return nil, err } @@ -9125,12 +9102,11 @@ func (c *V1SearchAllIamPoliciesCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}:searchAllIamPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9403,12 +9379,11 @@ func (c *V1SearchAllResourcesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}:searchAllResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudasset/v1beta1/cloudasset-gen.go b/cloudasset/v1beta1/cloudasset-gen.go index 943e6c24918..6613990c7c7 100644 --- a/cloudasset/v1beta1/cloudasset-gen.go +++ b/cloudasset/v1beta1/cloudasset-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2377,8 +2376,7 @@ func (c *FoldersExportAssetsCall) Header() http.Header { func (c *FoldersExportAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportassetsrequest) if err != nil { return nil, err } @@ -2490,12 +2488,11 @@ func (c *FoldersOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2644,12 +2641,11 @@ func (c *OrganizationsBatchGetAssetsHistoryCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:batchGetAssetsHistory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2750,8 +2746,7 @@ func (c *OrganizationsExportAssetsCall) Header() http.Header { func (c *OrganizationsExportAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportassetsrequest) if err != nil { return nil, err } @@ -2863,12 +2858,11 @@ func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3017,12 +3011,11 @@ func (c *ProjectsBatchGetAssetsHistoryCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:batchGetAssetsHistory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3123,8 +3116,7 @@ func (c *ProjectsExportAssetsCall) Header() http.Header { func (c *ProjectsExportAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportassetsrequest) if err != nil { return nil, err } @@ -3236,12 +3228,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudasset/v1p1beta1/cloudasset-gen.go b/cloudasset/v1p1beta1/cloudasset-gen.go index ab4e58fd9f6..2bb2874b3d5 100644 --- a/cloudasset/v1p1beta1/cloudasset-gen.go +++ b/cloudasset/v1p1beta1/cloudasset-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.IamPolicies = NewIamPoliciesService(s) + s.Resources = NewResourcesService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.IamPolicies = NewIamPoliciesService(s) - s.Resources = NewResourcesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2202,12 +2201,11 @@ func (c *IamPoliciesSearchAllCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+scope}/iamPolicies:searchAll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2384,12 +2382,11 @@ func (c *ResourcesSearchAllCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+scope}/resources:searchAll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudasset/v1p5beta1/cloudasset-gen.go b/cloudasset/v1p5beta1/cloudasset-gen.go index 0b9d79ebe4e..e2ec837cb16 100644 --- a/cloudasset/v1p5beta1/cloudasset-gen.go +++ b/cloudasset/v1p5beta1/cloudasset-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Assets = NewAssetsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Assets = NewAssetsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2165,12 +2164,11 @@ func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p5beta1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudasset/v1p7beta1/cloudasset-gen.go b/cloudasset/v1p7beta1/cloudasset-gen.go index 882ef93031a..34dadb2e43b 100644 --- a/cloudasset/v1p7beta1/cloudasset-gen.go +++ b/cloudasset/v1p7beta1/cloudasset-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.V1p7beta1 = NewV1p7beta1Service(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.V1p7beta1 = NewV1p7beta1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2279,12 +2278,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p7beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2387,8 +2385,7 @@ func (c *V1p7beta1ExportAssetsCall) Header() http.Header { func (c *V1p7beta1ExportAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassetv1p7beta1exportassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudassetv1p7beta1exportassetsrequest) if err != nil { return nil, err } diff --git a/cloudbilling/v1/cloudbilling-gen.go b/cloudbilling/v1/cloudbilling-gen.go index 2499316b4d2..bcb57927e72 100644 --- a/cloudbilling/v1/cloudbilling-gen.go +++ b/cloudbilling/v1/cloudbilling-gen.go @@ -128,7 +128,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -147,12 +151,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -1327,8 +1326,7 @@ func (c *BillingAccountsCreateCall) Header() http.Header { func (c *BillingAccountsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.billingaccount) if err != nil { return nil, err } @@ -1438,12 +1436,11 @@ func (c *BillingAccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1567,12 +1564,11 @@ func (c *BillingAccountsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1708,12 +1704,11 @@ func (c *BillingAccountsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/billingAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1827,8 +1822,7 @@ func (c *BillingAccountsMoveCall) Header() http.Header { func (c *BillingAccountsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movebillingaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movebillingaccountrequest) if err != nil { return nil, err } @@ -1939,8 +1933,7 @@ func (c *BillingAccountsPatchCall) Header() http.Header { func (c *BillingAccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.billingaccount) if err != nil { return nil, err } @@ -2046,8 +2039,7 @@ func (c *BillingAccountsSetIamPolicyCall) Header() http.Header { func (c *BillingAccountsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2153,8 +2145,7 @@ func (c *BillingAccountsTestIamPermissionsCall) Header() http.Header { func (c *BillingAccountsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2286,12 +2277,11 @@ func (c *BillingAccountsProjectsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2418,8 +2408,7 @@ func (c *BillingAccountsSubAccountsCreateCall) Header() http.Header { func (c *BillingAccountsSubAccountsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.billingaccount) if err != nil { return nil, err } @@ -2561,12 +2550,11 @@ func (c *BillingAccountsSubAccountsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2693,8 +2681,7 @@ func (c *OrganizationsBillingAccountsCreateCall) Header() http.Header { func (c *OrganizationsBillingAccountsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.billingaccount) if err != nil { return nil, err } @@ -2836,12 +2823,11 @@ func (c *OrganizationsBillingAccountsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/billingAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2973,12 +2959,11 @@ func (c *OrganizationsBillingAccountsMoveCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+destinationParent}/{+name}:move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3086,12 +3071,11 @@ func (c *ProjectsGetBillingInfoCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3210,8 +3194,7 @@ func (c *ProjectsUpdateBillingInfoCall) Header() http.Header { func (c *ProjectsUpdateBillingInfoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectbillinginfo) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectbillinginfo) if err != nil { return nil, err } @@ -3334,12 +3317,11 @@ func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3506,12 +3488,11 @@ func (c *ServicesSkusListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/skus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudbilling/v1beta/cloudbilling-gen.go b/cloudbilling/v1beta/cloudbilling-gen.go index 8858a08097f..3161e5a2e05 100644 --- a/cloudbilling/v1beta/cloudbilling-gen.go +++ b/cloudbilling/v1beta/cloudbilling-gen.go @@ -128,7 +128,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) + s.SkuGroups = NewSkuGroupsService(s) + s.Skus = NewSkusService(s) + s.V1beta = NewV1betaService(s) if err != nil { return nil, err } @@ -147,12 +151,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - s.SkuGroups = NewSkuGroupsService(s) - s.Skus = NewSkusService(s) - s.V1beta = NewV1betaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3464,8 +3463,7 @@ func (c *BillingAccountsEstimateCostScenarioCall) Header() http.Header { func (c *BillingAccountsEstimateCostScenarioCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.estimatecostscenarioforbillingaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.estimatecostscenarioforbillingaccountrequest) if err != nil { return nil, err } @@ -3577,12 +3575,11 @@ func (c *BillingAccountsServicesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3702,12 +3699,11 @@ func (c *BillingAccountsServicesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3832,12 +3828,11 @@ func (c *BillingAccountsSkuGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3957,12 +3952,11 @@ func (c *BillingAccountsSkuGroupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/skuGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4087,12 +4081,11 @@ func (c *BillingAccountsSkuGroupsSkusGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4212,12 +4205,11 @@ func (c *BillingAccountsSkuGroupsSkusListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/skus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4342,12 +4334,11 @@ func (c *BillingAccountsSkusGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4477,12 +4468,11 @@ func (c *BillingAccountsSkusListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/skus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4615,12 +4605,11 @@ func (c *BillingAccountsSkusPriceGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4750,12 +4739,11 @@ func (c *BillingAccountsSkusPricesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/prices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4879,12 +4867,11 @@ func (c *SkuGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4999,12 +4986,11 @@ func (c *SkuGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/skuGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5128,12 +5114,11 @@ func (c *SkuGroupsSkusGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5254,12 +5239,11 @@ func (c *SkuGroupsSkusListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/skus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5390,12 +5374,11 @@ func (c *SkusPriceGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5523,12 +5506,11 @@ func (c *SkusPricesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/prices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5639,8 +5621,7 @@ func (c *V1betaEstimateCostScenarioCall) Header() http.Header { func (c *V1betaEstimateCostScenarioCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.estimatecostscenariowithlistpricerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.estimatecostscenariowithlistpricerequest) if err != nil { return nil, err } diff --git a/cloudbuild/v1/cloudbuild-gen.go b/cloudbuild/v1/cloudbuild-gen.go index b015912efcc..f2c445a6e4a 100644 --- a/cloudbuild/v1/cloudbuild-gen.go +++ b/cloudbuild/v1/cloudbuild-gen.go @@ -115,7 +115,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.GithubDotComWebhook = NewGithubDotComWebhookService(s) + s.Locations = NewLocationsService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -134,13 +139,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.GithubDotComWebhook = NewGithubDotComWebhookService(s) - s.Locations = NewLocationsService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4427,8 +4426,7 @@ func (c *GithubDotComWebhookReceiveCall) Header() http.Header { func (c *GithubDotComWebhookReceiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } @@ -4534,8 +4532,7 @@ func (c *LocationsRegionalWebhookCall) Header() http.Header { func (c *LocationsRegionalWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } @@ -4643,8 +4640,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4756,12 +4752,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4856,8 +4851,7 @@ func (c *ProjectsBuildsApproveCall) Header() http.Header { func (c *ProjectsBuildsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvebuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approvebuildrequest) if err != nil { return nil, err } @@ -4960,8 +4954,7 @@ func (c *ProjectsBuildsCancelCall) Header() http.Header { func (c *ProjectsBuildsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelbuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelbuildrequest) if err != nil { return nil, err } @@ -5072,8 +5065,7 @@ func (c *ProjectsBuildsCreateCall) Header() http.Header { func (c *ProjectsBuildsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.build) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.build) if err != nil { return nil, err } @@ -5195,12 +5187,11 @@ func (c *ProjectsBuildsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5335,12 +5326,11 @@ func (c *ProjectsBuildsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5472,8 +5462,7 @@ func (c *ProjectsBuildsRetryCall) Header() http.Header { func (c *ProjectsBuildsRetryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.retrybuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.retrybuildrequest) if err != nil { return nil, err } @@ -5593,8 +5582,7 @@ func (c *ProjectsGithubEnterpriseConfigsCreateCall) Header() http.Header { func (c *ProjectsGithubEnterpriseConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.githubenterpriseconfig) if err != nil { return nil, err } @@ -5709,12 +5697,11 @@ func (c *ProjectsGithubEnterpriseConfigsDeleteCall) Header() http.Header { func (c *ProjectsGithubEnterpriseConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5832,12 +5819,11 @@ func (c *ProjectsGithubEnterpriseConfigsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5947,12 +5933,11 @@ func (c *ProjectsGithubEnterpriseConfigsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/githubEnterpriseConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6057,8 +6042,7 @@ func (c *ProjectsGithubEnterpriseConfigsPatchCall) Header() http.Header { func (c *ProjectsGithubEnterpriseConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.githubenterpriseconfig) if err != nil { return nil, err } @@ -6170,12 +6154,11 @@ func (c *ProjectsLocationsGetDefaultServiceAccountCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6280,8 +6263,7 @@ func (c *ProjectsLocationsBitbucketServerConfigsCreateCall) Header() http.Header func (c *ProjectsLocationsBitbucketServerConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bitbucketserverconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bitbucketserverconfig) if err != nil { return nil, err } @@ -6379,12 +6361,11 @@ func (c *ProjectsLocationsBitbucketServerConfigsDeleteCall) Header() http.Header func (c *ProjectsLocationsBitbucketServerConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6486,12 +6467,11 @@ func (c *ProjectsLocationsBitbucketServerConfigsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6614,12 +6594,11 @@ func (c *ProjectsLocationsBitbucketServerConfigsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bitbucketServerConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6743,8 +6722,7 @@ func (c *ProjectsLocationsBitbucketServerConfigsPatchCall) Header() http.Header func (c *ProjectsLocationsBitbucketServerConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bitbucketserverconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bitbucketserverconfig) if err != nil { return nil, err } @@ -6848,8 +6826,7 @@ func (c *ProjectsLocationsBitbucketServerConfigsRemoveBitbucketServerConnectedRe func (c *ProjectsLocationsBitbucketServerConfigsRemoveBitbucketServerConnectedRepositoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removebitbucketserverconnectedrepositoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removebitbucketserverconnectedrepositoryrequest) if err != nil { return nil, err } @@ -6951,8 +6928,7 @@ func (c *ProjectsLocationsBitbucketServerConfigsConnectedRepositoriesBatchCreate func (c *ProjectsLocationsBitbucketServerConfigsConnectedRepositoriesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatebitbucketserverconnectedrepositoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatebitbucketserverconnectedrepositoriesrequest) if err != nil { return nil, err } @@ -7081,12 +7057,11 @@ func (c *ProjectsLocationsBitbucketServerConfigsReposListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/repos") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7203,8 +7178,7 @@ func (c *ProjectsLocationsBuildsApproveCall) Header() http.Header { func (c *ProjectsLocationsBuildsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvebuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approvebuildrequest) if err != nil { return nil, err } @@ -7305,8 +7279,7 @@ func (c *ProjectsLocationsBuildsCancelCall) Header() http.Header { func (c *ProjectsLocationsBuildsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelbuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelbuildrequest) if err != nil { return nil, err } @@ -7417,8 +7390,7 @@ func (c *ProjectsLocationsBuildsCreateCall) Header() http.Header { func (c *ProjectsLocationsBuildsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.build) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.build) if err != nil { return nil, err } @@ -7544,12 +7516,11 @@ func (c *ProjectsLocationsBuildsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7684,12 +7655,11 @@ func (c *ProjectsLocationsBuildsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/builds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7819,8 +7789,7 @@ func (c *ProjectsLocationsBuildsRetryCall) Header() http.Header { func (c *ProjectsLocationsBuildsRetryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.retrybuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.retrybuildrequest) if err != nil { return nil, err } @@ -7931,8 +7900,7 @@ func (c *ProjectsLocationsGitLabConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsGitLabConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gitlabconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gitlabconfig) if err != nil { return nil, err } @@ -8030,12 +7998,11 @@ func (c *ProjectsLocationsGitLabConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGitLabConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8137,12 +8104,11 @@ func (c *ProjectsLocationsGitLabConfigsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8263,12 +8229,11 @@ func (c *ProjectsLocationsGitLabConfigsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gitLabConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8391,8 +8356,7 @@ func (c *ProjectsLocationsGitLabConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsGitLabConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gitlabconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gitlabconfig) if err != nil { return nil, err } @@ -8494,8 +8458,7 @@ func (c *ProjectsLocationsGitLabConfigsRemoveGitLabConnectedRepositoryCall) Head func (c *ProjectsLocationsGitLabConfigsRemoveGitLabConnectedRepositoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removegitlabconnectedrepositoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removegitlabconnectedrepositoryrequest) if err != nil { return nil, err } @@ -8597,8 +8560,7 @@ func (c *ProjectsLocationsGitLabConfigsConnectedRepositoriesBatchCreateCall) Hea func (c *ProjectsLocationsGitLabConfigsConnectedRepositoriesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreategitlabconnectedrepositoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreategitlabconnectedrepositoriesrequest) if err != nil { return nil, err } @@ -8726,12 +8688,11 @@ func (c *ProjectsLocationsGitLabConfigsReposListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/repos") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8864,8 +8825,7 @@ func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) Header() http.Heade func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.githubenterpriseconfig) if err != nil { return nil, err } @@ -8980,12 +8940,11 @@ func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) Header() http.Heade func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9103,12 +9062,11 @@ func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9218,12 +9176,11 @@ func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/githubEnterpriseConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9328,8 +9285,7 @@ func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) Header() http.Header func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.githubenterpriseconfig) if err != nil { return nil, err } @@ -9437,8 +9393,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -9550,12 +9505,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9655,8 +9609,7 @@ func (c *ProjectsLocationsTriggersCreateCall) Header() http.Header { func (c *ProjectsLocationsTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buildtrigger) if err != nil { return nil, err } @@ -9769,12 +9722,11 @@ func (c *ProjectsLocationsTriggersDeleteCall) Header() http.Header { func (c *ProjectsLocationsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9891,12 +9843,11 @@ func (c *ProjectsLocationsTriggersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10020,12 +9971,11 @@ func (c *ProjectsLocationsTriggersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/triggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10164,8 +10114,7 @@ func (c *ProjectsLocationsTriggersPatchCall) Header() http.Header { func (c *ProjectsLocationsTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buildtrigger) if err != nil { return nil, err } @@ -10271,8 +10220,7 @@ func (c *ProjectsLocationsTriggersRunCall) Header() http.Header { func (c *ProjectsLocationsTriggersRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runbuildtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runbuildtriggerrequest) if err != nil { return nil, err } @@ -10395,8 +10343,7 @@ func (c *ProjectsLocationsTriggersWebhookCall) Header() http.Header { func (c *ProjectsLocationsTriggersWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } @@ -10514,8 +10461,7 @@ func (c *ProjectsLocationsWorkerPoolsCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkerPoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workerpool) if err != nil { return nil, err } @@ -10636,12 +10582,11 @@ func (c *ProjectsLocationsWorkerPoolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWorkerPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10744,12 +10689,11 @@ func (c *ProjectsLocationsWorkerPoolsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10868,12 +10812,11 @@ func (c *ProjectsLocationsWorkerPoolsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workerPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11005,8 +10948,7 @@ func (c *ProjectsLocationsWorkerPoolsPatchCall) Header() http.Header { func (c *ProjectsLocationsWorkerPoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workerpool) if err != nil { return nil, err } @@ -11113,8 +11055,7 @@ func (c *ProjectsTriggersCreateCall) Header() http.Header { func (c *ProjectsTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buildtrigger) if err != nil { return nil, err } @@ -11222,12 +11163,11 @@ func (c *ProjectsTriggersDeleteCall) Header() http.Header { func (c *ProjectsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{triggerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11341,12 +11281,11 @@ func (c *ProjectsTriggersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{triggerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11470,12 +11409,11 @@ func (c *ProjectsTriggersListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11601,8 +11539,7 @@ func (c *ProjectsTriggersPatchCall) Header() http.Header { func (c *ProjectsTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buildtrigger) if err != nil { return nil, err } @@ -11718,8 +11655,7 @@ func (c *ProjectsTriggersRunCall) Header() http.Header { func (c *ProjectsTriggersRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reposource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reposource) if err != nil { return nil, err } @@ -11839,8 +11775,7 @@ func (c *ProjectsTriggersWebhookCall) Header() http.Header { func (c *ProjectsTriggersWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } @@ -11946,8 +11881,7 @@ func (c *V1WebhookCall) Header() http.Header { func (c *V1WebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } diff --git a/cloudbuild/v2/cloudbuild-gen.go b/cloudbuild/v2/cloudbuild-gen.go index 408e680073e..129cef00624 100644 --- a/cloudbuild/v2/cloudbuild-gen.go +++ b/cloudbuild/v2/cloudbuild-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3051,12 +3050,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3182,12 +3180,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3311,8 +3308,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -3426,12 +3422,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3548,12 +3543,11 @@ func (c *ProjectsLocationsConnectionsFetchLinkableRepositoriesCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+connection}:fetchLinkableRepositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3678,12 +3672,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3805,12 +3798,11 @@ func (c *ProjectsLocationsConnectionsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3926,12 +3918,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4071,8 +4062,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -4181,8 +4171,7 @@ func (c *ProjectsLocationsConnectionsProcessWebhookCall) Header() http.Header { func (c *ProjectsLocationsConnectionsProcessWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } @@ -4286,8 +4275,7 @@ func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4394,8 +4382,7 @@ func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4497,8 +4484,7 @@ func (c *ProjectsLocationsConnectionsRepositoriesAccessReadTokenCall) Header() h func (c *ProjectsLocationsConnectionsRepositoriesAccessReadTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchreadtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchreadtokenrequest) if err != nil { return nil, err } @@ -4600,8 +4586,7 @@ func (c *ProjectsLocationsConnectionsRepositoriesAccessReadWriteTokenCall) Heade func (c *ProjectsLocationsConnectionsRepositoriesAccessReadWriteTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchreadwritetokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchreadwritetokenrequest) if err != nil { return nil, err } @@ -4704,8 +4689,7 @@ func (c *ProjectsLocationsConnectionsRepositoriesBatchCreateCall) Header() http. func (c *ProjectsLocationsConnectionsRepositoriesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreaterepositoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreaterepositoriesrequest) if err != nil { return nil, err } @@ -4816,8 +4800,7 @@ func (c *ProjectsLocationsConnectionsRepositoriesCreateCall) Header() http.Heade func (c *ProjectsLocationsConnectionsRepositoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -4931,12 +4914,11 @@ func (c *ProjectsLocationsConnectionsRepositoriesDeleteCall) Header() http.Heade func (c *ProjectsLocationsConnectionsRepositoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5064,12 +5046,11 @@ func (c *ProjectsLocationsConnectionsRepositoriesFetchGitRefsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+repository}:fetchGitRefs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5194,12 +5175,11 @@ func (c *ProjectsLocationsConnectionsRepositoriesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5324,12 +5304,11 @@ func (c *ProjectsLocationsConnectionsRepositoriesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/repositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5451,8 +5430,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5564,12 +5542,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudchannel/v1/cloudchannel-gen.go b/cloudchannel/v1/cloudchannel-gen.go index 973637b34c3..ff981faf0e2 100644 --- a/cloudchannel/v1/cloudchannel-gen.go +++ b/cloudchannel/v1/cloudchannel-gen.go @@ -123,7 +123,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Integrators = NewIntegratorsService(s) + s.Operations = NewOperationsService(s) + s.Products = NewProductsService(s) if err != nil { return nil, err } @@ -142,12 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Integrators = NewIntegratorsService(s) - s.Operations = NewOperationsService(s) - s.Products = NewProductsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5332,8 +5331,7 @@ func (c *AccountsCheckCloudIdentityAccountsExistCall) Header() http.Header { func (c *AccountsCheckCloudIdentityAccountsExistCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1checkcloudidentityaccountsexistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1checkcloudidentityaccountsexistrequest) if err != nil { return nil, err } @@ -5480,12 +5478,11 @@ func (c *AccountsListSubscribersCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+account}:listSubscribers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5610,8 +5607,7 @@ func (c *AccountsListTransferableOffersCall) Header() http.Header { func (c *AccountsListTransferableOffersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1listtransferableoffersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1listtransferableoffersrequest) if err != nil { return nil, err } @@ -5742,8 +5738,7 @@ func (c *AccountsListTransferableSkusCall) Header() http.Header { func (c *AccountsListTransferableSkusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1listtransferableskusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1listtransferableskusrequest) if err != nil { return nil, err } @@ -5876,8 +5871,7 @@ func (c *AccountsRegisterCall) Header() http.Header { func (c *AccountsRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1registersubscriberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1registersubscriberrequest) if err != nil { return nil, err } @@ -5992,8 +5986,7 @@ func (c *AccountsUnregisterCall) Header() http.Header { func (c *AccountsUnregisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1unregistersubscriberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1unregistersubscriberrequest) if err != nil { return nil, err } @@ -6108,8 +6101,7 @@ func (c *AccountsChannelPartnerLinksCreateCall) Header() http.Header { func (c *AccountsChannelPartnerLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1channelpartnerlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1channelpartnerlink) if err != nil { return nil, err } @@ -6247,12 +6239,11 @@ func (c *AccountsChannelPartnerLinksGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6398,12 +6389,11 @@ func (c *AccountsChannelPartnerLinksListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channelPartnerLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6530,8 +6520,7 @@ func (c *AccountsChannelPartnerLinksPatchCall) Header() http.Header { func (c *AccountsChannelPartnerLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1updatechannelpartnerlinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1updatechannelpartnerlinkrequest) if err != nil { return nil, err } @@ -6658,8 +6647,7 @@ func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsCreateCall) He func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1channelpartnerrepricingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1channelpartnerrepricingconfig) if err != nil { return nil, err } @@ -6766,12 +6754,11 @@ func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsDeleteCall) He func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6882,12 +6869,11 @@ func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7034,12 +7020,11 @@ func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsListCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channelPartnerRepricingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7171,8 +7156,7 @@ func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsPatchCall) Hea func (c *AccountsChannelPartnerLinksChannelPartnerRepricingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1channelpartnerrepricingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1channelpartnerrepricingconfig) if err != nil { return nil, err } @@ -7281,8 +7265,7 @@ func (c *AccountsChannelPartnerLinksCustomersCreateCall) Header() http.Header { func (c *AccountsChannelPartnerLinksCustomersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1customer) if err != nil { return nil, err } @@ -7385,12 +7368,11 @@ func (c *AccountsChannelPartnerLinksCustomersDeleteCall) Header() http.Header { func (c *AccountsChannelPartnerLinksCustomersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7499,12 +7481,11 @@ func (c *AccountsChannelPartnerLinksCustomersGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7609,8 +7590,7 @@ func (c *AccountsChannelPartnerLinksCustomersImportCall) Header() http.Header { func (c *AccountsChannelPartnerLinksCustomersImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1importcustomerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1importcustomerrequest) if err != nil { return nil, err } @@ -7752,12 +7732,11 @@ func (c *AccountsChannelPartnerLinksCustomersListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7884,8 +7863,7 @@ func (c *AccountsChannelPartnerLinksCustomersPatchCall) Header() http.Header { func (c *AccountsChannelPartnerLinksCustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1customer) if err != nil { return nil, err } @@ -7994,8 +7972,7 @@ func (c *AccountsCustomersCreateCall) Header() http.Header { func (c *AccountsCustomersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1customer) if err != nil { return nil, err } @@ -8098,12 +8075,11 @@ func (c *AccountsCustomersDeleteCall) Header() http.Header { func (c *AccountsCustomersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8212,12 +8188,11 @@ func (c *AccountsCustomersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8322,8 +8297,7 @@ func (c *AccountsCustomersImportCall) Header() http.Header { func (c *AccountsCustomersImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1importcustomerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1importcustomerrequest) if err != nil { return nil, err } @@ -8465,12 +8439,11 @@ func (c *AccountsCustomersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8671,12 +8644,11 @@ func (c *AccountsCustomersListPurchasableOffersCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}:listPurchasableOffers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8860,12 +8832,11 @@ func (c *AccountsCustomersListPurchasableSkusCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}:listPurchasableSkus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8992,8 +8963,7 @@ func (c *AccountsCustomersPatchCall) Header() http.Header { func (c *AccountsCustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1customer) if err != nil { return nil, err } @@ -9108,8 +9078,7 @@ func (c *AccountsCustomersProvisionCloudIdentityCall) Header() http.Header { func (c *AccountsCustomersProvisionCloudIdentityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1provisioncloudidentityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1provisioncloudidentityrequest) if err != nil { return nil, err } @@ -9235,12 +9204,11 @@ func (c *AccountsCustomersQueryEligibleBillingAccountsCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+customer}:queryEligibleBillingAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9353,8 +9321,7 @@ func (c *AccountsCustomersTransferEntitlementsCall) Header() http.Header { func (c *AccountsCustomersTransferEntitlementsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1transferentitlementsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1transferentitlementsrequest) if err != nil { return nil, err } @@ -9474,8 +9441,7 @@ func (c *AccountsCustomersTransferEntitlementsToGoogleCall) Header() http.Header func (c *AccountsCustomersTransferEntitlementsToGoogleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1transferentitlementstogooglerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1transferentitlementstogooglerequest) if err != nil { return nil, err } @@ -9601,8 +9567,7 @@ func (c *AccountsCustomersCustomerRepricingConfigsCreateCall) Header() http.Head func (c *AccountsCustomersCustomerRepricingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1customerrepricingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1customerrepricingconfig) if err != nil { return nil, err } @@ -9710,12 +9675,11 @@ func (c *AccountsCustomersCustomerRepricingConfigsDeleteCall) Header() http.Head func (c *AccountsCustomersCustomerRepricingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9826,12 +9790,11 @@ func (c *AccountsCustomersCustomerRepricingConfigsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9975,12 +9938,11 @@ func (c *AccountsCustomersCustomerRepricingConfigsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customerRepricingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10111,8 +10073,7 @@ func (c *AccountsCustomersCustomerRepricingConfigsPatchCall) Header() http.Heade func (c *AccountsCustomersCustomerRepricingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1customerrepricingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1customerrepricingconfig) if err != nil { return nil, err } @@ -10230,8 +10191,7 @@ func (c *AccountsCustomersEntitlementsActivateCall) Header() http.Header { func (c *AccountsCustomersEntitlementsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1activateentitlementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1activateentitlementrequest) if err != nil { return nil, err } @@ -10349,8 +10309,7 @@ func (c *AccountsCustomersEntitlementsCancelCall) Header() http.Header { func (c *AccountsCustomersEntitlementsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1cancelentitlementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1cancelentitlementrequest) if err != nil { return nil, err } @@ -10464,8 +10423,7 @@ func (c *AccountsCustomersEntitlementsChangeOfferCall) Header() http.Header { func (c *AccountsCustomersEntitlementsChangeOfferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1changeofferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1changeofferrequest) if err != nil { return nil, err } @@ -10579,8 +10537,7 @@ func (c *AccountsCustomersEntitlementsChangeParametersCall) Header() http.Header func (c *AccountsCustomersEntitlementsChangeParametersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1changeparametersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1changeparametersrequest) if err != nil { return nil, err } @@ -10695,8 +10652,7 @@ func (c *AccountsCustomersEntitlementsChangeRenewalSettingsCall) Header() http.H func (c *AccountsCustomersEntitlementsChangeRenewalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1changerenewalsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1changerenewalsettingsrequest) if err != nil { return nil, err } @@ -10821,8 +10777,7 @@ func (c *AccountsCustomersEntitlementsCreateCall) Header() http.Header { func (c *AccountsCustomersEntitlementsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1createentitlementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1createentitlementrequest) if err != nil { return nil, err } @@ -10939,12 +10894,11 @@ func (c *AccountsCustomersEntitlementsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11070,12 +11024,11 @@ func (c *AccountsCustomersEntitlementsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entitlements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11237,12 +11190,11 @@ func (c *AccountsCustomersEntitlementsListEntitlementChangesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:listEntitlementChanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11372,12 +11324,11 @@ func (c *AccountsCustomersEntitlementsLookupOfferCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+entitlement}:lookupOffer") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11484,8 +11435,7 @@ func (c *AccountsCustomersEntitlementsStartPaidServiceCall) Header() http.Header func (c *AccountsCustomersEntitlementsStartPaidServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1startpaidservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1startpaidservicerequest) if err != nil { return nil, err } @@ -11598,8 +11548,7 @@ func (c *AccountsCustomersEntitlementsSuspendCall) Header() http.Header { func (c *AccountsCustomersEntitlementsSuspendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1suspendentitlementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1suspendentitlementrequest) if err != nil { return nil, err } @@ -11755,12 +11704,11 @@ func (c *AccountsOffersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/offers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11880,8 +11828,7 @@ func (c *AccountsReportJobsFetchReportResultsCall) Header() http.Header { func (c *AccountsReportJobsFetchReportResultsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1fetchreportresultsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1fetchreportresultsrequest) if err != nil { return nil, err } @@ -12044,12 +11991,11 @@ func (c *AccountsReportsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12181,8 +12127,7 @@ func (c *AccountsReportsRunCall) Header() http.Header { func (c *AccountsReportsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1runreportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1runreportjobrequest) if err != nil { return nil, err } @@ -12321,12 +12266,11 @@ func (c *AccountsSkuGroupsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/skuGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12477,12 +12421,11 @@ func (c *AccountsSkuGroupsBillableSkusListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/billableSkus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12642,12 +12585,11 @@ func (c *IntegratorsListSubscribersCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+integrator}:listSubscribers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12772,8 +12714,7 @@ func (c *IntegratorsRegisterSubscriberCall) Header() http.Header { func (c *IntegratorsRegisterSubscriberCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1registersubscriberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1registersubscriberrequest) if err != nil { return nil, err } @@ -12888,8 +12829,7 @@ func (c *IntegratorsUnregisterSubscriberCall) Header() http.Header { func (c *IntegratorsUnregisterSubscriberCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudchannelv1unregistersubscriberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudchannelv1unregistersubscriberrequest) if err != nil { return nil, err } @@ -12998,8 +12938,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -13101,12 +13040,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13211,12 +13149,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13340,12 +13277,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13498,12 +13434,11 @@ func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13659,12 +13594,11 @@ func (c *ProductsSkusListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/skus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudcontrolspartner/v1/cloudcontrolspartner-gen.go b/cloudcontrolspartner/v1/cloudcontrolspartner-gen.go index 3a439d01c7d..2e323541a3c 100644 --- a/cloudcontrolspartner/v1/cloudcontrolspartner-gen.go +++ b/cloudcontrolspartner/v1/cloudcontrolspartner-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1163,12 +1162,11 @@ func (c *OrganizationsLocationsGetPartnerCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1270,8 +1268,7 @@ func (c *OrganizationsLocationsCustomersCreateCall) Header() http.Header { func (c *OrganizationsLocationsCustomersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1370,12 +1367,11 @@ func (c *OrganizationsLocationsCustomersDeleteCall) Header() http.Header { func (c *OrganizationsLocationsCustomersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1478,12 +1474,11 @@ func (c *OrganizationsLocationsCustomersGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1616,12 +1611,11 @@ func (c *OrganizationsLocationsCustomersListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1743,8 +1737,7 @@ func (c *OrganizationsLocationsCustomersPatchCall) Header() http.Header { func (c *OrganizationsLocationsCustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1856,12 +1849,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1965,12 +1957,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsGetEkmConnectionsCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2074,12 +2065,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsGetPartnerPermissionsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2212,12 +2202,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2373,12 +2362,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsAccessApprovalRequestsListCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/accessApprovalRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2504,12 +2492,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsViolationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2663,12 +2650,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsViolationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/violations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudcontrolspartner/v1beta/cloudcontrolspartner-gen.go b/cloudcontrolspartner/v1beta/cloudcontrolspartner-gen.go index 4eb0f730ad0..90a601ebc7a 100644 --- a/cloudcontrolspartner/v1beta/cloudcontrolspartner-gen.go +++ b/cloudcontrolspartner/v1beta/cloudcontrolspartner-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1163,12 +1162,11 @@ func (c *OrganizationsLocationsGetPartnerCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1270,8 +1268,7 @@ func (c *OrganizationsLocationsCustomersCreateCall) Header() http.Header { func (c *OrganizationsLocationsCustomersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1370,12 +1367,11 @@ func (c *OrganizationsLocationsCustomersDeleteCall) Header() http.Header { func (c *OrganizationsLocationsCustomersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1478,12 +1474,11 @@ func (c *OrganizationsLocationsCustomersGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1616,12 +1611,11 @@ func (c *OrganizationsLocationsCustomersListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1743,8 +1737,7 @@ func (c *OrganizationsLocationsCustomersPatchCall) Header() http.Header { func (c *OrganizationsLocationsCustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1856,12 +1849,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1965,12 +1957,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsGetEkmConnectionsCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2074,12 +2065,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsGetPartnerPermissionsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2212,12 +2202,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2373,12 +2362,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsAccessApprovalRequestsListCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/accessApprovalRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2504,12 +2492,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsViolationsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2663,12 +2650,11 @@ func (c *OrganizationsLocationsCustomersWorkloadsViolationsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/violations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/clouddeploy/v1/clouddeploy-gen.go b/clouddeploy/v1/clouddeploy-gen.go index f5372f4c95a..8bd78c23f3c 100644 --- a/clouddeploy/v1/clouddeploy-gen.go +++ b/clouddeploy/v1/clouddeploy-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6026,12 +6025,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6133,12 +6131,11 @@ func (c *ProjectsLocationsGetConfigCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6264,12 +6261,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6415,8 +6411,7 @@ func (c *ProjectsLocationsCustomTargetTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsCustomTargetTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customtargettype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customtargettype) if err != nil { return nil, err } @@ -6556,12 +6551,11 @@ func (c *ProjectsLocationsCustomTargetTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomTargetTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6665,12 +6659,11 @@ func (c *ProjectsLocationsCustomTargetTypesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6793,12 +6786,11 @@ func (c *ProjectsLocationsCustomTargetTypesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6933,12 +6925,11 @@ func (c *ProjectsLocationsCustomTargetTypesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customTargetTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7098,8 +7089,7 @@ func (c *ProjectsLocationsCustomTargetTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsCustomTargetTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customtargettype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customtargettype) if err != nil { return nil, err } @@ -7203,8 +7193,7 @@ func (c *ProjectsLocationsCustomTargetTypesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsCustomTargetTypesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7336,8 +7325,7 @@ func (c *ProjectsLocationsDeliveryPipelinesCreateCall) Header() http.Header { func (c *ProjectsLocationsDeliveryPipelinesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deliverypipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deliverypipeline) if err != nil { return nil, err } @@ -7485,12 +7473,11 @@ func (c *ProjectsLocationsDeliveryPipelinesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDeliveryPipelinesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7594,12 +7581,11 @@ func (c *ProjectsLocationsDeliveryPipelinesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7722,12 +7708,11 @@ func (c *ProjectsLocationsDeliveryPipelinesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7862,12 +7847,11 @@ func (c *ProjectsLocationsDeliveryPipelinesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deliveryPipelines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8027,8 +8011,7 @@ func (c *ProjectsLocationsDeliveryPipelinesPatchCall) Header() http.Header { func (c *ProjectsLocationsDeliveryPipelinesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deliverypipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deliverypipeline) if err != nil { return nil, err } @@ -8131,8 +8114,7 @@ func (c *ProjectsLocationsDeliveryPipelinesRollbackTargetCall) Header() http.Hea func (c *ProjectsLocationsDeliveryPipelinesRollbackTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacktargetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbacktargetrequest) if err != nil { return nil, err } @@ -8237,8 +8219,7 @@ func (c *ProjectsLocationsDeliveryPipelinesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsDeliveryPipelinesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8345,8 +8326,7 @@ func (c *ProjectsLocationsDeliveryPipelinesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsDeliveryPipelinesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8452,8 +8432,7 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationRunsCancelCall) Header() ht func (c *ProjectsLocationsDeliveryPipelinesAutomationRunsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelautomationrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelautomationrunrequest) if err != nil { return nil, err } @@ -8566,12 +8545,11 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationRunsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8707,12 +8685,11 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationRunsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/automationRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8860,8 +8837,7 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationsCreateCall) Header() http. func (c *ProjectsLocationsDeliveryPipelinesAutomationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.automation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.automation) if err != nil { return nil, err } @@ -9001,12 +8977,11 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationsDeleteCall) Header() http. func (c *ProjectsLocationsDeliveryPipelinesAutomationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9110,12 +9085,11 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9251,12 +9225,11 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/automations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9415,8 +9388,7 @@ func (c *ProjectsLocationsDeliveryPipelinesAutomationsPatchCall) Header() http.H func (c *ProjectsLocationsDeliveryPipelinesAutomationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.automation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.automation) if err != nil { return nil, err } @@ -9518,8 +9490,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesAbandonCall) Header() http.He func (c *ProjectsLocationsDeliveryPipelinesReleasesAbandonCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.abandonreleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abandonreleaserequest) if err != nil { return nil, err } @@ -9662,8 +9633,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesCreateCall) Header() http.Hea func (c *ProjectsLocationsDeliveryPipelinesReleasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release) if err != nil { return nil, err } @@ -9775,12 +9745,11 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9915,12 +9884,11 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10036,8 +10004,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsAdvanceCall) Header() func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsAdvanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advancerolloutrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advancerolloutrequest) if err != nil { return nil, err } @@ -10140,8 +10107,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsApproveCall) Header() func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approverolloutrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approverolloutrequest) if err != nil { return nil, err } @@ -10244,8 +10210,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsCancelCall) Header() func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelrolloutrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelrolloutrequest) if err != nil { return nil, err } @@ -10396,8 +10361,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsCreateCall) Header() func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollout) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollout) if err != nil { return nil, err } @@ -10509,12 +10473,11 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10608,8 +10571,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsIgnoreJobCall) Header func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsIgnoreJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ignorejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ignorejobrequest) if err != nil { return nil, err } @@ -10752,12 +10714,11 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rollouts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10873,8 +10834,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsRetryJobCall) Header( func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsRetryJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.retryjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.retryjobrequest) if err != nil { return nil, err } @@ -10988,12 +10948,11 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsJobRunsGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11127,12 +11086,11 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsJobRunsListCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11248,8 +11206,7 @@ func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsJobRunsTerminateCall) func (c *ProjectsLocationsDeliveryPipelinesReleasesRolloutsJobRunsTerminateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.terminatejobrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.terminatejobrunrequest) if err != nil { return nil, err } @@ -11382,8 +11339,7 @@ func (c *ProjectsLocationsDeployPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsDeployPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploypolicy) if err != nil { return nil, err } @@ -11523,12 +11479,11 @@ func (c *ProjectsLocationsDeployPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDeployPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11632,12 +11587,11 @@ func (c *ProjectsLocationsDeployPoliciesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11773,12 +11727,11 @@ func (c *ProjectsLocationsDeployPoliciesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11937,8 +11890,7 @@ func (c *ProjectsLocationsDeployPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsDeployPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploypolicy) if err != nil { return nil, err } @@ -12046,8 +11998,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12148,12 +12099,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12257,12 +12207,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12385,12 +12334,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12536,8 +12484,7 @@ func (c *ProjectsLocationsTargetsCreateCall) Header() http.Header { func (c *ProjectsLocationsTargetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.target) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.target) if err != nil { return nil, err } @@ -12675,12 +12622,11 @@ func (c *ProjectsLocationsTargetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTargetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12783,12 +12729,11 @@ func (c *ProjectsLocationsTargetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12910,12 +12855,11 @@ func (c *ProjectsLocationsTargetsGetIamPolicyCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13050,12 +12994,11 @@ func (c *ProjectsLocationsTargetsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/targets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13213,8 +13156,7 @@ func (c *ProjectsLocationsTargetsPatchCall) Header() http.Header { func (c *ProjectsLocationsTargetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.target) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.target) if err != nil { return nil, err } @@ -13318,8 +13260,7 @@ func (c *ProjectsLocationsTargetsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTargetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13426,8 +13367,7 @@ func (c *ProjectsLocationsTargetsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsTargetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/clouderrorreporting/v1beta1/clouderrorreporting-gen.go b/clouderrorreporting/v1beta1/clouderrorreporting-gen.go index 45c5cce8913..410a71ecab5 100644 --- a/clouderrorreporting/v1beta1/clouderrorreporting-gen.go +++ b/clouderrorreporting/v1beta1/clouderrorreporting-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -810,12 +809,11 @@ func (c *ProjectsDeleteEventsCall) Header() http.Header { func (c *ProjectsDeleteEventsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+projectName}/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1008,12 +1006,11 @@ func (c *ProjectsEventsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+projectName}/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1142,8 +1139,7 @@ func (c *ProjectsEventsReportCall) Header() http.Header { func (c *ProjectsEventsReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportederrorevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportederrorevent) if err != nil { return nil, err } @@ -1410,12 +1406,11 @@ func (c *ProjectsGroupStatsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+projectName}/groupStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1552,12 +1547,11 @@ func (c *ProjectsGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+groupName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1662,8 +1656,7 @@ func (c *ProjectsGroupsUpdateCall) Header() http.Header { func (c *ProjectsGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.errorgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.errorgroup) if err != nil { return nil, err } @@ -1770,12 +1763,11 @@ func (c *ProjectsLocationsDeleteEventsCall) Header() http.Header { func (c *ProjectsLocationsDeleteEventsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+projectName}/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1968,12 +1960,11 @@ func (c *ProjectsLocationsEventsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+projectName}/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2253,12 +2244,11 @@ func (c *ProjectsLocationsGroupStatsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+projectName}/groupStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2395,12 +2385,11 @@ func (c *ProjectsLocationsGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+groupName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2505,8 +2494,7 @@ func (c *ProjectsLocationsGroupsUpdateCall) Header() http.Header { func (c *ProjectsLocationsGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.errorgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.errorgroup) if err != nil { return nil, err } diff --git a/cloudfunctions/v1/cloudfunctions-gen.go b/cloudfunctions/v1/cloudfunctions-gen.go index 1cc377c3abc..91b50653b23 100644 --- a/cloudfunctions/v1/cloudfunctions-gen.go +++ b/cloudfunctions/v1/cloudfunctions-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1564,12 +1563,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1695,12 +1693,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1845,12 +1842,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1967,8 +1963,7 @@ func (c *ProjectsLocationsFunctionsCallCall) Header() http.Header { func (c *ProjectsLocationsFunctionsCallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.callfunctionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.callfunctionrequest) if err != nil { return nil, err } @@ -2072,8 +2067,7 @@ func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloudfunction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloudfunction) if err != nil { return nil, err } @@ -2173,12 +2167,11 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2274,8 +2267,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatedownloadurlrequest) if err != nil { return nil, err } @@ -2391,8 +2383,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateuploadurlrequest) if err != nil { return nil, err } @@ -2515,12 +2506,11 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2642,12 +2632,11 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2770,12 +2759,11 @@ func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/functions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2897,8 +2885,7 @@ func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloudfunction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloudfunction) if err != nil { return nil, err } @@ -3001,8 +2988,7 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFunctionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3107,8 +3093,7 @@ func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/cloudfunctions/v2/cloudfunctions-gen.go b/cloudfunctions/v2/cloudfunctions-gen.go index 0b60df749ae..7110d03b600 100644 --- a/cloudfunctions/v2/cloudfunctions-gen.go +++ b/cloudfunctions/v2/cloudfunctions-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2052,12 +2051,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2173,8 +2171,7 @@ func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Heade func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abortfunctionupgraderequest) if err != nil { return nil, err } @@ -2277,8 +2274,7 @@ func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Head func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitfunctionupgraderequest) if err != nil { return nil, err } @@ -2389,8 +2385,7 @@ func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.function) if err != nil { return nil, err } @@ -2490,12 +2485,11 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2591,8 +2585,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatedownloadurlrequest) if err != nil { return nil, err } @@ -2706,8 +2699,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateuploadurlrequest) if err != nil { return nil, err } @@ -2829,12 +2821,11 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2956,12 +2947,11 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3103,12 +3093,11 @@ func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3230,8 +3219,7 @@ func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.function) if err != nil { return nil, err } @@ -3335,8 +3323,7 @@ func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.redirectfunctionupgradetrafficrequest) if err != nil { return nil, err } @@ -3439,8 +3426,7 @@ func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackfunctionupgradetrafficrequest) if err != nil { return nil, err } @@ -3544,8 +3530,7 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFunctionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3650,8 +3635,7 @@ func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setupfunctionupgradeconfigrequest) if err != nil { return nil, err } @@ -3758,8 +3742,7 @@ func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3872,12 +3855,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4000,12 +3982,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4139,12 +4120,11 @@ func (c *ProjectsLocationsRuntimesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/runtimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudfunctions/v2alpha/cloudfunctions-gen.go b/cloudfunctions/v2alpha/cloudfunctions-gen.go index b7e9858c647..c1647d45610 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-gen.go +++ b/cloudfunctions/v2alpha/cloudfunctions-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2052,12 +2051,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2173,8 +2171,7 @@ func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Heade func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abortfunctionupgraderequest) if err != nil { return nil, err } @@ -2277,8 +2274,7 @@ func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Head func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitfunctionupgraderequest) if err != nil { return nil, err } @@ -2389,8 +2385,7 @@ func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.function) if err != nil { return nil, err } @@ -2490,12 +2485,11 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2591,8 +2585,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatedownloadurlrequest) if err != nil { return nil, err } @@ -2706,8 +2699,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateuploadurlrequest) if err != nil { return nil, err } @@ -2829,12 +2821,11 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2956,12 +2947,11 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3103,12 +3093,11 @@ func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3230,8 +3219,7 @@ func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.function) if err != nil { return nil, err } @@ -3335,8 +3323,7 @@ func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.redirectfunctionupgradetrafficrequest) if err != nil { return nil, err } @@ -3439,8 +3426,7 @@ func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackfunctionupgradetrafficrequest) if err != nil { return nil, err } @@ -3544,8 +3530,7 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFunctionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3650,8 +3635,7 @@ func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setupfunctionupgradeconfigrequest) if err != nil { return nil, err } @@ -3758,8 +3742,7 @@ func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3872,12 +3855,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4000,12 +3982,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4139,12 +4120,11 @@ func (c *ProjectsLocationsRuntimesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/runtimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudfunctions/v2beta/cloudfunctions-gen.go b/cloudfunctions/v2beta/cloudfunctions-gen.go index 350a7215c12..e5f5166e3fa 100644 --- a/cloudfunctions/v2beta/cloudfunctions-gen.go +++ b/cloudfunctions/v2beta/cloudfunctions-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2052,12 +2051,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2173,8 +2171,7 @@ func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Heade func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abortfunctionupgraderequest) if err != nil { return nil, err } @@ -2277,8 +2274,7 @@ func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Head func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitfunctionupgraderequest) if err != nil { return nil, err } @@ -2389,8 +2385,7 @@ func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.function) if err != nil { return nil, err } @@ -2490,12 +2485,11 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2591,8 +2585,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatedownloadurlrequest) if err != nil { return nil, err } @@ -2706,8 +2699,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateuploadurlrequest) if err != nil { return nil, err } @@ -2829,12 +2821,11 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2956,12 +2947,11 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3103,12 +3093,11 @@ func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3230,8 +3219,7 @@ func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.function) if err != nil { return nil, err } @@ -3335,8 +3323,7 @@ func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.redirectfunctionupgradetrafficrequest) if err != nil { return nil, err } @@ -3439,8 +3426,7 @@ func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackfunctionupgradetrafficrequest) if err != nil { return nil, err } @@ -3544,8 +3530,7 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFunctionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3650,8 +3635,7 @@ func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setupfunctionupgradeconfigrequest) if err != nil { return nil, err } @@ -3758,8 +3742,7 @@ func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3872,12 +3855,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4000,12 +3982,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4139,12 +4120,11 @@ func (c *ProjectsLocationsRuntimesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/runtimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudidentity/v1/cloudidentity-gen.go b/cloudidentity/v1/cloudidentity-gen.go index a70b1dc852d..5fb1c3322da 100644 --- a/cloudidentity/v1/cloudidentity-gen.go +++ b/cloudidentity/v1/cloudidentity-gen.go @@ -161,7 +161,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Devices = NewDevicesService(s) + s.Groups = NewGroupsService(s) + s.InboundSamlSsoProfiles = NewInboundSamlSsoProfilesService(s) + s.InboundSsoAssignments = NewInboundSsoAssignmentsService(s) + s.Policies = NewPoliciesService(s) if err != nil { return nil, err } @@ -180,14 +186,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Devices = NewDevicesService(s) - s.Groups = NewGroupsService(s) - s.InboundSamlSsoProfiles = NewInboundSamlSsoProfilesService(s) - s.InboundSsoAssignments = NewInboundSsoAssignmentsService(s) - s.Policies = NewPoliciesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3418,8 +3417,7 @@ func (c *CustomersUserinvitationsCancelCall) Header() http.Header { func (c *CustomersUserinvitationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceluserinvitationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceluserinvitationrequest) if err != nil { return nil, err } @@ -3533,12 +3531,11 @@ func (c *CustomersUserinvitationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3647,12 +3644,11 @@ func (c *CustomersUserinvitationsIsInvitableUserCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:isInvitableUser") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3796,12 +3792,11 @@ func (c *CustomersUserinvitationsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userinvitations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3921,8 +3916,7 @@ func (c *CustomersUserinvitationsSendCall) Header() http.Header { func (c *CustomersUserinvitationsSendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.senduserinvitationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.senduserinvitationrequest) if err != nil { return nil, err } @@ -4030,8 +4024,7 @@ func (c *DevicesCancelWipeCall) Header() http.Header { func (c *DevicesCancelWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1cancelwipedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1cancelwipedevicerequest) if err != nil { return nil, err } @@ -4141,8 +4134,7 @@ func (c *DevicesCreateCall) Header() http.Header { func (c *DevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1device) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1device) if err != nil { return nil, err } @@ -4250,12 +4242,11 @@ func (c *DevicesDeleteCall) Header() http.Header { func (c *DevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4371,12 +4362,11 @@ func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4546,12 +4536,11 @@ func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4665,8 +4654,7 @@ func (c *DevicesWipeCall) Header() http.Header { func (c *DevicesWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1wipedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1wipedevicerequest) if err != nil { return nil, err } @@ -4769,8 +4757,7 @@ func (c *DevicesDeviceUsersApproveCall) Header() http.Header { func (c *DevicesDeviceUsersApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1approvedeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1approvedeviceuserrequest) if err != nil { return nil, err } @@ -4873,8 +4860,7 @@ func (c *DevicesDeviceUsersBlockCall) Header() http.Header { func (c *DevicesDeviceUsersBlockCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1blockdeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1blockdeviceuserrequest) if err != nil { return nil, err } @@ -4979,8 +4965,7 @@ func (c *DevicesDeviceUsersCancelWipeCall) Header() http.Header { func (c *DevicesDeviceUsersCancelWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1cancelwipedeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1cancelwipedeviceuserrequest) if err != nil { return nil, err } @@ -5093,12 +5078,11 @@ func (c *DevicesDeviceUsersDeleteCall) Header() http.Header { func (c *DevicesDeviceUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5214,12 +5198,11 @@ func (c *DevicesDeviceUsersGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5369,12 +5352,11 @@ func (c *DevicesDeviceUsersListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deviceUsers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5554,12 +5536,11 @@ func (c *DevicesDeviceUsersLookupCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5682,8 +5663,7 @@ func (c *DevicesDeviceUsersWipeCall) Header() http.Header { func (c *DevicesDeviceUsersWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1wipedeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1wipedeviceuserrequest) if err != nil { return nil, err } @@ -5817,12 +5797,11 @@ func (c *DevicesDeviceUsersClientStatesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5961,12 +5940,11 @@ func (c *DevicesDeviceUsersClientStatesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clientStates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6117,8 +6095,7 @@ func (c *DevicesDeviceUsersClientStatesPatchCall) Header() http.Header { func (c *DevicesDeviceUsersClientStatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappscloudidentitydevicesv1clientstate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappscloudidentitydevicesv1clientstate) if err != nil { return nil, err } @@ -6232,8 +6209,7 @@ func (c *GroupsCreateCall) Header() http.Header { func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -6330,12 +6306,11 @@ func (c *GroupsDeleteCall) Header() http.Header { func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6439,12 +6414,11 @@ func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6556,12 +6530,11 @@ func (c *GroupsGetSecuritySettingsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6703,12 +6676,11 @@ func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6849,12 +6821,11 @@ func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6954,8 +6925,7 @@ func (c *GroupsPatchCall) Header() http.Header { func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -7113,12 +7083,11 @@ func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7238,8 +7207,7 @@ func (c *GroupsUpdateSecuritySettingsCall) Header() http.Header { func (c *GroupsUpdateSecuritySettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitysettings) if err != nil { return nil, err } @@ -7372,12 +7340,11 @@ func (c *GroupsMembershipsCheckTransitiveMembershipCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:checkTransitiveMembership") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7471,8 +7438,7 @@ func (c *GroupsMembershipsCreateCall) Header() http.Header { func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -7572,12 +7538,11 @@ func (c *GroupsMembershipsDeleteCall) Header() http.Header { func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7682,12 +7647,11 @@ func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7813,12 +7777,11 @@ func (c *GroupsMembershipsGetMembershipGraphCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:getMembershipGraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7953,12 +7916,11 @@ func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8107,12 +8069,11 @@ func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8208,8 +8169,7 @@ func (c *GroupsMembershipsModifyMembershipRolesCall) Header() http.Header { func (c *GroupsMembershipsModifyMembershipRolesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymembershiprolesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifymembershiprolesrequest) if err != nil { return nil, err } @@ -8364,12 +8324,11 @@ func (c *GroupsMembershipsSearchDirectGroupsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:searchDirectGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8535,12 +8494,11 @@ func (c *GroupsMembershipsSearchTransitiveGroupsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:searchTransitiveGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8687,12 +8645,11 @@ func (c *GroupsMembershipsSearchTransitiveMembershipsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:searchTransitiveMemberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8806,8 +8763,7 @@ func (c *InboundSamlSsoProfilesCreateCall) Header() http.Header { func (c *InboundSamlSsoProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundsamlssoprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundsamlssoprofile) if err != nil { return nil, err } @@ -8905,12 +8861,11 @@ func (c *InboundSamlSsoProfilesDeleteCall) Header() http.Header { func (c *InboundSamlSsoProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9015,12 +8970,11 @@ func (c *InboundSamlSsoProfilesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9151,12 +9105,11 @@ func (c *InboundSamlSsoProfilesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/inboundSamlSsoProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9280,8 +9233,7 @@ func (c *InboundSamlSsoProfilesPatchCall) Header() http.Header { func (c *InboundSamlSsoProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundsamlssoprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundsamlssoprofile) if err != nil { return nil, err } @@ -9386,8 +9338,7 @@ func (c *InboundSamlSsoProfilesIdpCredentialsAddCall) Header() http.Header { func (c *InboundSamlSsoProfilesIdpCredentialsAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addidpcredentialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addidpcredentialrequest) if err != nil { return nil, err } @@ -9489,12 +9440,11 @@ func (c *InboundSamlSsoProfilesIdpCredentialsDeleteCall) Header() http.Header { func (c *InboundSamlSsoProfilesIdpCredentialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9600,12 +9550,11 @@ func (c *InboundSamlSsoProfilesIdpCredentialsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9724,12 +9673,11 @@ func (c *InboundSamlSsoProfilesIdpCredentialsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/idpCredentials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9840,8 +9788,7 @@ func (c *InboundSsoAssignmentsCreateCall) Header() http.Header { func (c *InboundSsoAssignmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundssoassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundssoassignment) if err != nil { return nil, err } @@ -9940,12 +9887,11 @@ func (c *InboundSsoAssignmentsDeleteCall) Header() http.Header { func (c *InboundSsoAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10050,12 +9996,11 @@ func (c *InboundSsoAssignmentsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10185,12 +10130,11 @@ func (c *InboundSsoAssignmentsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/inboundSsoAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10316,8 +10260,7 @@ func (c *InboundSsoAssignmentsPatchCall) Header() http.Header { func (c *InboundSsoAssignmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundssoassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundssoassignment) if err != nil { return nil, err } @@ -10427,12 +10370,11 @@ func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10565,12 +10507,11 @@ func (c *PoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudidentity/v1beta1/cloudidentity-gen.go b/cloudidentity/v1beta1/cloudidentity-gen.go index 99ce148811a..30f4755e0c0 100644 --- a/cloudidentity/v1beta1/cloudidentity-gen.go +++ b/cloudidentity/v1beta1/cloudidentity-gen.go @@ -161,7 +161,14 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Devices = NewDevicesService(s) + s.Groups = NewGroupsService(s) + s.InboundSamlSsoProfiles = NewInboundSamlSsoProfilesService(s) + s.InboundSsoAssignments = NewInboundSsoAssignmentsService(s) + s.OrgUnits = NewOrgUnitsService(s) + s.Policies = NewPoliciesService(s) if err != nil { return nil, err } @@ -180,15 +187,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Devices = NewDevicesService(s) - s.Groups = NewGroupsService(s) - s.InboundSamlSsoProfiles = NewInboundSamlSsoProfilesService(s) - s.InboundSsoAssignments = NewInboundSsoAssignmentsService(s) - s.OrgUnits = NewOrgUnitsService(s) - s.Policies = NewPoliciesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4364,8 +4363,7 @@ func (c *CustomersUserinvitationsCancelCall) Header() http.Header { func (c *CustomersUserinvitationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceluserinvitationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceluserinvitationrequest) if err != nil { return nil, err } @@ -4479,12 +4477,11 @@ func (c *CustomersUserinvitationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4593,12 +4590,11 @@ func (c *CustomersUserinvitationsIsInvitableUserCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:isInvitableUser") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4742,12 +4738,11 @@ func (c *CustomersUserinvitationsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userinvitations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4867,8 +4862,7 @@ func (c *CustomersUserinvitationsSendCall) Header() http.Header { func (c *CustomersUserinvitationsSendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.senduserinvitationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.senduserinvitationrequest) if err != nil { return nil, err } @@ -4972,8 +4966,7 @@ func (c *DevicesCancelWipeCall) Header() http.Header { func (c *DevicesCancelWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelwipedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelwipedevicerequest) if err != nil { return nil, err } @@ -5072,8 +5065,7 @@ func (c *DevicesCreateCall) Header() http.Header { func (c *DevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createdevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createdevicerequest) if err != nil { return nil, err } @@ -5181,12 +5173,11 @@ func (c *DevicesDeleteCall) Header() http.Header { func (c *DevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5299,12 +5290,11 @@ func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5467,12 +5457,11 @@ func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5587,8 +5576,7 @@ func (c *DevicesWipeCall) Header() http.Header { func (c *DevicesWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wipedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wipedevicerequest) if err != nil { return nil, err } @@ -5692,8 +5680,7 @@ func (c *DevicesDeviceUsersApproveCall) Header() http.Header { func (c *DevicesDeviceUsersApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvedeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approvedeviceuserrequest) if err != nil { return nil, err } @@ -5797,8 +5784,7 @@ func (c *DevicesDeviceUsersBlockCall) Header() http.Header { func (c *DevicesDeviceUsersBlockCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockdeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.blockdeviceuserrequest) if err != nil { return nil, err } @@ -5904,8 +5890,7 @@ func (c *DevicesDeviceUsersCancelWipeCall) Header() http.Header { func (c *DevicesDeviceUsersCancelWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelwipedeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelwipedeviceuserrequest) if err != nil { return nil, err } @@ -6019,12 +6004,11 @@ func (c *DevicesDeviceUsersDeleteCall) Header() http.Header { func (c *DevicesDeviceUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6141,12 +6125,11 @@ func (c *DevicesDeviceUsersGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6295,12 +6278,11 @@ func (c *DevicesDeviceUsersListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/deviceUsers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6480,12 +6462,11 @@ func (c *DevicesDeviceUsersLookupCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6603,8 +6584,7 @@ func (c *DevicesDeviceUsersWipeCall) Header() http.Header { func (c *DevicesDeviceUsersWipeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wipedeviceuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wipedeviceuserrequest) if err != nil { return nil, err } @@ -6739,12 +6719,11 @@ func (c *DevicesDeviceUsersClientStatesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6862,8 +6841,7 @@ func (c *DevicesDeviceUsersClientStatesPatchCall) Header() http.Header { func (c *DevicesDeviceUsersClientStatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientstate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientstate) if err != nil { return nil, err } @@ -6977,8 +6955,7 @@ func (c *GroupsCreateCall) Header() http.Header { func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -7075,12 +7052,11 @@ func (c *GroupsDeleteCall) Header() http.Header { func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7184,12 +7160,11 @@ func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7301,12 +7276,11 @@ func (c *GroupsGetSecuritySettingsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7448,12 +7422,11 @@ func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7593,12 +7566,11 @@ func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7699,8 +7671,7 @@ func (c *GroupsPatchCall) Header() http.Header { func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -7868,12 +7839,11 @@ func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7993,8 +7963,7 @@ func (c *GroupsUpdateSecuritySettingsCall) Header() http.Header { func (c *GroupsUpdateSecuritySettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitysettings) if err != nil { return nil, err } @@ -8125,12 +8094,11 @@ func (c *GroupsMembershipsCheckTransitiveMembershipCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:checkTransitiveMembership") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8224,8 +8192,7 @@ func (c *GroupsMembershipsCreateCall) Header() http.Header { func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -8326,12 +8293,11 @@ func (c *GroupsMembershipsDeleteCall) Header() http.Header { func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8436,12 +8402,11 @@ func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8566,12 +8531,11 @@ func (c *GroupsMembershipsGetMembershipGraphCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:getMembershipGraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8705,12 +8669,11 @@ func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8858,12 +8821,11 @@ func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8959,8 +8921,7 @@ func (c *GroupsMembershipsModifyMembershipRolesCall) Header() http.Header { func (c *GroupsMembershipsModifyMembershipRolesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymembershiprolesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifymembershiprolesrequest) if err != nil { return nil, err } @@ -9115,12 +9076,11 @@ func (c *GroupsMembershipsSearchDirectGroupsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchDirectGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9285,12 +9245,11 @@ func (c *GroupsMembershipsSearchTransitiveGroupsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchTransitiveGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9436,12 +9395,11 @@ func (c *GroupsMembershipsSearchTransitiveMembershipsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchTransitiveMemberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9555,8 +9513,7 @@ func (c *InboundSamlSsoProfilesCreateCall) Header() http.Header { func (c *InboundSamlSsoProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundsamlssoprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundsamlssoprofile) if err != nil { return nil, err } @@ -9654,12 +9611,11 @@ func (c *InboundSamlSsoProfilesDeleteCall) Header() http.Header { func (c *InboundSamlSsoProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9764,12 +9720,11 @@ func (c *InboundSamlSsoProfilesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9900,12 +9855,11 @@ func (c *InboundSamlSsoProfilesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/inboundSamlSsoProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10029,8 +9983,7 @@ func (c *InboundSamlSsoProfilesPatchCall) Header() http.Header { func (c *InboundSamlSsoProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundsamlssoprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundsamlssoprofile) if err != nil { return nil, err } @@ -10135,8 +10088,7 @@ func (c *InboundSamlSsoProfilesIdpCredentialsAddCall) Header() http.Header { func (c *InboundSamlSsoProfilesIdpCredentialsAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addidpcredentialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addidpcredentialrequest) if err != nil { return nil, err } @@ -10238,12 +10190,11 @@ func (c *InboundSamlSsoProfilesIdpCredentialsDeleteCall) Header() http.Header { func (c *InboundSamlSsoProfilesIdpCredentialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10349,12 +10300,11 @@ func (c *InboundSamlSsoProfilesIdpCredentialsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10473,12 +10423,11 @@ func (c *InboundSamlSsoProfilesIdpCredentialsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/idpCredentials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10589,8 +10538,7 @@ func (c *InboundSsoAssignmentsCreateCall) Header() http.Header { func (c *InboundSsoAssignmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundssoassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundssoassignment) if err != nil { return nil, err } @@ -10689,12 +10637,11 @@ func (c *InboundSsoAssignmentsDeleteCall) Header() http.Header { func (c *InboundSsoAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10799,12 +10746,11 @@ func (c *InboundSsoAssignmentsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10934,12 +10880,11 @@ func (c *InboundSsoAssignmentsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/inboundSsoAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11065,8 +11010,7 @@ func (c *InboundSsoAssignmentsPatchCall) Header() http.Header { func (c *InboundSsoAssignmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inboundssoassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inboundssoassignment) if err != nil { return nil, err } @@ -11222,12 +11166,11 @@ func (c *OrgUnitsMembershipsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11356,8 +11299,7 @@ func (c *OrgUnitsMembershipsMoveCall) Header() http.Header { func (c *OrgUnitsMembershipsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moveorgmembershiprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moveorgmembershiprequest) if err != nil { return nil, err } @@ -11467,12 +11409,11 @@ func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11605,12 +11546,11 @@ func (c *PoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudkms/v1/cloudkms-gen.go b/cloudkms/v1/cloudkms-gen.go index f1ec3fcae29..9272f75c7b1 100644 --- a/cloudkms/v1/cloudkms-gen.go +++ b/cloudkms/v1/cloudkms-gen.go @@ -126,7 +126,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,10 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3470,12 +3469,11 @@ func (c *FoldersGetAutokeyConfigCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3579,8 +3577,7 @@ func (c *FoldersUpdateAutokeyConfigCall) Header() http.Header { func (c *FoldersUpdateAutokeyConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autokeyconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autokeyconfig) if err != nil { return nil, err } @@ -3693,12 +3690,11 @@ func (c *ProjectsShowEffectiveAutokeyConfigCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:showEffectiveAutokeyConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3793,8 +3789,7 @@ func (c *ProjectsLocationsGenerateRandomBytesCall) Header() http.Header { func (c *ProjectsLocationsGenerateRandomBytesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generaterandombytesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generaterandombytesrequest) if err != nil { return nil, err } @@ -3905,12 +3900,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4013,12 +4007,11 @@ func (c *ProjectsLocationsGetEkmConfigCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4144,12 +4137,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4272,8 +4264,7 @@ func (c *ProjectsLocationsUpdateEkmConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateEkmConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ekmconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ekmconfig) if err != nil { return nil, err } @@ -4403,12 +4394,11 @@ func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4504,8 +4494,7 @@ func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4612,8 +4601,7 @@ func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4723,8 +4711,7 @@ func (c *ProjectsLocationsEkmConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsEkmConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ekmconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ekmconnection) if err != nil { return nil, err } @@ -4834,12 +4821,11 @@ func (c *ProjectsLocationsEkmConnectionsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4961,12 +4947,11 @@ func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5104,12 +5089,11 @@ func (c *ProjectsLocationsEkmConnectionsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/ekmConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5231,8 +5215,7 @@ func (c *ProjectsLocationsEkmConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsEkmConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ekmconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ekmconnection) if err != nil { return nil, err } @@ -5336,8 +5319,7 @@ func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5444,8 +5426,7 @@ func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5560,12 +5541,11 @@ func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:verifyConnectivity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5671,8 +5651,7 @@ func (c *ProjectsLocationsKeyHandlesCreateCall) Header() http.Header { func (c *ProjectsLocationsKeyHandlesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.keyhandle) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.keyhandle) if err != nil { return nil, err } @@ -5783,12 +5762,11 @@ func (c *ProjectsLocationsKeyHandlesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5915,12 +5893,11 @@ func (c *ProjectsLocationsKeyHandlesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keyHandles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6043,8 +6020,7 @@ func (c *ProjectsLocationsKeyRingsCreateCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.keyring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.keyring) if err != nil { return nil, err } @@ -6154,12 +6130,11 @@ func (c *ProjectsLocationsKeyRingsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6281,12 +6256,11 @@ func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6424,12 +6398,11 @@ func (c *ProjectsLocationsKeyRingsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keyRings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6547,8 +6520,7 @@ func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6655,8 +6627,7 @@ func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6776,8 +6747,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cryptokey) if err != nil { return nil, err } @@ -6879,8 +6849,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.decryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.decryptrequest) if err != nil { return nil, err } @@ -6984,8 +6953,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.encryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.encryptrequest) if err != nil { return nil, err } @@ -7097,12 +7065,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7224,12 +7191,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7384,12 +7350,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7511,8 +7476,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cryptokey) if err != nil { return nil, err } @@ -7616,8 +7580,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7724,8 +7687,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7828,8 +7790,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) Header() h func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecryptokeyprimaryversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecryptokeyprimaryversionrequest) if err != nil { return nil, err } @@ -7931,8 +7892,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCa func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asymmetricdecryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asymmetricdecryptrequest) if err != nil { return nil, err } @@ -8035,8 +7995,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asymmetricsignrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asymmetricsignrequest) if err != nil { return nil, err } @@ -8138,8 +8097,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) Header( func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokeyversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cryptokeyversion) if err != nil { return nil, err } @@ -8245,8 +8203,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) Header func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroycryptokeyversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.destroycryptokeyversionrequest) if err != nil { return nil, err } @@ -8357,12 +8314,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8466,12 +8422,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/publicKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8569,8 +8524,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) Header( func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importcryptokeyversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importcryptokeyversionrequest) if err != nil { return nil, err } @@ -8734,12 +8688,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeyVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8854,8 +8807,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) Header func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.macsignrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.macsignrequest) if err != nil { return nil, err } @@ -8958,8 +8910,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) Head func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.macverifyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.macverifyrequest) if err != nil { return nil, err } @@ -9071,8 +9022,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) Header() func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokeyversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cryptokeyversion) if err != nil { return nil, err } @@ -9174,8 +9124,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) Hea func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rawdecryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rawdecryptrequest) if err != nil { return nil, err } @@ -9278,8 +9227,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) Hea func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rawencryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rawencryptrequest) if err != nil { return nil, err } @@ -9382,8 +9330,7 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) Header func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restorecryptokeyversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restorecryptokeyversionrequest) if err != nil { return nil, err } @@ -9493,8 +9440,7 @@ func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importjob) if err != nil { return nil, err } @@ -9604,12 +9550,11 @@ func (c *ProjectsLocationsKeyRingsImportJobsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9731,12 +9676,11 @@ func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9874,12 +9818,11 @@ func (c *ProjectsLocationsKeyRingsImportJobsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/importJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9997,8 +9940,7 @@ func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10105,8 +10047,7 @@ func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10219,12 +10160,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudprofiler/v2/cloudprofiler-gen.go b/cloudprofiler/v2/cloudprofiler-gen.go index 501195b9ba9..848cc850923 100644 --- a/cloudprofiler/v2/cloudprofiler-gen.go +++ b/cloudprofiler/v2/cloudprofiler-gen.go @@ -129,7 +129,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -148,9 +149,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -429,8 +428,7 @@ func (c *ProjectsProfilesCreateCall) Header() http.Header { func (c *ProjectsProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createprofilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createprofilerequest) if err != nil { return nil, err } @@ -535,8 +533,7 @@ func (c *ProjectsProfilesCreateOfflineCall) Header() http.Header { func (c *ProjectsProfilesCreateOfflineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profile) if err != nil { return nil, err } @@ -664,12 +661,11 @@ func (c *ProjectsProfilesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/profiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -798,8 +794,7 @@ func (c *ProjectsProfilesPatchCall) Header() http.Header { func (c *ProjectsProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profile) if err != nil { return nil, err } diff --git a/cloudresourcemanager/v1/cloudresourcemanager-gen.go b/cloudresourcemanager/v1/cloudresourcemanager-gen.go index 86e108d6cd8..1a8d03f65f3 100644 --- a/cloudresourcemanager/v1/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v1/cloudresourcemanager-gen.go @@ -125,7 +125,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Liens = NewLiensService(s) + s.Operations = NewOperationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,13 +149,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Liens = NewLiensService(s) - s.Operations = NewOperationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2100,8 +2099,7 @@ func (c *FoldersClearOrgPolicyCall) Header() http.Header { func (c *FoldersClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clearorgpolicyrequest) if err != nil { return nil, err } @@ -2206,8 +2204,7 @@ func (c *FoldersGetEffectiveOrgPolicyCall) Header() http.Header { func (c *FoldersGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.geteffectiveorgpolicyrequest) if err != nil { return nil, err } @@ -2311,8 +2308,7 @@ func (c *FoldersGetOrgPolicyCall) Header() http.Header { func (c *FoldersGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getorgpolicyrequest) if err != nil { return nil, err } @@ -2413,8 +2409,7 @@ func (c *FoldersListAvailableOrgPolicyConstraintsCall) Header() http.Header { func (c *FoldersListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listavailableorgpolicyconstraintsrequest) if err != nil { return nil, err } @@ -2536,8 +2531,7 @@ func (c *FoldersListOrgPoliciesCall) Header() http.Header { func (c *FoldersListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listorgpoliciesrequest) if err != nil { return nil, err } @@ -2662,8 +2656,7 @@ func (c *FoldersSetOrgPolicyCall) Header() http.Header { func (c *FoldersSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setorgpolicyrequest) if err != nil { return nil, err } @@ -2763,8 +2756,7 @@ func (c *LiensCreateCall) Header() http.Header { func (c *LiensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lien) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lien) if err != nil { return nil, err } @@ -2861,12 +2853,11 @@ func (c *LiensDeleteCall) Header() http.Header { func (c *LiensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2970,12 +2961,11 @@ func (c *LiensGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3101,12 +3091,11 @@ func (c *LiensListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3229,12 +3218,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3326,8 +3314,7 @@ func (c *OrganizationsClearOrgPolicyCall) Header() http.Header { func (c *OrganizationsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clearorgpolicyrequest) if err != nil { return nil, err } @@ -3440,12 +3427,11 @@ func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3542,8 +3528,7 @@ func (c *OrganizationsGetEffectiveOrgPolicyCall) Header() http.Header { func (c *OrganizationsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.geteffectiveorgpolicyrequest) if err != nil { return nil, err } @@ -3649,8 +3634,7 @@ func (c *OrganizationsGetIamPolicyCall) Header() http.Header { func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -3754,8 +3738,7 @@ func (c *OrganizationsGetOrgPolicyCall) Header() http.Header { func (c *OrganizationsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getorgpolicyrequest) if err != nil { return nil, err } @@ -3856,8 +3839,7 @@ func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Header() http.Heade func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listavailableorgpolicyconstraintsrequest) if err != nil { return nil, err } @@ -3979,8 +3961,7 @@ func (c *OrganizationsListOrgPoliciesCall) Header() http.Header { func (c *OrganizationsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listorgpoliciesrequest) if err != nil { return nil, err } @@ -4103,8 +4084,7 @@ func (c *OrganizationsSearchCall) Header() http.Header { func (c *OrganizationsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchorganizationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchorganizationsrequest) if err != nil { return nil, err } @@ -4229,8 +4209,7 @@ func (c *OrganizationsSetIamPolicyCall) Header() http.Header { func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4333,8 +4312,7 @@ func (c *OrganizationsSetOrgPolicyCall) Header() http.Header { func (c *OrganizationsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setorgpolicyrequest) if err != nil { return nil, err } @@ -4440,8 +4418,7 @@ func (c *OrganizationsTestIamPermissionsCall) Header() http.Header { func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4542,8 +4519,7 @@ func (c *ProjectsClearOrgPolicyCall) Header() http.Header { func (c *ProjectsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clearorgpolicyrequest) if err != nil { return nil, err } @@ -4650,8 +4626,7 @@ func (c *ProjectsCreateCall) Header() http.Header { func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.project) if err != nil { return nil, err } @@ -4756,12 +4731,11 @@ func (c *ProjectsDeleteCall) Header() http.Header { func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4865,12 +4839,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4964,8 +4937,7 @@ func (c *ProjectsGetAncestryCall) Header() http.Header { func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getancestryrequest) if err != nil { return nil, err } @@ -5071,8 +5043,7 @@ func (c *ProjectsGetEffectiveOrgPolicyCall) Header() http.Header { func (c *ProjectsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.geteffectiveorgpolicyrequest) if err != nil { return nil, err } @@ -5180,8 +5151,7 @@ func (c *ProjectsGetIamPolicyCall) Header() http.Header { func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5285,8 +5255,7 @@ func (c *ProjectsGetOrgPolicyCall) Header() http.Header { func (c *ProjectsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getorgpolicyrequest) if err != nil { return nil, err } @@ -5446,12 +5415,11 @@ func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5563,8 +5531,7 @@ func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Header() http.Header { func (c *ProjectsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listavailableorgpolicyconstraintsrequest) if err != nil { return nil, err } @@ -5686,8 +5653,7 @@ func (c *ProjectsListOrgPoliciesCall) Header() http.Header { func (c *ProjectsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listorgpoliciesrequest) if err != nil { return nil, err } @@ -5843,8 +5809,7 @@ func (c *ProjectsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5947,8 +5912,7 @@ func (c *ProjectsSetOrgPolicyCall) Header() http.Header { func (c *ProjectsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setorgpolicyrequest) if err != nil { return nil, err } @@ -6055,8 +6019,7 @@ func (c *ProjectsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6161,8 +6124,7 @@ func (c *ProjectsUndeleteCall) Header() http.Header { func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteprojectrequest) if err != nil { return nil, err } @@ -6264,8 +6226,7 @@ func (c *ProjectsUpdateCall) Header() http.Header { func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.project) if err != nil { return nil, err } diff --git a/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go b/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go index 5b512d68a3c..e3acfd044da 100644 --- a/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go @@ -125,7 +125,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,10 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1356,12 +1355,11 @@ func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1457,8 +1455,7 @@ func (c *OrganizationsGetIamPolicyCall) Header() http.Header { func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1594,12 +1591,11 @@ func (c *OrganizationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1714,8 +1710,7 @@ func (c *OrganizationsSetIamPolicyCall) Header() http.Header { func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -1820,8 +1815,7 @@ func (c *OrganizationsTestIamPermissionsCall) Header() http.Header { func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -1925,8 +1919,7 @@ func (c *OrganizationsUpdateCall) Header() http.Header { func (c *OrganizationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.organization) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.organization) if err != nil { return nil, err } @@ -2037,8 +2030,7 @@ func (c *ProjectsCreateCall) Header() http.Header { func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.project) if err != nil { return nil, err } @@ -2143,12 +2135,11 @@ func (c *ProjectsDeleteCall) Header() http.Header { func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2252,12 +2243,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2351,8 +2341,7 @@ func (c *ProjectsGetAncestryCall) Header() http.Header { func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getancestryrequest) if err != nil { return nil, err } @@ -2458,8 +2447,7 @@ func (c *ProjectsGetIamPolicyCall) Header() http.Header { func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2617,12 +2605,11 @@ func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2762,8 +2749,7 @@ func (c *ProjectsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2867,8 +2853,7 @@ func (c *ProjectsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2973,8 +2958,7 @@ func (c *ProjectsUndeleteCall) Header() http.Header { func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteprojectrequest) if err != nil { return nil, err } @@ -3076,8 +3060,7 @@ func (c *ProjectsUpdateCall) Header() http.Header { func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.project) if err != nil { return nil, err } diff --git a/cloudresourcemanager/v2/cloudresourcemanager-gen.go b/cloudresourcemanager/v2/cloudresourcemanager-gen.go index 28afbd66f86..c8fff736293 100644 --- a/cloudresourcemanager/v2/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v2/cloudresourcemanager-gen.go @@ -125,7 +125,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Operations = NewOperationsService(s) if err != nil { return nil, err } @@ -144,10 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Operations = NewOperationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1307,8 +1306,7 @@ func (c *FoldersCreateCall) Header() http.Header { func (c *FoldersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -1409,12 +1407,11 @@ func (c *FoldersDeleteCall) Header() http.Header { func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1520,12 +1517,11 @@ func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1623,8 +1619,7 @@ func (c *FoldersGetIamPolicyCall) Header() http.Header { func (c *FoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1767,12 +1762,11 @@ func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1896,8 +1890,7 @@ func (c *FoldersMoveCall) Header() http.Header { func (c *FoldersMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movefolderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movefolderrequest) if err != nil { return nil, err } @@ -2014,8 +2007,7 @@ func (c *FoldersPatchCall) Header() http.Header { func (c *FoldersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -2114,8 +2106,7 @@ func (c *FoldersSearchCall) Header() http.Header { func (c *FoldersSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchfoldersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchfoldersrequest) if err != nil { return nil, err } @@ -2239,8 +2230,7 @@ func (c *FoldersSetIamPolicyCall) Header() http.Header { func (c *FoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2345,8 +2335,7 @@ func (c *FoldersTestIamPermissionsCall) Header() http.Header { func (c *FoldersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2453,8 +2442,7 @@ func (c *FoldersUndeleteCall) Header() http.Header { func (c *FoldersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletefolderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletefolderrequest) if err != nil { return nil, err } @@ -2566,12 +2554,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudresourcemanager/v2beta1/cloudresourcemanager-gen.go b/cloudresourcemanager/v2beta1/cloudresourcemanager-gen.go index e05fb14c406..e105fc1f68f 100644 --- a/cloudresourcemanager/v2beta1/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v2beta1/cloudresourcemanager-gen.go @@ -125,7 +125,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Operations = NewOperationsService(s) if err != nil { return nil, err } @@ -144,10 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Operations = NewOperationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1307,8 +1306,7 @@ func (c *FoldersCreateCall) Header() http.Header { func (c *FoldersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -1409,12 +1407,11 @@ func (c *FoldersDeleteCall) Header() http.Header { func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1520,12 +1517,11 @@ func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1623,8 +1619,7 @@ func (c *FoldersGetIamPolicyCall) Header() http.Header { func (c *FoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1767,12 +1762,11 @@ func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1896,8 +1890,7 @@ func (c *FoldersMoveCall) Header() http.Header { func (c *FoldersMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movefolderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movefolderrequest) if err != nil { return nil, err } @@ -2014,8 +2007,7 @@ func (c *FoldersPatchCall) Header() http.Header { func (c *FoldersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -2114,8 +2106,7 @@ func (c *FoldersSearchCall) Header() http.Header { func (c *FoldersSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchfoldersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchfoldersrequest) if err != nil { return nil, err } @@ -2239,8 +2230,7 @@ func (c *FoldersSetIamPolicyCall) Header() http.Header { func (c *FoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2345,8 +2335,7 @@ func (c *FoldersTestIamPermissionsCall) Header() http.Header { func (c *FoldersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2453,8 +2442,7 @@ func (c *FoldersUndeleteCall) Header() http.Header { func (c *FoldersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletefolderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletefolderrequest) if err != nil { return nil, err } @@ -2566,12 +2554,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudresourcemanager/v3/cloudresourcemanager-gen.go b/cloudresourcemanager/v3/cloudresourcemanager-gen.go index 3b5c6ff5c1a..92f732bf2f6 100644 --- a/cloudresourcemanager/v3/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v3/cloudresourcemanager-gen.go @@ -125,7 +125,16 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.EffectiveTags = NewEffectiveTagsService(s) + s.Folders = NewFoldersService(s) + s.Liens = NewLiensService(s) + s.Operations = NewOperationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + s.TagBindings = NewTagBindingsService(s) + s.TagKeys = NewTagKeysService(s) + s.TagValues = NewTagValuesService(s) if err != nil { return nil, err } @@ -144,17 +153,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.EffectiveTags = NewEffectiveTagsService(s) - s.Folders = NewFoldersService(s) - s.Liens = NewLiensService(s) - s.Operations = NewOperationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - s.TagBindings = NewTagBindingsService(s) - s.TagKeys = NewTagKeysService(s) - s.TagValues = NewTagValuesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2148,12 +2147,11 @@ func (c *EffectiveTagsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/effectiveTags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2277,8 +2275,7 @@ func (c *FoldersCreateCall) Header() http.Header { func (c *FoldersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -2380,12 +2377,11 @@ func (c *FoldersDeleteCall) Header() http.Header { func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2491,12 +2487,11 @@ func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2594,8 +2589,7 @@ func (c *FoldersGetIamPolicyCall) Header() http.Header { func (c *FoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2740,12 +2734,11 @@ func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/folders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2869,8 +2862,7 @@ func (c *FoldersMoveCall) Header() http.Header { func (c *FoldersMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movefolderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movefolderrequest) if err != nil { return nil, err } @@ -2987,8 +2979,7 @@ func (c *FoldersPatchCall) Header() http.Header { func (c *FoldersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -3137,12 +3128,11 @@ func (c *FoldersSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/folders:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3258,8 +3248,7 @@ func (c *FoldersSetIamPolicyCall) Header() http.Header { func (c *FoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3365,8 +3354,7 @@ func (c *FoldersTestIamPermissionsCall) Header() http.Header { func (c *FoldersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3474,8 +3462,7 @@ func (c *FoldersUndeleteCall) Header() http.Header { func (c *FoldersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletefolderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletefolderrequest) if err != nil { return nil, err } @@ -3575,8 +3562,7 @@ func (c *LiensCreateCall) Header() http.Header { func (c *LiensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lien) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lien) if err != nil { return nil, err } @@ -3673,12 +3659,11 @@ func (c *LiensDeleteCall) Header() http.Header { func (c *LiensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3782,12 +3767,11 @@ func (c *LiensGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3913,12 +3897,11 @@ func (c *LiensListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/liens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4041,12 +4024,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4151,12 +4133,11 @@ func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4254,8 +4235,7 @@ func (c *OrganizationsGetIamPolicyCall) Header() http.Header { func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -4399,12 +4379,11 @@ func (c *OrganizationsSearchCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/organizations:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4521,8 +4500,7 @@ func (c *OrganizationsSetIamPolicyCall) Header() http.Header { func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4628,8 +4606,7 @@ func (c *OrganizationsTestIamPermissionsCall) Header() http.Header { func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4730,8 +4707,7 @@ func (c *ProjectsCreateCall) Header() http.Header { func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.project) if err != nil { return nil, err } @@ -4838,12 +4814,11 @@ func (c *ProjectsDeleteCall) Header() http.Header { func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4947,12 +4922,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5048,8 +5022,7 @@ func (c *ProjectsGetIamPolicyCall) Header() http.Header { func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5194,12 +5167,11 @@ func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5317,8 +5289,7 @@ func (c *ProjectsMoveCall) Header() http.Header { func (c *ProjectsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moveprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moveprojectrequest) if err != nil { return nil, err } @@ -5429,8 +5400,7 @@ func (c *ProjectsPatchCall) Header() http.Header { func (c *ProjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.project) if err != nil { return nil, err } @@ -5587,12 +5557,11 @@ func (c *ProjectsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/projects:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5731,8 +5700,7 @@ func (c *ProjectsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5836,8 +5804,7 @@ func (c *ProjectsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5943,8 +5910,7 @@ func (c *ProjectsUndeleteCall) Header() http.Header { func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteprojectrequest) if err != nil { return nil, err } @@ -6048,8 +6014,7 @@ func (c *TagBindingsCreateCall) Header() http.Header { func (c *TagBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagbinding) if err != nil { return nil, err } @@ -6147,12 +6112,11 @@ func (c *TagBindingsDeleteCall) Header() http.Header { func (c *TagBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6278,12 +6242,11 @@ func (c *TagBindingsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/tagBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6401,8 +6364,7 @@ func (c *TagKeysCreateCall) Header() http.Header { func (c *TagKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagkey) if err != nil { return nil, err } @@ -6516,12 +6478,11 @@ func (c *TagKeysDeleteCall) Header() http.Header { func (c *TagKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6624,12 +6585,11 @@ func (c *TagKeysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6727,8 +6687,7 @@ func (c *TagKeysGetIamPolicyCall) Header() http.Header { func (c *TagKeysGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -6845,12 +6804,11 @@ func (c *TagKeysGetNamespacedCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/tagKeys/namespaced") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6969,12 +6927,11 @@ func (c *TagKeysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/tagKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7103,8 +7060,7 @@ func (c *TagKeysPatchCall) Header() http.Header { func (c *TagKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagkey) if err != nil { return nil, err } @@ -7210,8 +7166,7 @@ func (c *TagKeysSetIamPolicyCall) Header() http.Header { func (c *TagKeysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7317,8 +7272,7 @@ func (c *TagKeysTestIamPermissionsCall) Header() http.Header { func (c *TagKeysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7426,8 +7380,7 @@ func (c *TagValuesCreateCall) Header() http.Header { func (c *TagValuesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagvalue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagvalue) if err != nil { return nil, err } @@ -7540,12 +7493,11 @@ func (c *TagValuesDeleteCall) Header() http.Header { func (c *TagValuesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7649,12 +7601,11 @@ func (c *TagValuesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7753,8 +7704,7 @@ func (c *TagValuesGetIamPolicyCall) Header() http.Header { func (c *TagValuesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -7873,12 +7823,11 @@ func (c *TagValuesGetNamespacedCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/tagValues/namespaced") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7997,12 +7946,11 @@ func (c *TagValuesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/tagValues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8127,8 +8075,7 @@ func (c *TagValuesPatchCall) Header() http.Header { func (c *TagValuesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagvalue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagvalue) if err != nil { return nil, err } @@ -8234,8 +8181,7 @@ func (c *TagValuesSetIamPolicyCall) Header() http.Header { func (c *TagValuesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8341,8 +8287,7 @@ func (c *TagValuesTestIamPermissionsCall) Header() http.Header { func (c *TagValuesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8453,8 +8398,7 @@ func (c *TagValuesTagHoldsCreateCall) Header() http.Header { func (c *TagValuesTagHoldsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.taghold) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.taghold) if err != nil { return nil, err } @@ -8561,12 +8505,11 @@ func (c *TagValuesTagHoldsDeleteCall) Header() http.Header { func (c *TagValuesTagHoldsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8699,12 +8642,11 @@ func (c *TagValuesTagHoldsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/tagHolds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudscheduler/v1/cloudscheduler-gen.go b/cloudscheduler/v1/cloudscheduler-gen.go index 83348d5b339..8e12664618c 100644 --- a/cloudscheduler/v1/cloudscheduler-gen.go +++ b/cloudscheduler/v1/cloudscheduler-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1058,8 +1057,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1160,12 +1158,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1269,12 +1266,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1397,12 +1393,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1526,12 +1521,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1657,12 +1651,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1777,8 +1770,7 @@ func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -1877,12 +1869,11 @@ func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1985,12 +1976,11 @@ func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2112,12 +2102,11 @@ func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2252,8 +2241,7 @@ func (c *ProjectsLocationsJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -2357,8 +2345,7 @@ func (c *ProjectsLocationsJobsPauseCall) Header() http.Header { func (c *ProjectsLocationsJobsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausejobrequest) if err != nil { return nil, err } @@ -2462,8 +2449,7 @@ func (c *ProjectsLocationsJobsResumeCall) Header() http.Header { func (c *ProjectsLocationsJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumejobrequest) if err != nil { return nil, err } @@ -2565,8 +2551,7 @@ func (c *ProjectsLocationsJobsRunCall) Header() http.Header { func (c *ProjectsLocationsJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runjobrequest) if err != nil { return nil, err } diff --git a/cloudscheduler/v1beta1/cloudscheduler-gen.go b/cloudscheduler/v1beta1/cloudscheduler-gen.go index 63dfe62151f..2a5d2b662b0 100644 --- a/cloudscheduler/v1beta1/cloudscheduler-gen.go +++ b/cloudscheduler/v1beta1/cloudscheduler-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -995,12 +994,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1126,12 +1124,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1246,8 +1243,7 @@ func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -1355,12 +1351,11 @@ func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1463,12 +1458,11 @@ func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1611,12 +1605,11 @@ func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1751,8 +1744,7 @@ func (c *ProjectsLocationsJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -1856,8 +1848,7 @@ func (c *ProjectsLocationsJobsPauseCall) Header() http.Header { func (c *ProjectsLocationsJobsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausejobrequest) if err != nil { return nil, err } @@ -1961,8 +1952,7 @@ func (c *ProjectsLocationsJobsResumeCall) Header() http.Header { func (c *ProjectsLocationsJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumejobrequest) if err != nil { return nil, err } @@ -2064,8 +2054,7 @@ func (c *ProjectsLocationsJobsRunCall) Header() http.Header { func (c *ProjectsLocationsJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runjobrequest) if err != nil { return nil, err } diff --git a/cloudsearch/v1/cloudsearch-gen.go b/cloudsearch/v1/cloudsearch-gen.go index b591115fc80..bf210e94808 100644 --- a/cloudsearch/v1/cloudsearch-gen.go +++ b/cloudsearch/v1/cloudsearch-gen.go @@ -151,7 +151,15 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Debug = NewDebugService(s) + s.Indexing = NewIndexingService(s) + s.Media = NewMediaService(s) + s.Operations = NewOperationsService(s) + s.Query = NewQueryService(s) + s.Settings = NewSettingsService(s) + s.Stats = NewStatsService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -170,16 +178,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Debug = NewDebugService(s) - s.Indexing = NewIndexingService(s) - s.Media = NewMediaService(s) - s.Operations = NewOperationsService(s) - s.Query = NewQueryService(s) - s.Settings = NewSettingsService(s) - s.Stats = NewStatsService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7957,8 +7956,7 @@ func (c *DebugDatasourcesItemsCheckAccessCall) Header() http.Header { func (c *DebugDatasourcesItemsCheckAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.principal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.principal) if err != nil { return nil, err } @@ -8061,8 +8059,7 @@ func (c *DebugDatasourcesItemsSearchByViewUrlCall) Header() http.Header { func (c *DebugDatasourcesItemsSearchByViewUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchitemsbyviewurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchitemsbyviewurlrequest) if err != nil { return nil, err } @@ -8218,12 +8215,11 @@ func (c *DebugDatasourcesItemsUnmappedidsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+parent}/unmappedids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8383,12 +8379,11 @@ func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+parent}/items:forunmappedidentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8567,12 +8562,11 @@ func (c *DebugIdentitysourcesUnmappedidsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+parent}/unmappedids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8694,12 +8688,11 @@ func (c *IndexingDatasourcesDeleteSchemaCall) Header() http.Header { func (c *IndexingDatasourcesDeleteSchemaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/schema") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8811,12 +8804,11 @@ func (c *IndexingDatasourcesGetSchemaCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/schema") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8912,8 +8904,7 @@ func (c *IndexingDatasourcesUpdateSchemaCall) Header() http.Header { func (c *IndexingDatasourcesUpdateSchemaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateschemarequest) if err != nil { return nil, err } @@ -9061,12 +9052,11 @@ func (c *IndexingDatasourcesItemsDeleteCall) Header() http.Header { func (c *IndexingDatasourcesItemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9162,8 +9152,7 @@ func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) Header() http.Header { func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deletequeueitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deletequeueitemsrequest) if err != nil { return nil, err } @@ -9291,12 +9280,11 @@ func (c *IndexingDatasourcesItemsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9394,8 +9382,7 @@ func (c *IndexingDatasourcesItemsIndexCall) Header() http.Header { func (c *IndexingDatasourcesItemsIndexCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.indexitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.indexitemrequest) if err != nil { return nil, err } @@ -9551,12 +9538,11 @@ func (c *IndexingDatasourcesItemsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/items") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9681,8 +9667,7 @@ func (c *IndexingDatasourcesItemsPollCall) Header() http.Header { func (c *IndexingDatasourcesItemsPollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pollitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pollitemsrequest) if err != nil { return nil, err } @@ -9787,8 +9772,7 @@ func (c *IndexingDatasourcesItemsPushCall) Header() http.Header { func (c *IndexingDatasourcesItemsPushCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pushitemrequest) if err != nil { return nil, err } @@ -9893,8 +9877,7 @@ func (c *IndexingDatasourcesItemsUnreserveCall) Header() http.Header { func (c *IndexingDatasourcesItemsUnreserveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unreserveitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unreserveitemsrequest) if err != nil { return nil, err } @@ -9999,8 +9982,7 @@ func (c *IndexingDatasourcesItemsUploadCall) Header() http.Header { func (c *IndexingDatasourcesItemsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startuploaditemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startuploaditemrequest) if err != nil { return nil, err } @@ -10155,8 +10137,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.media) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.media) if err != nil { return nil, err } @@ -10167,14 +10148,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/media/{+resourceName}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -10296,12 +10273,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10424,12 +10400,11 @@ func (c *OperationsLroListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/lro") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10544,8 +10519,7 @@ func (c *QueryDebugSearchCall) Header() http.Header { func (c *QueryDebugSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchrequest) if err != nil { return nil, err } @@ -10643,8 +10617,7 @@ func (c *QueryRemoveActivityCall) Header() http.Header { func (c *QueryRemoveActivityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeactivityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeactivityrequest) if err != nil { return nil, err } @@ -10745,8 +10718,7 @@ func (c *QuerySearchCall) Header() http.Header { func (c *QuerySearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchrequest) if err != nil { return nil, err } @@ -10843,8 +10815,7 @@ func (c *QuerySuggestCall) Header() http.Header { func (c *QuerySuggestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.suggestrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.suggestrequest) if err != nil { return nil, err } @@ -11004,12 +10975,11 @@ func (c *QuerySourcesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/query/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11127,12 +11097,11 @@ func (c *SettingsGetCustomerCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/customer") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11229,8 +11198,7 @@ func (c *SettingsUpdateCustomerCall) Header() http.Header { func (c *SettingsUpdateCustomerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customersettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customersettings) if err != nil { return nil, err } @@ -11324,8 +11292,7 @@ func (c *SettingsDatasourcesCreateCall) Header() http.Header { func (c *SettingsDatasourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -11429,12 +11396,11 @@ func (c *SettingsDatasourcesDeleteCall) Header() http.Header { func (c *SettingsDatasourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11546,12 +11512,11 @@ func (c *SettingsDatasourcesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11673,12 +11638,11 @@ func (c *SettingsDatasourcesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/datasources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11813,8 +11777,7 @@ func (c *SettingsDatasourcesPatchCall) Header() http.Header { func (c *SettingsDatasourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -11916,8 +11879,7 @@ func (c *SettingsDatasourcesUpdateCall) Header() http.Header { func (c *SettingsDatasourcesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedatasourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatedatasourcerequest) if err != nil { return nil, err } @@ -12014,8 +11976,7 @@ func (c *SettingsSearchapplicationsCreateCall) Header() http.Header { func (c *SettingsSearchapplicationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchapplication) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchapplication) if err != nil { return nil, err } @@ -12120,12 +12081,11 @@ func (c *SettingsSearchapplicationsDeleteCall) Header() http.Header { func (c *SettingsSearchapplicationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12237,12 +12197,11 @@ func (c *SettingsSearchapplicationsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12364,12 +12323,11 @@ func (c *SettingsSearchapplicationsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/searchapplications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12497,8 +12455,7 @@ func (c *SettingsSearchapplicationsPatchCall) Header() http.Header { func (c *SettingsSearchapplicationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchapplication) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchapplication) if err != nil { return nil, err } @@ -12600,8 +12557,7 @@ func (c *SettingsSearchapplicationsResetCall) Header() http.Header { func (c *SettingsSearchapplicationsResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetsearchapplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetsearchapplicationrequest) if err != nil { return nil, err } @@ -12718,8 +12674,7 @@ func (c *SettingsSearchapplicationsUpdateCall) Header() http.Header { func (c *SettingsSearchapplicationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchapplication) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchapplication) if err != nil { return nil, err } @@ -12870,12 +12825,11 @@ func (c *StatsGetIndexCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/index") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13014,12 +12968,11 @@ func (c *StatsGetQueryCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13158,12 +13111,11 @@ func (c *StatsGetSearchapplicationCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/searchapplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13303,12 +13255,11 @@ func (c *StatsGetSessionCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/session") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13447,12 +13398,11 @@ func (c *StatsGetUserCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/user") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13596,12 +13546,11 @@ func (c *StatsIndexDatasourcesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/index/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13748,12 +13697,11 @@ func (c *StatsQuerySearchapplicationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/query/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13901,12 +13849,11 @@ func (c *StatsSessionSearchapplicationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/session/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14053,12 +14000,11 @@ func (c *StatsUserSearchapplicationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/user/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14148,8 +14094,7 @@ func (c *V1InitializeCustomerCall) Header() http.Header { func (c *V1InitializeCustomerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initializecustomerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initializecustomerrequest) if err != nil { return nil, err } diff --git a/cloudshell/v1/cloudshell-gen.go b/cloudshell/v1/cloudshell-gen.go index acd3c04f280..ddb1a7ba7f8 100644 --- a/cloudshell/v1/cloudshell-gen.go +++ b/cloudshell/v1/cloudshell-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -650,8 +649,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -752,12 +750,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -861,12 +858,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -989,12 +985,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1112,8 +1107,7 @@ func (c *UsersEnvironmentsAddPublicKeyCall) Header() http.Header { func (c *UsersEnvironmentsAddPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addpublickeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addpublickeyrequest) if err != nil { return nil, err } @@ -1218,8 +1212,7 @@ func (c *UsersEnvironmentsAuthorizeCall) Header() http.Header { func (c *UsersEnvironmentsAuthorizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizeenvironmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizeenvironmentrequest) if err != nil { return nil, err } @@ -1332,12 +1325,11 @@ func (c *UsersEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1433,8 +1425,7 @@ func (c *UsersEnvironmentsRemovePublicKeyCall) Header() http.Header { func (c *UsersEnvironmentsRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removepublickeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removepublickeyrequest) if err != nil { return nil, err } @@ -1541,8 +1532,7 @@ func (c *UsersEnvironmentsStartCall) Header() http.Header { func (c *UsersEnvironmentsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startenvironmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startenvironmentrequest) if err != nil { return nil, err } diff --git a/cloudsupport/v2/cloudsupport-gen.go b/cloudsupport/v2/cloudsupport-gen.go index 833b3a2cb70..51e9f886d50 100644 --- a/cloudsupport/v2/cloudsupport-gen.go +++ b/cloudsupport/v2/cloudsupport-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.CaseClassifications = NewCaseClassificationsService(s) + s.Cases = NewCasesService(s) + s.Media = NewMediaService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.CaseClassifications = NewCaseClassificationsService(s) - s.Cases = NewCasesService(s) - s.Media = NewMediaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1221,12 +1220,11 @@ func (c *CaseClassificationsSearchCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/caseClassifications:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1346,8 +1344,7 @@ func (c *CasesCloseCall) Header() http.Header { func (c *CasesCloseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.closecaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.closecaserequest) if err != nil { return nil, err } @@ -1471,8 +1468,7 @@ func (c *CasesCreateCall) Header() http.Header { func (c *CasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.case_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.case_) if err != nil { return nil, err } @@ -1589,8 +1585,7 @@ func (c *CasesEscalateCall) Header() http.Header { func (c *CasesEscalateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.escalatecaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.escalatecaserequest) if err != nil { return nil, err } @@ -1709,12 +1704,11 @@ func (c *CasesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1858,12 +1852,11 @@ func (c *CasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/cases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2001,8 +1994,7 @@ func (c *CasesPatchCall) Header() http.Header { func (c *CasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.case_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.case_) if err != nil { return nil, err } @@ -2160,12 +2152,11 @@ func (c *CasesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/cases:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2314,12 +2305,11 @@ func (c *CasesAttachmentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/attachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2445,8 +2435,7 @@ func (c *CasesCommentsCreateCall) Header() http.Header { func (c *CasesCommentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -2580,12 +2569,11 @@ func (c *CasesCommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2721,12 +2709,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2891,8 +2878,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createattachmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createattachmentrequest) if err != nil { return nil, err } @@ -2903,14 +2889,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v2/{+parent}/attachments") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/cloudsupport/v2beta/cloudsupport-gen.go b/cloudsupport/v2beta/cloudsupport-gen.go index c9d8a45b7b8..5cc87c1ec5b 100644 --- a/cloudsupport/v2beta/cloudsupport-gen.go +++ b/cloudsupport/v2beta/cloudsupport-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.CaseClassifications = NewCaseClassificationsService(s) + s.Cases = NewCasesService(s) + s.Media = NewMediaService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.CaseClassifications = NewCaseClassificationsService(s) - s.Cases = NewCasesService(s) - s.Media = NewMediaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1395,12 +1394,11 @@ func (c *CaseClassificationsSearchCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/caseClassifications:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1520,8 +1518,7 @@ func (c *CasesCloseCall) Header() http.Header { func (c *CasesCloseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.closecaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.closecaserequest) if err != nil { return nil, err } @@ -1645,8 +1642,7 @@ func (c *CasesCreateCall) Header() http.Header { func (c *CasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.case_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.case_) if err != nil { return nil, err } @@ -1763,8 +1759,7 @@ func (c *CasesEscalateCall) Header() http.Header { func (c *CasesEscalateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.escalatecaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.escalatecaserequest) if err != nil { return nil, err } @@ -1883,12 +1878,11 @@ func (c *CasesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2045,12 +2039,11 @@ func (c *CasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/cases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2188,8 +2181,7 @@ func (c *CasesPatchCall) Header() http.Header { func (c *CasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.case_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.case_) if err != nil { return nil, err } @@ -2350,12 +2342,11 @@ func (c *CasesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/cases:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2502,12 +2493,11 @@ func (c *CasesShowFeedCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}:showFeed") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2656,12 +2646,11 @@ func (c *CasesAttachmentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/attachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2787,8 +2776,7 @@ func (c *CasesCommentsCreateCall) Header() http.Header { func (c *CasesCommentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -2922,12 +2910,11 @@ func (c *CasesCommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3063,12 +3050,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3233,8 +3219,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createattachmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createattachmentrequest) if err != nil { return nil, err } @@ -3245,14 +3230,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v2beta/{+parent}/attachments") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/cloudtasks/v2/cloudtasks-gen.go b/cloudtasks/v2/cloudtasks-gen.go index bb086418b31..1a280802ccb 100644 --- a/cloudtasks/v2/cloudtasks-gen.go +++ b/cloudtasks/v2/cloudtasks-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2016,12 +2015,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2126,12 +2124,11 @@ func (c *ProjectsLocationsGetCmekConfigCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2257,12 +2254,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2388,8 +2384,7 @@ func (c *ProjectsLocationsUpdateCmekConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateCmekConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmekconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cmekconfig) if err != nil { return nil, err } @@ -2497,8 +2492,7 @@ func (c *ProjectsLocationsQueuesCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queue) if err != nil { return nil, err } @@ -2609,12 +2603,11 @@ func (c *ProjectsLocationsQueuesDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2717,12 +2710,11 @@ func (c *ProjectsLocationsQueuesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2819,8 +2811,7 @@ func (c *ProjectsLocationsQueuesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsQueuesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2964,12 +2955,11 @@ func (c *ProjectsLocationsQueuesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/queues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3108,8 +3098,7 @@ func (c *ProjectsLocationsQueuesPatchCall) Header() http.Header { func (c *ProjectsLocationsQueuesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queue) if err != nil { return nil, err } @@ -3213,8 +3202,7 @@ func (c *ProjectsLocationsQueuesPauseCall) Header() http.Header { func (c *ProjectsLocationsQueuesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausequeuerequest) if err != nil { return nil, err } @@ -3318,8 +3306,7 @@ func (c *ProjectsLocationsQueuesPurgeCall) Header() http.Header { func (c *ProjectsLocationsQueuesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.purgequeuerequest) if err != nil { return nil, err } @@ -3426,8 +3413,7 @@ func (c *ProjectsLocationsQueuesResumeCall) Header() http.Header { func (c *ProjectsLocationsQueuesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumequeuerequest) if err != nil { return nil, err } @@ -3534,8 +3520,7 @@ func (c *ProjectsLocationsQueuesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsQueuesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3642,8 +3627,7 @@ func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsQueuesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3756,8 +3740,7 @@ func (c *ProjectsLocationsQueuesTasksBufferCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksBufferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buffertaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buffertaskrequest) if err != nil { return nil, err } @@ -3862,8 +3845,7 @@ func (c *ProjectsLocationsQueuesTasksCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtaskrequest) if err != nil { return nil, err } @@ -3964,12 +3946,11 @@ func (c *ProjectsLocationsQueuesTasksDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4098,12 +4079,11 @@ func (c *ProjectsLocationsQueuesTasksGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4255,12 +4235,11 @@ func (c *ProjectsLocationsQueuesTasksListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4384,8 +4363,7 @@ func (c *ProjectsLocationsQueuesTasksRunCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtaskrequest) if err != nil { return nil, err } diff --git a/cloudtasks/v2beta2/cloudtasks-gen.go b/cloudtasks/v2beta2/cloudtasks-gen.go index c957b7e6ff0..7e09ee0fa1b 100644 --- a/cloudtasks/v2beta2/cloudtasks-gen.go +++ b/cloudtasks/v2beta2/cloudtasks-gen.go @@ -117,7 +117,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Api = NewApiService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,10 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Api = NewApiService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2350,8 +2349,7 @@ func (c *ApiQueueUpdateCall) Header() http.Header { func (c *ApiQueueUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpbody) if err != nil { return nil, err } @@ -2458,12 +2456,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2568,12 +2565,11 @@ func (c *ProjectsLocationsGetCmekConfigCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2699,12 +2695,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2830,8 +2825,7 @@ func (c *ProjectsLocationsUpdateCmekConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateCmekConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmekconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cmekconfig) if err != nil { return nil, err } @@ -2939,8 +2933,7 @@ func (c *ProjectsLocationsQueuesCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queue) if err != nil { return nil, err } @@ -3051,12 +3044,11 @@ func (c *ProjectsLocationsQueuesDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3168,12 +3160,11 @@ func (c *ProjectsLocationsQueuesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3270,8 +3261,7 @@ func (c *ProjectsLocationsQueuesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsQueuesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -3424,12 +3414,11 @@ func (c *ProjectsLocationsQueuesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/queues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3568,8 +3557,7 @@ func (c *ProjectsLocationsQueuesPatchCall) Header() http.Header { func (c *ProjectsLocationsQueuesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queue) if err != nil { return nil, err } @@ -3673,8 +3661,7 @@ func (c *ProjectsLocationsQueuesPauseCall) Header() http.Header { func (c *ProjectsLocationsQueuesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausequeuerequest) if err != nil { return nil, err } @@ -3778,8 +3765,7 @@ func (c *ProjectsLocationsQueuesPurgeCall) Header() http.Header { func (c *ProjectsLocationsQueuesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.purgequeuerequest) if err != nil { return nil, err } @@ -3886,8 +3872,7 @@ func (c *ProjectsLocationsQueuesResumeCall) Header() http.Header { func (c *ProjectsLocationsQueuesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumequeuerequest) if err != nil { return nil, err } @@ -3994,8 +3979,7 @@ func (c *ProjectsLocationsQueuesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsQueuesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4102,8 +4086,7 @@ func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsQueuesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4210,8 +4193,7 @@ func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgetaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acknowledgetaskrequest) if err != nil { return nil, err } @@ -4323,8 +4305,7 @@ func (c *ProjectsLocationsQueuesTasksBufferCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksBufferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buffertaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buffertaskrequest) if err != nil { return nil, err } @@ -4429,8 +4410,7 @@ func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelleaserequest) if err != nil { return nil, err } @@ -4534,8 +4514,7 @@ func (c *ProjectsLocationsQueuesTasksCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtaskrequest) if err != nil { return nil, err } @@ -4636,12 +4615,11 @@ func (c *ProjectsLocationsQueuesTasksDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4771,12 +4749,11 @@ func (c *ProjectsLocationsQueuesTasksGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4877,8 +4854,7 @@ func (c *ProjectsLocationsQueuesTasksLeaseCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.leasetasksrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.leasetasksrequest) if err != nil { return nil, err } @@ -5040,12 +5016,11 @@ func (c *ProjectsLocationsQueuesTasksListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5162,8 +5137,7 @@ func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renewleaserequest) if err != nil { return nil, err } @@ -5276,8 +5250,7 @@ func (c *ProjectsLocationsQueuesTasksRunCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtaskrequest) if err != nil { return nil, err } diff --git a/cloudtasks/v2beta3/cloudtasks-gen.go b/cloudtasks/v2beta3/cloudtasks-gen.go index b5798a55232..988ee42cb23 100644 --- a/cloudtasks/v2beta3/cloudtasks-gen.go +++ b/cloudtasks/v2beta3/cloudtasks-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2173,12 +2172,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2283,12 +2281,11 @@ func (c *ProjectsLocationsGetCmekConfigCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2414,12 +2411,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2545,8 +2541,7 @@ func (c *ProjectsLocationsUpdateCmekConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateCmekConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmekconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cmekconfig) if err != nil { return nil, err } @@ -2654,8 +2649,7 @@ func (c *ProjectsLocationsQueuesCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queue) if err != nil { return nil, err } @@ -2766,12 +2760,11 @@ func (c *ProjectsLocationsQueuesDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2883,12 +2876,11 @@ func (c *ProjectsLocationsQueuesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2985,8 +2977,7 @@ func (c *ProjectsLocationsQueuesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsQueuesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -3139,12 +3130,11 @@ func (c *ProjectsLocationsQueuesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+parent}/queues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3283,8 +3273,7 @@ func (c *ProjectsLocationsQueuesPatchCall) Header() http.Header { func (c *ProjectsLocationsQueuesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queue) if err != nil { return nil, err } @@ -3388,8 +3377,7 @@ func (c *ProjectsLocationsQueuesPauseCall) Header() http.Header { func (c *ProjectsLocationsQueuesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausequeuerequest) if err != nil { return nil, err } @@ -3493,8 +3481,7 @@ func (c *ProjectsLocationsQueuesPurgeCall) Header() http.Header { func (c *ProjectsLocationsQueuesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.purgequeuerequest) if err != nil { return nil, err } @@ -3601,8 +3588,7 @@ func (c *ProjectsLocationsQueuesResumeCall) Header() http.Header { func (c *ProjectsLocationsQueuesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumequeuerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumequeuerequest) if err != nil { return nil, err } @@ -3709,8 +3695,7 @@ func (c *ProjectsLocationsQueuesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsQueuesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3817,8 +3802,7 @@ func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsQueuesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3931,8 +3915,7 @@ func (c *ProjectsLocationsQueuesTasksBufferCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksBufferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.buffertaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.buffertaskrequest) if err != nil { return nil, err } @@ -4037,8 +4020,7 @@ func (c *ProjectsLocationsQueuesTasksCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtaskrequest) if err != nil { return nil, err } @@ -4139,12 +4121,11 @@ func (c *ProjectsLocationsQueuesTasksDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4273,12 +4254,11 @@ func (c *ProjectsLocationsQueuesTasksGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4430,12 +4410,11 @@ func (c *ProjectsLocationsQueuesTasksListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta3/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4561,8 +4540,7 @@ func (c *ProjectsLocationsQueuesTasksRunCall) Header() http.Header { func (c *ProjectsLocationsQueuesTasksRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtaskrequest) if err != nil { return nil, err } diff --git a/cloudtrace/v1/cloudtrace-gen.go b/cloudtrace/v1/cloudtrace-gen.go index 83ef93afed1..e95df51ee5b 100644 --- a/cloudtrace/v1/cloudtrace-gen.go +++ b/cloudtrace/v1/cloudtrace-gen.go @@ -128,7 +128,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -147,9 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -388,8 +387,7 @@ func (c *ProjectsPatchTracesCall) Header() http.Header { func (c *ProjectsPatchTracesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.traces) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.traces) if err != nil { return nil, err } @@ -502,12 +500,11 @@ func (c *ProjectsTracesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/traces/{traceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -702,12 +699,11 @@ func (c *ProjectsTracesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/traces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/cloudtrace/v2/cloudtrace-gen.go b/cloudtrace/v2/cloudtrace-gen.go index 35964843290..70f80a9a31b 100644 --- a/cloudtrace/v2/cloudtrace-gen.go +++ b/cloudtrace/v2/cloudtrace-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -801,8 +800,7 @@ func (c *ProjectsTracesBatchWriteCall) Header() http.Header { func (c *ProjectsTracesBatchWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchwritespansrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchwritespansrequest) if err != nil { return nil, err } @@ -908,8 +906,7 @@ func (c *ProjectsTracesSpansCreateSpanCall) Header() http.Header { func (c *ProjectsTracesSpansCreateSpanCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.span) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.span) if err != nil { return nil, err } diff --git a/cloudtrace/v2beta1/cloudtrace-gen.go b/cloudtrace/v2beta1/cloudtrace-gen.go index f68ce9afbbf..9a2cfdf4ac4 100644 --- a/cloudtrace/v2beta1/cloudtrace-gen.go +++ b/cloudtrace/v2beta1/cloudtrace-gen.go @@ -128,7 +128,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -147,9 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -343,8 +342,7 @@ func (c *ProjectsTraceSinksCreateCall) Header() http.Header { func (c *ProjectsTraceSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tracesink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tracesink) if err != nil { return nil, err } @@ -445,12 +443,11 @@ func (c *ProjectsTraceSinksDeleteCall) Header() http.Header { func (c *ProjectsTraceSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -554,12 +551,11 @@ func (c *ProjectsTraceSinksGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -681,12 +677,11 @@ func (c *ProjectsTraceSinksListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/traceSinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -817,8 +812,7 @@ func (c *ProjectsTraceSinksPatchCall) Header() http.Header { func (c *ProjectsTraceSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tracesink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tracesink) if err != nil { return nil, err } diff --git a/composer/v1/composer-gen.go b/composer/v1/composer-gen.go index 8c4a354f108..f450a9a5e9f 100644 --- a/composer/v1/composer-gen.go +++ b/composer/v1/composer-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2539,8 +2538,7 @@ func (c *ProjectsLocationsEnvironmentsCheckUpgradeCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsCheckUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkupgraderequest) if err != nil { return nil, err } @@ -2641,8 +2639,7 @@ func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -2744,8 +2741,7 @@ func (c *ProjectsLocationsEnvironmentsDatabaseFailoverCall) Header() http.Header func (c *ProjectsLocationsEnvironmentsDatabaseFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databasefailoverrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databasefailoverrequest) if err != nil { return nil, err } @@ -2844,12 +2840,11 @@ func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2942,8 +2937,7 @@ func (c *ProjectsLocationsEnvironmentsExecuteAirflowCommandCall) Header() http.H func (c *ProjectsLocationsEnvironmentsExecuteAirflowCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executeairflowcommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executeairflowcommandrequest) if err != nil { return nil, err } @@ -3055,12 +3049,11 @@ func (c *ProjectsLocationsEnvironmentsFetchDatabasePropertiesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+environment}:fetchDatabaseProperties") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3164,12 +3157,11 @@ func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3286,12 +3278,11 @@ func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3408,8 +3399,7 @@ func (c *ProjectsLocationsEnvironmentsLoadSnapshotCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsLoadSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loadsnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loadsnapshotrequest) if err != nil { return nil, err } @@ -3592,8 +3582,7 @@ func (c *ProjectsLocationsEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -3694,8 +3683,7 @@ func (c *ProjectsLocationsEnvironmentsPollAirflowCommandCall) Header() http.Head func (c *ProjectsLocationsEnvironmentsPollAirflowCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pollairflowcommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pollairflowcommandrequest) if err != nil { return nil, err } @@ -3799,8 +3787,7 @@ func (c *ProjectsLocationsEnvironmentsSaveSnapshotCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsSaveSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savesnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savesnapshotrequest) if err != nil { return nil, err } @@ -3901,8 +3888,7 @@ func (c *ProjectsLocationsEnvironmentsStopAirflowCommandCall) Header() http.Head func (c *ProjectsLocationsEnvironmentsStopAirflowCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopairflowcommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopairflowcommandrequest) if err != nil { return nil, err } @@ -4006,8 +3992,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) Header( func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadsconfigmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadsconfigmap) if err != nil { return nil, err } @@ -4110,12 +4095,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) Header( func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4221,12 +4205,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4345,12 +4328,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userWorkloadsConfigMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4468,8 +4450,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) Header( func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadsconfigmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadsconfigmap) if err != nil { return nil, err } @@ -4572,8 +4553,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) Header() h func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadssecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadssecret) if err != nil { return nil, err } @@ -4675,12 +4655,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) Header() h func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4786,12 +4765,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4910,12 +4888,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userWorkloadsSecrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5032,8 +5009,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) Header() h func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadssecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadssecret) if err != nil { return nil, err } @@ -5171,12 +5147,11 @@ func (c *ProjectsLocationsEnvironmentsWorkloadsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5322,12 +5297,11 @@ func (c *ProjectsLocationsImageVersionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/imageVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5442,12 +5416,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5551,12 +5524,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5679,12 +5651,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/composer/v1beta1/composer-gen.go b/composer/v1beta1/composer-gen.go index 4bfbcda33fc..93e5acff7b9 100644 --- a/composer/v1beta1/composer-gen.go +++ b/composer/v1beta1/composer-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2562,8 +2561,7 @@ func (c *ProjectsLocationsEnvironmentsCheckUpgradeCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsCheckUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkupgraderequest) if err != nil { return nil, err } @@ -2664,8 +2662,7 @@ func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -2767,8 +2764,7 @@ func (c *ProjectsLocationsEnvironmentsDatabaseFailoverCall) Header() http.Header func (c *ProjectsLocationsEnvironmentsDatabaseFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databasefailoverrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databasefailoverrequest) if err != nil { return nil, err } @@ -2867,12 +2863,11 @@ func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2965,8 +2960,7 @@ func (c *ProjectsLocationsEnvironmentsExecuteAirflowCommandCall) Header() http.H func (c *ProjectsLocationsEnvironmentsExecuteAirflowCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executeairflowcommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executeairflowcommandrequest) if err != nil { return nil, err } @@ -3078,12 +3072,11 @@ func (c *ProjectsLocationsEnvironmentsFetchDatabasePropertiesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+environment}:fetchDatabaseProperties") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3187,12 +3180,11 @@ func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3309,12 +3301,11 @@ func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3431,8 +3422,7 @@ func (c *ProjectsLocationsEnvironmentsLoadSnapshotCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsLoadSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loadsnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loadsnapshotrequest) if err != nil { return nil, err } @@ -3630,8 +3620,7 @@ func (c *ProjectsLocationsEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -3732,8 +3721,7 @@ func (c *ProjectsLocationsEnvironmentsPollAirflowCommandCall) Header() http.Head func (c *ProjectsLocationsEnvironmentsPollAirflowCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pollairflowcommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pollairflowcommandrequest) if err != nil { return nil, err } @@ -3836,8 +3824,7 @@ func (c *ProjectsLocationsEnvironmentsRestartWebServerCall) Header() http.Header func (c *ProjectsLocationsEnvironmentsRestartWebServerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartwebserverrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartwebserverrequest) if err != nil { return nil, err } @@ -3940,8 +3927,7 @@ func (c *ProjectsLocationsEnvironmentsSaveSnapshotCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsSaveSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savesnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savesnapshotrequest) if err != nil { return nil, err } @@ -4042,8 +4028,7 @@ func (c *ProjectsLocationsEnvironmentsStopAirflowCommandCall) Header() http.Head func (c *ProjectsLocationsEnvironmentsStopAirflowCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopairflowcommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopairflowcommandrequest) if err != nil { return nil, err } @@ -4147,8 +4132,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) Header( func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadsconfigmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadsconfigmap) if err != nil { return nil, err } @@ -4251,12 +4235,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) Header( func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4362,12 +4345,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4486,12 +4468,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userWorkloadsConfigMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4609,8 +4590,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) Header( func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadsconfigmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadsconfigmap) if err != nil { return nil, err } @@ -4713,8 +4693,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) Header() h func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadssecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadssecret) if err != nil { return nil, err } @@ -4816,12 +4795,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) Header() h func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4927,12 +4905,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5051,12 +5028,11 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userWorkloadsSecrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5173,8 +5149,7 @@ func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) Header() h func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadssecret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userworkloadssecret) if err != nil { return nil, err } @@ -5312,12 +5287,11 @@ func (c *ProjectsLocationsEnvironmentsWorkloadsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workloads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5463,12 +5437,11 @@ func (c *ProjectsLocationsImageVersionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/imageVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5583,12 +5556,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5692,12 +5664,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5820,12 +5791,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/compute/v0.alpha/compute-gen.go b/compute/v0.alpha/compute-gen.go index 8645377b7a2..4e85382db97 100644 --- a/compute/v0.alpha/compute-gen.go +++ b/compute/v0.alpha/compute-gen.go @@ -142,25 +142,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.AcceleratorTypes = NewAcceleratorTypesService(s) s.Addresses = NewAddressesService(s) @@ -279,9 +260,27 @@ func New(client *http.Client) (*Service, error) { s.ZoneOperations = NewZoneOperationsService(s) s.ZoneQueuedResources = NewZoneQueuedResourcesService(s) s.Zones = NewZonesService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL diff --git a/compute/v0.alpha/compute2-gen.go b/compute/v0.alpha/compute2-gen.go index ce8b8c240fd..b44a7938b48 100644 --- a/compute/v0.alpha/compute2-gen.go +++ b/compute/v0.alpha/compute2-gen.go @@ -9,7 +9,6 @@ package compute import ( "context" "fmt" - "io" "net/http" googleapi "google.golang.org/api/googleapi" @@ -171,12 +170,11 @@ func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -306,12 +304,11 @@ func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -498,12 +495,11 @@ func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -729,12 +725,11 @@ func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -867,12 +862,11 @@ func (c *AddressesDeleteCall) Header() http.Header { func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -982,12 +976,11 @@ func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1100,8 +1093,7 @@ func (c *AddressesInsertCall) Header() http.Header { func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.address) if err != nil { return nil, err } @@ -1293,12 +1285,11 @@ func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1433,8 +1424,7 @@ func (c *AddressesMoveCall) Header() http.Header { func (c *AddressesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionaddressesmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionaddressesmoverequest) if err != nil { return nil, err } @@ -1558,8 +1548,7 @@ func (c *AddressesSetLabelsCall) Header() http.Header { func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -1668,8 +1657,7 @@ func (c *AddressesTestIamPermissionsCall) Header() http.Header { func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -1883,12 +1871,11 @@ func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2021,12 +2008,11 @@ func (c *AutoscalersDeleteCall) Header() http.Header { func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2136,12 +2122,11 @@ func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2254,8 +2239,7 @@ func (c *AutoscalersInsertCall) Header() http.Header { func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2447,12 +2431,11 @@ func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2593,8 +2576,7 @@ func (c *AutoscalersPatchCall) Header() http.Header { func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2702,8 +2684,7 @@ func (c *AutoscalersTestIamPermissionsCall) Header() http.Header { func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -2832,8 +2813,7 @@ func (c *AutoscalersUpdateCall) Header() http.Header { func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2954,8 +2934,7 @@ func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header { func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signedurlkey) if err != nil { return nil, err } @@ -3072,12 +3051,11 @@ func (c *BackendBucketsDeleteCall) Header() http.Header { func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3190,12 +3168,11 @@ func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header { func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3301,12 +3278,11 @@ func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3420,12 +3396,11 @@ func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3534,8 +3509,7 @@ func (c *BackendBucketsInsertCall) Header() http.Header { func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -3724,12 +3698,11 @@ func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3932,12 +3905,11 @@ func (c *BackendBucketsListUsableCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4071,8 +4043,7 @@ func (c *BackendBucketsPatchCall) Header() http.Header { func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -4193,8 +4164,7 @@ func (c *BackendBucketsSetEdgeSecurityPolicyCall) Header() http.Header { func (c *BackendBucketsSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -4299,8 +4269,7 @@ func (c *BackendBucketsSetIamPolicyCall) Header() http.Header { func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -4405,8 +4374,7 @@ func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header { func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -4527,8 +4495,7 @@ func (c *BackendBucketsUpdateCall) Header() http.Header { func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -4649,8 +4616,7 @@ func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header { func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signedurlkey) if err != nil { return nil, err } @@ -4862,12 +4828,11 @@ func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4997,12 +4962,11 @@ func (c *BackendServicesDeleteCall) Header() http.Header { func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5115,12 +5079,11 @@ func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header { func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5226,12 +5189,11 @@ func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5338,12 +5300,11 @@ func (c *BackendServicesGetEffectiveSecurityPoliciesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/getEffectiveSecurityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5443,8 +5404,7 @@ func (c *BackendServicesGetHealthCall) Header() http.Header { func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcegroupreference) if err != nil { return nil, err } @@ -5567,12 +5527,11 @@ func (c *BackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5682,8 +5641,7 @@ func (c *BackendServicesInsertCall) Header() http.Header { func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -5872,12 +5830,11 @@ func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6080,12 +6037,11 @@ func (c *BackendServicesListUsableCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6220,8 +6176,7 @@ func (c *BackendServicesPatchCall) Header() http.Header { func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -6342,8 +6297,7 @@ func (c *BackendServicesSetEdgeSecurityPolicyCall) Header() http.Header { func (c *BackendServicesSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -6448,8 +6402,7 @@ func (c *BackendServicesSetIamPolicyCall) Header() http.Header { func (c *BackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -6571,8 +6524,7 @@ func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header { func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -6677,8 +6629,7 @@ func (c *BackendServicesTestIamPermissionsCall) Header() http.Header { func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -6799,8 +6750,7 @@ func (c *BackendServicesUpdateCall) Header() http.Header { func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -6918,12 +6868,11 @@ func (c *CrossSiteNetworksDeleteCall) Header() http.Header { func (c *CrossSiteNetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/crossSiteNetworks/{crossSiteNetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7029,12 +6978,11 @@ func (c *CrossSiteNetworksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/crossSiteNetworks/{crossSiteNetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7152,8 +7100,7 @@ func (c *CrossSiteNetworksInsertCall) Header() http.Header { func (c *CrossSiteNetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.crosssitenetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.crosssitenetwork) if err != nil { return nil, err } @@ -7341,12 +7288,11 @@ func (c *CrossSiteNetworksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/crossSiteNetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7495,8 +7441,7 @@ func (c *CrossSiteNetworksPatchCall) Header() http.Header { func (c *CrossSiteNetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.crosssitenetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.crosssitenetwork) if err != nil { return nil, err } @@ -7610,12 +7555,11 @@ func (c *DiskSettingsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7733,8 +7677,7 @@ func (c *DiskSettingsPatchCall) Header() http.Header { func (c *DiskSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksettings) if err != nil { return nil, err } @@ -7946,12 +7889,11 @@ func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8081,12 +8023,11 @@ func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8271,12 +8212,11 @@ func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8413,8 +8353,7 @@ func (c *DisksAddResourcePoliciesCall) Header() http.Header { func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -8627,12 +8566,11 @@ func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8764,8 +8702,7 @@ func (c *DisksBulkInsertCall) Header() http.Header { func (c *DisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertdiskresource) if err != nil { return nil, err } @@ -8898,8 +8835,7 @@ func (c *DisksCreateSnapshotCall) Header() http.Header { func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -9023,12 +8959,11 @@ func (c *DisksDeleteCall) Header() http.Header { func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9138,12 +9073,11 @@ func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9255,12 +9189,11 @@ func (c *DisksGetAsyncReplicationStatusCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/getAsyncReplicationStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9379,12 +9312,11 @@ func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9507,8 +9439,7 @@ func (c *DisksInsertCall) Header() http.Header { func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk) if err != nil { return nil, err } @@ -9701,12 +9632,11 @@ func (c *DisksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9841,8 +9771,7 @@ func (c *DisksRemoveResourcePoliciesCall) Header() http.Header { func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -9966,8 +9895,7 @@ func (c *DisksResizeCall) Header() http.Header { func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksresizerequest) if err != nil { return nil, err } @@ -10076,8 +10004,7 @@ func (c *DisksSetIamPolicyCall) Header() http.Header { func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -10201,8 +10128,7 @@ func (c *DisksSetLabelsCall) Header() http.Header { func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -10326,8 +10252,7 @@ func (c *DisksStartAsyncReplicationCall) Header() http.Header { func (c *DisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstartasyncreplicationrequest) if err != nil { return nil, err } @@ -10449,12 +10374,11 @@ func (c *DisksStopAsyncReplicationCall) Header() http.Header { func (c *DisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10568,8 +10492,7 @@ func (c *DisksStopGroupAsyncReplicationCall) Header() http.Header { func (c *DisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstopgroupasyncreplicationresource) if err != nil { return nil, err } @@ -10677,8 +10600,7 @@ func (c *DisksTestIamPermissionsCall) Header() http.Header { func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -10817,8 +10739,7 @@ func (c *DisksUpdateCall) Header() http.Header { func (c *DisksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk2) if err != nil { return nil, err } @@ -10943,8 +10864,7 @@ func (c *DisksWaitForReplicationCatchUpCall) Header() http.Header { func (c *DisksWaitForReplicationCatchUpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.waitforreplicationcatchuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.waitforreplicationcatchuprequest) if err != nil { return nil, err } @@ -11062,12 +10982,11 @@ func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header { func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11174,12 +11093,11 @@ func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11289,8 +11207,7 @@ func (c *ExternalVpnGatewaysInsertCall) Header() http.Header { func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalvpngateway) if err != nil { return nil, err } @@ -11479,12 +11396,11 @@ func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11602,8 +11518,7 @@ func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header { func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -11708,8 +11623,7 @@ func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -11835,8 +11749,7 @@ func (c *FirewallPoliciesAddAssociationCall) Header() http.Header { func (c *FirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -11952,8 +11865,7 @@ func (c *FirewallPoliciesAddPacketMirroringRuleCall) Header() http.Header { func (c *FirewallPoliciesAddPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -12068,8 +11980,7 @@ func (c *FirewallPoliciesAddRuleCall) Header() http.Header { func (c *FirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -12189,12 +12100,11 @@ func (c *FirewallPoliciesCloneRulesCall) Header() http.Header { func (c *FirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12299,12 +12209,11 @@ func (c *FirewallPoliciesDeleteCall) Header() http.Header { func (c *FirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12406,12 +12315,11 @@ func (c *FirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12521,12 +12429,11 @@ func (c *FirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12637,12 +12544,11 @@ func (c *FirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12753,12 +12659,11 @@ func (c *FirewallPoliciesGetPacketMirroringRuleCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getPacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12869,12 +12774,11 @@ func (c *FirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12987,8 +12891,7 @@ func (c *FirewallPoliciesInsertCall) Header() http.Header { func (c *FirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -13178,12 +13081,11 @@ func (c *FirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13308,12 +13210,11 @@ func (c *FirewallPoliciesListAssociationsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/listAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13425,12 +13326,11 @@ func (c *FirewallPoliciesMoveCall) Header() http.Header { func (c *FirewallPoliciesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13537,8 +13437,7 @@ func (c *FirewallPoliciesPatchCall) Header() http.Header { func (c *FirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -13661,8 +13560,7 @@ func (c *FirewallPoliciesPatchPacketMirroringRuleCall) Header() http.Header { func (c *FirewallPoliciesPatchPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -13784,8 +13682,7 @@ func (c *FirewallPoliciesPatchRuleCall) Header() http.Header { func (c *FirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -13905,12 +13802,11 @@ func (c *FirewallPoliciesRemoveAssociationCall) Header() http.Header { func (c *FirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14023,12 +13919,11 @@ func (c *FirewallPoliciesRemovePacketMirroringRuleCall) Header() http.Header { func (c *FirewallPoliciesRemovePacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removePacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14140,12 +14035,11 @@ func (c *FirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *FirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14238,8 +14132,7 @@ func (c *FirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *FirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalorganizationsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalorganizationsetpolicyrequest) if err != nil { return nil, err } @@ -14340,8 +14233,7 @@ func (c *FirewallPoliciesTestIamPermissionsCall) Header() http.Header { func (c *FirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -14458,12 +14350,11 @@ func (c *FirewallsDeleteCall) Header() http.Header { func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14569,12 +14460,11 @@ func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14683,8 +14573,7 @@ func (c *FirewallsInsertCall) Header() http.Header { func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall) if err != nil { return nil, err } @@ -14873,12 +14762,11 @@ func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15011,8 +14899,7 @@ func (c *FirewallsPatchCall) Header() http.Header { func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall2) if err != nil { return nil, err } @@ -15117,8 +15004,7 @@ func (c *FirewallsTestIamPermissionsCall) Header() http.Header { func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -15240,8 +15126,7 @@ func (c *FirewallsUpdateCall) Header() http.Header { func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall2) if err != nil { return nil, err } @@ -15453,12 +15338,11 @@ func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15591,12 +15475,11 @@ func (c *ForwardingRulesDeleteCall) Header() http.Header { func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15706,12 +15589,11 @@ func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15824,8 +15706,7 @@ func (c *ForwardingRulesInsertCall) Header() http.Header { func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -16018,12 +15899,11 @@ func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16162,8 +16042,7 @@ func (c *ForwardingRulesPatchCall) Header() http.Header { func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -16287,8 +16166,7 @@ func (c *ForwardingRulesSetLabelsCall) Header() http.Header { func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -16413,8 +16291,7 @@ func (c *ForwardingRulesSetTargetCall) Header() http.Header { func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -16523,8 +16400,7 @@ func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header { func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -16738,12 +16614,11 @@ func (c *FutureReservationsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/futureReservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16877,12 +16752,11 @@ func (c *FutureReservationsCancelCall) Header() http.Header { func (c *FutureReservationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations/{futureReservation}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -16996,12 +16870,11 @@ func (c *FutureReservationsDeleteCall) Header() http.Header { func (c *FutureReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations/{futureReservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17112,12 +16985,11 @@ func (c *FutureReservationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations/{futureReservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17230,8 +17102,7 @@ func (c *FutureReservationsInsertCall) Header() http.Header { func (c *FutureReservationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.futurereservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.futurereservation) if err != nil { return nil, err } @@ -17424,12 +17295,11 @@ func (c *FutureReservationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17579,8 +17449,7 @@ func (c *FutureReservationsUpdateCall) Header() http.Header { func (c *FutureReservationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.futurereservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.futurereservation) if err != nil { return nil, err } @@ -17698,12 +17567,11 @@ func (c *GlobalAddressesDeleteCall) Header() http.Header { func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17809,12 +17677,11 @@ func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17923,12 +17790,11 @@ func (c *GlobalAddressesGetOwnerInstanceCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/getOwnerInstance") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18037,8 +17903,7 @@ func (c *GlobalAddressesInsertCall) Header() http.Header { func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.address) if err != nil { return nil, err } @@ -18226,12 +18091,11 @@ func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18363,8 +18227,7 @@ func (c *GlobalAddressesMoveCall) Header() http.Header { func (c *GlobalAddressesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globaladdressesmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globaladdressesmoverequest) if err != nil { return nil, err } @@ -18469,8 +18332,7 @@ func (c *GlobalAddressesSetLabelsCall) Header() http.Header { func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -18575,8 +18437,7 @@ func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header { func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -18694,12 +18555,11 @@ func (c *GlobalForwardingRulesDeleteCall) Header() http.Header { func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18806,12 +18666,11 @@ func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18920,8 +18779,7 @@ func (c *GlobalForwardingRulesInsertCall) Header() http.Header { func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -19110,12 +18968,11 @@ func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19250,8 +19107,7 @@ func (c *GlobalForwardingRulesPatchCall) Header() http.Header { func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -19356,8 +19212,7 @@ func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header { func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -19478,8 +19333,7 @@ func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header { func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -19584,8 +19438,7 @@ func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header { func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -19707,8 +19560,7 @@ func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.He func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalnetworkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -19827,12 +19679,11 @@ func (c *GlobalNetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *GlobalNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19945,8 +19796,7 @@ func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.He func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalnetworkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -20061,12 +19911,11 @@ func (c *GlobalNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20176,8 +20025,7 @@ func (c *GlobalNetworkEndpointGroupsInsertCall) Header() http.Header { func (c *GlobalNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -20366,12 +20214,11 @@ func (c *GlobalNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20567,12 +20414,11 @@ func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Head func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20798,12 +20644,11 @@ func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20919,12 +20764,11 @@ func (c *GlobalOperationsDeleteCall) Header() http.Header { func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21008,12 +20852,11 @@ func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21195,12 +21038,11 @@ func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21325,12 +21167,11 @@ func (c *GlobalOperationsWaitCall) Header() http.Header { func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -21428,12 +21269,11 @@ func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header { func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21520,12 +21360,11 @@ func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21708,12 +21547,11 @@ func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21840,12 +21678,11 @@ func (c *GlobalPublicDelegatedPrefixesDeleteCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21952,12 +21789,11 @@ func (c *GlobalPublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22067,8 +21903,7 @@ func (c *GlobalPublicDelegatedPrefixesInsertCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -22256,12 +22091,11 @@ func (c *GlobalPublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22396,8 +22230,7 @@ func (c *GlobalPublicDelegatedPrefixesPatchCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -22609,12 +22442,11 @@ func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22744,12 +22576,11 @@ func (c *HealthChecksDeleteCall) Header() http.Header { func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22855,12 +22686,11 @@ func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22969,8 +22799,7 @@ func (c *HealthChecksInsertCall) Header() http.Header { func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -23159,12 +22988,11 @@ func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23298,8 +23126,7 @@ func (c *HealthChecksPatchCall) Header() http.Header { func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -23404,8 +23231,7 @@ func (c *HealthChecksTestIamPermissionsCall) Header() http.Header { func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -23526,8 +23352,7 @@ func (c *HealthChecksUpdateCall) Header() http.Header { func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -23644,12 +23469,11 @@ func (c *HttpHealthChecksDeleteCall) Header() http.Header { func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23755,12 +23579,11 @@ func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23870,8 +23693,7 @@ func (c *HttpHealthChecksInsertCall) Header() http.Header { func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -24060,12 +23882,11 @@ func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24199,8 +24020,7 @@ func (c *HttpHealthChecksPatchCall) Header() http.Header { func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -24305,8 +24125,7 @@ func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header { func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -24427,8 +24246,7 @@ func (c *HttpHealthChecksUpdateCall) Header() http.Header { func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -24545,12 +24363,11 @@ func (c *HttpsHealthChecksDeleteCall) Header() http.Header { func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24656,12 +24473,11 @@ func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24771,8 +24587,7 @@ func (c *HttpsHealthChecksInsertCall) Header() http.Header { func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -24961,12 +24776,11 @@ func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25100,8 +24914,7 @@ func (c *HttpsHealthChecksPatchCall) Header() http.Header { func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -25206,8 +25019,7 @@ func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header { func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -25328,8 +25140,7 @@ func (c *HttpsHealthChecksUpdateCall) Header() http.Header { func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -25447,12 +25258,11 @@ func (c *ImageFamilyViewsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/imageFamilyViews/{family}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25563,12 +25373,11 @@ func (c *ImagesDeleteCall) Header() http.Header { func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25680,8 +25489,7 @@ func (c *ImagesDeprecateCall) Header() http.Header { func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deprecationstatus) if err != nil { return nil, err } @@ -25795,12 +25603,11 @@ func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25909,12 +25716,11 @@ func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/family/{family}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26028,12 +25834,11 @@ func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26149,8 +25954,7 @@ func (c *ImagesInsertCall) Header() http.Header { func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.image) if err != nil { return nil, err } @@ -26349,12 +26153,11 @@ func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26487,8 +26290,7 @@ func (c *ImagesPatchCall) Header() http.Header { func (c *ImagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.image2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.image2) if err != nil { return nil, err } @@ -26593,8 +26395,7 @@ func (c *ImagesSetIamPolicyCall) Header() http.Header { func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -26699,8 +26500,7 @@ func (c *ImagesSetLabelsCall) Header() http.Header { func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -26805,8 +26605,7 @@ func (c *ImagesTestIamPermissionsCall) Header() http.Header { func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -26936,12 +26735,11 @@ func (c *InstanceGroupManagerResizeRequestsCancelCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -27063,12 +26861,11 @@ func (c *InstanceGroupManagerResizeRequestsDeleteCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27185,12 +26982,11 @@ func (c *InstanceGroupManagerResizeRequestsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27311,8 +27107,7 @@ func (c *InstanceGroupManagerResizeRequestsInsertCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerresizerequest) if err != nil { return nil, err } @@ -27511,12 +27306,11 @@ func (c *InstanceGroupManagerResizeRequestsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27664,8 +27458,7 @@ func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header { func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } @@ -27878,12 +27671,11 @@ func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28007,8 +27799,7 @@ func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersapplyupdatesrequest) if err != nil { return nil, err } @@ -28137,8 +27928,7 @@ func (c *InstanceGroupManagersCreateInstancesCall) Header() http.Header { func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } @@ -28261,12 +28051,11 @@ func (c *InstanceGroupManagersDeleteCall) Header() http.Header { func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28391,8 +28180,7 @@ func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header { func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersdeleteinstancesrequest) if err != nil { return nil, err } @@ -28503,8 +28291,7 @@ func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersdeleteperinstanceconfigsreq) if err != nil { return nil, err } @@ -28622,12 +28409,11 @@ func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28748,8 +28534,7 @@ func (c *InstanceGroupManagersInsertCall) Header() http.Header { func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -28942,12 +28727,11 @@ func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29162,12 +28946,11 @@ func (c *InstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29372,12 +29155,11 @@ func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header { func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -29579,12 +29361,11 @@ func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header { func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -29731,8 +29512,7 @@ func (c *InstanceGroupManagersPatchCall) Header() http.Header { func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -29859,8 +29639,7 @@ func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerspatchperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerspatchperinstanceconfigsreq) if err != nil { return nil, err } @@ -29992,8 +29771,7 @@ func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header { func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersrecreateinstancesrequest) if err != nil { return nil, err } @@ -30132,12 +29910,11 @@ func (c *InstanceGroupManagersResizeCall) Header() http.Header { func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30263,8 +30040,7 @@ func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header { func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersresizeadvancedrequest) if err != nil { return nil, err } @@ -30399,8 +30175,7 @@ func (c *InstanceGroupManagersResumeInstancesCall) Header() http.Header { func (c *InstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresumeinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } @@ -30525,8 +30300,7 @@ func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header { func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssetautohealingrequest) if err != nil { return nil, err } @@ -30652,8 +30426,7 @@ func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header { func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssetinstancetemplaterequest) if err != nil { return nil, err } @@ -30781,8 +30554,7 @@ func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header { func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } @@ -30916,8 +30688,7 @@ func (c *InstanceGroupManagersStartInstancesCall) Header() http.Header { func (c *InstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstartinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } @@ -31057,8 +30828,7 @@ func (c *InstanceGroupManagersStopInstancesCall) Header() http.Header { func (c *InstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstopinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } @@ -31199,8 +30969,7 @@ func (c *InstanceGroupManagersSuspendInstancesCall) Header() http.Header { func (c *InstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssuspendinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } @@ -31309,8 +31078,7 @@ func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header { func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -31443,8 +31211,7 @@ func (c *InstanceGroupManagersUpdateCall) Header() http.Header { func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -31571,8 +31338,7 @@ func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersupdateperinstanceconfigsreq) if err != nil { return nil, err } @@ -31698,8 +31464,7 @@ func (c *InstanceGroupsAddInstancesCall) Header() http.Header { func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupsaddinstancesrequest) if err != nil { return nil, err } @@ -31912,12 +31677,11 @@ func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32052,12 +31816,11 @@ func (c *InstanceGroupsDeleteCall) Header() http.Header { func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32170,12 +31933,11 @@ func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32288,8 +32050,7 @@ func (c *InstanceGroupsInsertCall) Header() http.Header { func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroup) if err != nil { return nil, err } @@ -32483,12 +32244,11 @@ func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32691,8 +32451,7 @@ func (c *InstanceGroupsListInstancesCall) Header() http.Header { func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupslistinstancesrequest) if err != nil { return nil, err } @@ -32842,8 +32601,7 @@ func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header { func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupsremoveinstancesrequest) if err != nil { return nil, err } @@ -32967,8 +32725,7 @@ func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header { func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupssetnamedportsrequest) if err != nil { return nil, err } @@ -33077,8 +32834,7 @@ func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header { func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -33194,12 +32950,11 @@ func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33318,8 +33073,7 @@ func (c *InstanceSettingsPatchCall) Header() http.Header { func (c *InstanceSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesettings) if err != nil { return nil, err } @@ -33532,12 +33286,11 @@ func (c *InstanceTemplatesAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33669,12 +33422,11 @@ func (c *InstanceTemplatesDeleteCall) Header() http.Header { func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33794,12 +33546,11 @@ func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33914,12 +33665,11 @@ func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34031,8 +33781,7 @@ func (c *InstanceTemplatesInsertCall) Header() http.Header { func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancetemplate) if err != nil { return nil, err } @@ -34235,12 +33984,11 @@ func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34358,8 +34106,7 @@ func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header { func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -34464,8 +34211,7 @@ func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header { func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -34591,8 +34337,7 @@ func (c *InstancesAddAccessConfigCall) Header() http.Header { func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessconfig) if err != nil { return nil, err } @@ -34717,8 +34462,7 @@ func (c *InstancesAddNetworkInterfaceCall) Header() http.Header { func (c *InstancesAddNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkinterface) if err != nil { return nil, err } @@ -34843,8 +34587,7 @@ func (c *InstancesAddResourcePoliciesCall) Header() http.Header { func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -35059,12 +34802,11 @@ func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35211,8 +34953,7 @@ func (c *InstancesAttachDiskCall) Header() http.Header { func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attacheddisk) if err != nil { return nil, err } @@ -35333,8 +35074,7 @@ func (c *InstancesBulkInsertCall) Header() http.Header { func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertinstanceresource) if err != nil { return nil, err } @@ -35462,12 +35202,11 @@ func (c *InstancesDeleteCall) Header() http.Header { func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35585,12 +35324,11 @@ func (c *InstancesDeleteAccessConfigCall) Header() http.Header { func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -35710,12 +35448,11 @@ func (c *InstancesDeleteNetworkInterfaceCall) Header() http.Header { func (c *InstancesDeleteNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteNetworkInterface") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -35831,12 +35568,11 @@ func (c *InstancesDetachDiskCall) Header() http.Header { func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/detachDisk") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -35960,12 +35696,11 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36079,12 +35814,11 @@ func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36209,12 +35943,11 @@ func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36333,12 +36066,11 @@ func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36456,12 +36188,11 @@ func (c *InstancesGetPartnerMetadataCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getPartnerMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36572,12 +36303,11 @@ func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/screenshot") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36714,12 +36444,11 @@ func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/serialPort") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36831,12 +36560,11 @@ func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36947,12 +36675,11 @@ func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37092,8 +36819,7 @@ func (c *InstancesInsertCall) Header() http.Header { func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -37299,12 +37025,11 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37517,12 +37242,11 @@ func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/referrers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37659,8 +37383,7 @@ func (c *InstancesPatchPartnerMetadataCall) Header() http.Header { func (c *InstancesPatchPartnerMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.partnermetadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.partnermetadata) if err != nil { return nil, err } @@ -37781,12 +37504,11 @@ func (c *InstancesPerformMaintenanceCall) Header() http.Header { func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -37901,8 +37623,7 @@ func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header { func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -38026,8 +37747,7 @@ func (c *InstancesReportHostAsFaultyCall) Header() http.Header { func (c *InstancesReportHostAsFaultyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesreporthostasfaultyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesreporthostasfaultyrequest) if err != nil { return nil, err } @@ -38149,12 +37869,11 @@ func (c *InstancesResetCall) Header() http.Header { func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38270,8 +37989,7 @@ func (c *InstancesResumeCall) Header() http.Header { func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesresumerequest) if err != nil { return nil, err } @@ -38377,12 +38095,11 @@ func (c *InstancesSendDiagnosticInterruptCall) Header() http.Header { func (c *InstancesSendDiagnosticInterruptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38479,12 +38196,11 @@ func (c *InstancesSetDeletionProtectionCall) Header() http.Header { func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38603,12 +38319,11 @@ func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header { func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38709,8 +38424,7 @@ func (c *InstancesSetIamPolicyCall) Header() http.Header { func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -38834,8 +38548,7 @@ func (c *InstancesSetLabelsCall) Header() http.Header { func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetlabelsrequest) if err != nil { return nil, err } @@ -38959,8 +38672,7 @@ func (c *InstancesSetMachineResourcesCall) Header() http.Header { func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmachineresourcesrequest) if err != nil { return nil, err } @@ -39084,8 +38796,7 @@ func (c *InstancesSetMachineTypeCall) Header() http.Header { func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmachinetyperequest) if err != nil { return nil, err } @@ -39209,8 +38920,7 @@ func (c *InstancesSetMetadataCall) Header() http.Header { func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadata) if err != nil { return nil, err } @@ -39335,8 +39045,7 @@ func (c *InstancesSetMinCpuPlatformCall) Header() http.Header { func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmincpuplatformrequest) if err != nil { return nil, err } @@ -39459,8 +39168,7 @@ func (c *InstancesSetNameCall) Header() http.Header { func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetnamerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetnamerequest) if err != nil { return nil, err } @@ -39587,8 +39295,7 @@ func (c *InstancesSetSchedulingCall) Header() http.Header { func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scheduling) if err != nil { return nil, err } @@ -39713,8 +39420,7 @@ func (c *InstancesSetSecurityPolicyCall) Header() http.Header { func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetsecuritypolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetsecuritypolicyrequest) if err != nil { return nil, err } @@ -39839,8 +39545,7 @@ func (c *InstancesSetServiceAccountCall) Header() http.Header { func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetserviceaccountrequest) if err != nil { return nil, err } @@ -39966,8 +39671,7 @@ func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header { func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedinstanceintegritypolicy) if err != nil { return nil, err } @@ -40093,8 +39797,7 @@ func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header { func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedvmintegritypolicy) if err != nil { return nil, err } @@ -40218,8 +39921,7 @@ func (c *InstancesSetTagsCall) Header() http.Header { func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tags) if err != nil { return nil, err } @@ -40349,12 +40051,11 @@ func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header { func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -40468,12 +40169,11 @@ func (c *InstancesStartCall) Header() http.Header { func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/start") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -40589,8 +40289,7 @@ func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header { func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesstartwithencryptionkeyrequest) if err != nil { return nil, err } @@ -40732,12 +40431,11 @@ func (c *InstancesStopCall) Header() http.Header { func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/stop") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -40865,12 +40563,11 @@ func (c *InstancesSuspendCall) Header() http.Header { func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/suspend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -40971,8 +40668,7 @@ func (c *InstancesTestIamPermissionsCall) Header() http.Header { func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -41140,8 +40836,7 @@ func (c *InstancesUpdateCall) Header() http.Header { func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance2) if err != nil { return nil, err } @@ -41270,8 +40965,7 @@ func (c *InstancesUpdateAccessConfigCall) Header() http.Header { func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessconfig) if err != nil { return nil, err } @@ -41396,8 +41090,7 @@ func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header { func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.displaydevice) if err != nil { return nil, err } @@ -41526,8 +41219,7 @@ func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header { func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkinterface) if err != nil { return nil, err } @@ -41653,8 +41345,7 @@ func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header { func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedinstanceconfig) if err != nil { return nil, err } @@ -41779,8 +41470,7 @@ func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header { func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedvmconfig) if err != nil { return nil, err } @@ -41901,12 +41591,11 @@ func (c *InstantSnapshotGroupsDeleteCall) Header() http.Header { func (c *InstantSnapshotGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshotGroups/{instantSnapshotGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42017,12 +41706,11 @@ func (c *InstantSnapshotGroupsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshotGroups/{instantSnapshotGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42141,12 +41829,11 @@ func (c *InstantSnapshotGroupsGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshotGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42265,8 +41952,7 @@ func (c *InstantSnapshotGroupsInsertCall) Header() http.Header { func (c *InstantSnapshotGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshotgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshotgroup) if err != nil { return nil, err } @@ -42459,12 +42145,11 @@ func (c *InstantSnapshotGroupsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshotGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42586,8 +42271,7 @@ func (c *InstantSnapshotGroupsSetIamPolicyCall) Header() http.Header { func (c *InstantSnapshotGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -42696,8 +42380,7 @@ func (c *InstantSnapshotGroupsTestIamPermissionsCall) Header() http.Header { func (c *InstantSnapshotGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -42911,12 +42594,11 @@ func (c *InstantSnapshotsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43054,12 +42736,11 @@ func (c *InstantSnapshotsDeleteCall) Header() http.Header { func (c *InstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43169,12 +42850,11 @@ func (c *InstantSnapshotsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43293,12 +42973,11 @@ func (c *InstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43410,8 +43089,7 @@ func (c *InstantSnapshotsInsertCall) Header() http.Header { func (c *InstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshot) if err != nil { return nil, err } @@ -43604,12 +43282,11 @@ func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43731,8 +43408,7 @@ func (c *InstantSnapshotsSetIamPolicyCall) Header() http.Header { func (c *InstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -43856,8 +43532,7 @@ func (c *InstantSnapshotsSetLabelsCall) Header() http.Header { func (c *InstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -43966,8 +43641,7 @@ func (c *InstantSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *InstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -44088,12 +43762,11 @@ func (c *InterconnectAttachmentGroupsDeleteCall) Header() http.Header { func (c *InterconnectAttachmentGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectAttachmentGroups/{interconnectAttachmentGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44201,12 +43874,11 @@ func (c *InterconnectAttachmentGroupsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectAttachmentGroups/{interconnectAttachmentGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44321,12 +43993,11 @@ func (c *InterconnectAttachmentGroupsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectAttachmentGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44436,8 +44107,7 @@ func (c *InterconnectAttachmentGroupsInsertCall) Header() http.Header { func (c *InterconnectAttachmentGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachmentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachmentgroup) if err != nil { return nil, err } @@ -44626,12 +44296,11 @@ func (c *InterconnectAttachmentGroupsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectAttachmentGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44774,8 +44443,7 @@ func (c *InterconnectAttachmentGroupsPatchCall) Header() http.Header { func (c *InterconnectAttachmentGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachmentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachmentgroup) if err != nil { return nil, err } @@ -44880,8 +44548,7 @@ func (c *InterconnectAttachmentGroupsSetIamPolicyCall) Header() http.Header { func (c *InterconnectAttachmentGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -44986,8 +44653,7 @@ func (c *InterconnectAttachmentGroupsTestIamPermissionsCall) Header() http.Heade func (c *InterconnectAttachmentGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -45200,12 +44866,11 @@ func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45338,12 +45003,11 @@ func (c *InterconnectAttachmentsDeleteCall) Header() http.Header { func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45453,12 +45117,11 @@ func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45577,12 +45240,11 @@ func (c *InterconnectAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45702,8 +45364,7 @@ func (c *InterconnectAttachmentsInsertCall) Header() http.Header { func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachment) if err != nil { return nil, err } @@ -45896,12 +45557,11 @@ func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46039,8 +45699,7 @@ func (c *InterconnectAttachmentsPatchCall) Header() http.Header { func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachment) if err != nil { return nil, err } @@ -46149,8 +45808,7 @@ func (c *InterconnectAttachmentsSetIamPolicyCall) Header() http.Header { func (c *InterconnectAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -46274,8 +45932,7 @@ func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header { func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -46384,8 +46041,7 @@ func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -46505,12 +46161,11 @@ func (c *InterconnectGroupsDeleteCall) Header() http.Header { func (c *InterconnectGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectGroups/{interconnectGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46616,12 +46271,11 @@ func (c *InterconnectGroupsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectGroups/{interconnectGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46736,12 +46390,11 @@ func (c *InterconnectGroupsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46851,8 +46504,7 @@ func (c *InterconnectGroupsInsertCall) Header() http.Header { func (c *InterconnectGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectgroup) if err != nil { return nil, err } @@ -47040,12 +46692,11 @@ func (c *InterconnectGroupsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47187,8 +46838,7 @@ func (c *InterconnectGroupsPatchCall) Header() http.Header { func (c *InterconnectGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectgroup) if err != nil { return nil, err } @@ -47293,8 +46943,7 @@ func (c *InterconnectGroupsSetIamPolicyCall) Header() http.Header { func (c *InterconnectGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -47399,8 +47048,7 @@ func (c *InterconnectGroupsTestIamPermissionsCall) Header() http.Header { func (c *InterconnectGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -47516,12 +47164,11 @@ func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations/{interconnectLocation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47704,12 +47351,11 @@ func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47827,8 +47473,7 @@ func (c *InterconnectLocationsTestIamPermissionsCall) Header() http.Header { func (c *InterconnectLocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -47946,12 +47591,11 @@ func (c *InterconnectRemoteLocationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48134,12 +47778,11 @@ func (c *InterconnectRemoteLocationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48257,8 +47900,7 @@ func (c *InterconnectRemoteLocationsTestIamPermissionsCall) Header() http.Header func (c *InterconnectRemoteLocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -48376,12 +48018,11 @@ func (c *InterconnectsDeleteCall) Header() http.Header { func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48488,12 +48129,11 @@ func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48603,12 +48243,11 @@ func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getDiagnostics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48723,12 +48362,11 @@ func (c *InterconnectsGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48835,12 +48473,11 @@ func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48950,8 +48587,7 @@ func (c *InterconnectsInsertCall) Header() http.Header { func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnect) if err != nil { return nil, err } @@ -49140,12 +48776,11 @@ func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49279,8 +48914,7 @@ func (c *InterconnectsPatchCall) Header() http.Header { func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnect2) if err != nil { return nil, err } @@ -49385,8 +49019,7 @@ func (c *InterconnectsSetIamPolicyCall) Header() http.Header { func (c *InterconnectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -49491,8 +49124,7 @@ func (c *InterconnectsSetLabelsCall) Header() http.Header { func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -49597,8 +49229,7 @@ func (c *InterconnectsTestIamPermissionsCall) Header() http.Header { func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -49716,12 +49347,11 @@ func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{licenseCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49836,12 +49466,11 @@ func (c *LicenseCodesGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49939,8 +49568,7 @@ func (c *LicenseCodesSetIamPolicyCall) Header() http.Header { func (c *LicenseCodesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -50046,8 +49674,7 @@ func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header { func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -50167,12 +49794,11 @@ func (c *LicensesDeleteCall) Header() http.Header { func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50280,12 +49906,11 @@ func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50400,12 +50025,11 @@ func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50515,8 +50139,7 @@ func (c *LicensesInsertCall) Header() http.Header { func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.license) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.license) if err != nil { return nil, err } @@ -50710,12 +50333,11 @@ func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50834,8 +50456,7 @@ func (c *LicensesSetIamPolicyCall) Header() http.Header { func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -50941,8 +50562,7 @@ func (c *LicensesTestIamPermissionsCall) Header() http.Header { func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -51071,8 +50691,7 @@ func (c *LicensesUpdateCall) Header() http.Header { func (c *LicensesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.license2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.license2) if err != nil { return nil, err } @@ -51190,12 +50809,11 @@ func (c *MachineImagesDeleteCall) Header() http.Header { func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -51301,12 +50919,11 @@ func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51420,12 +51037,11 @@ func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51543,8 +51159,7 @@ func (c *MachineImagesInsertCall) Header() http.Header { func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.machineimage) if err != nil { return nil, err } @@ -51733,12 +51348,11 @@ func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51856,8 +51470,7 @@ func (c *MachineImagesSetIamPolicyCall) Header() http.Header { func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -51962,8 +51575,7 @@ func (c *MachineImagesTestIamPermissionsCall) Header() http.Header { func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -52176,12 +51788,11 @@ func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/machineTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52311,12 +51922,11 @@ func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes/{machineType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52501,12 +52111,11 @@ func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52733,12 +52342,11 @@ func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52872,12 +52480,11 @@ func (c *NetworkAttachmentsDeleteCall) Header() http.Header { func (c *NetworkAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -52987,12 +52594,11 @@ func (c *NetworkAttachmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53111,12 +52717,11 @@ func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53230,8 +52835,7 @@ func (c *NetworkAttachmentsInsertCall) Header() http.Header { func (c *NetworkAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkattachment) if err != nil { return nil, err } @@ -53423,12 +53027,11 @@ func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53567,8 +53170,7 @@ func (c *NetworkAttachmentsPatchCall) Header() http.Header { func (c *NetworkAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkattachment) if err != nil { return nil, err } @@ -53677,8 +53279,7 @@ func (c *NetworkAttachmentsSetIamPolicyCall) Header() http.Header { func (c *NetworkAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -53787,8 +53388,7 @@ func (c *NetworkAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *NetworkAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -54002,12 +53602,11 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEdgeSecurityServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54141,12 +53740,11 @@ func (c *NetworkEdgeSecurityServicesDeleteCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -54257,12 +53855,11 @@ func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54383,8 +53980,7 @@ func (c *NetworkEdgeSecurityServicesInsertCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkedgesecurityservice) if err != nil { return nil, err } @@ -54520,8 +54116,7 @@ func (c *NetworkEdgeSecurityServicesPatchCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkedgesecurityservice) if err != nil { return nil, err } @@ -54734,12 +54329,11 @@ func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54877,8 +54471,7 @@ func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -55004,12 +54597,11 @@ func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55127,8 +54719,7 @@ func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -55248,12 +54839,11 @@ func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55368,8 +54958,7 @@ func (c *NetworkEndpointGroupsInsertCall) Header() http.Header { func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -55563,12 +55152,11 @@ func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55771,8 +55359,7 @@ func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupslistendpointsrequest) if err != nil { return nil, err } @@ -55903,8 +55490,7 @@ func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header { func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -56043,8 +55629,7 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -56180,8 +55765,7 @@ func (c *NetworkFirewallPoliciesAddPacketMirroringRuleCall) Header() http.Header func (c *NetworkFirewallPoliciesAddPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -56316,8 +55900,7 @@ func (c *NetworkFirewallPoliciesAddRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -56441,12 +56024,11 @@ func (c *NetworkFirewallPoliciesCloneRulesCall) Header() http.Header { func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -56555,12 +56137,11 @@ func (c *NetworkFirewallPoliciesDeleteCall) Header() http.Header { func (c *NetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56666,12 +56247,11 @@ func (c *NetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56785,12 +56365,11 @@ func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56905,12 +56484,11 @@ func (c *NetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57025,12 +56603,11 @@ func (c *NetworkFirewallPoliciesGetPacketMirroringRuleCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getPacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57145,12 +56722,11 @@ func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57260,8 +56836,7 @@ func (c *NetworkFirewallPoliciesInsertCall) Header() http.Header { func (c *NetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -57450,12 +57025,11 @@ func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57587,8 +57161,7 @@ func (c *NetworkFirewallPoliciesPatchCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -57708,8 +57281,7 @@ func (c *NetworkFirewallPoliciesPatchAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -57836,8 +57408,7 @@ func (c *NetworkFirewallPoliciesPatchPacketMirroringRuleCall) Header() http.Head func (c *NetworkFirewallPoliciesPatchPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -57963,8 +57534,7 @@ func (c *NetworkFirewallPoliciesPatchRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -58088,12 +57658,11 @@ func (c *NetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -58210,12 +57779,11 @@ func (c *NetworkFirewallPoliciesRemovePacketMirroringRuleCall) Header() http.Hea func (c *NetworkFirewallPoliciesRemovePacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removePacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -58331,12 +57899,11 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -58433,8 +58000,7 @@ func (c *NetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *NetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -58539,8 +58105,7 @@ func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header { func (c *NetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -58655,12 +58220,11 @@ func (c *NetworkProfilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles/{networkProfile}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58842,12 +58406,11 @@ func (c *NetworkProfilesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58979,8 +58542,7 @@ func (c *NetworksAddPeeringCall) Header() http.Header { func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksaddpeeringrequest) if err != nil { return nil, err } @@ -59097,12 +58659,11 @@ func (c *NetworksDeleteCall) Header() http.Header { func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -59208,12 +58769,11 @@ func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59319,12 +58879,11 @@ func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59434,8 +58993,7 @@ func (c *NetworksInsertCall) Header() http.Header { func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network) if err != nil { return nil, err } @@ -59623,12 +59181,11 @@ func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59840,12 +59397,11 @@ func (c *NetworksListIpAddressesCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listIpAddresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60086,12 +59642,11 @@ func (c *NetworksListIpOwnersCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listIpOwners") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60324,12 +59879,11 @@ func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listPeeringRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60463,8 +60017,7 @@ func (c *NetworksPatchCall) Header() http.Header { func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network2) if err != nil { return nil, err } @@ -60583,8 +60136,7 @@ func (c *NetworksRemovePeeringCall) Header() http.Header { func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksremovepeeringrequest) if err != nil { return nil, err } @@ -60702,12 +60254,11 @@ func (c *NetworksSwitchToCustomModeCall) Header() http.Header { func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/switchToCustomMode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -60804,8 +60355,7 @@ func (c *NetworksTestIamPermissionsCall) Header() http.Header { func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -60928,8 +60478,7 @@ func (c *NetworksUpdatePeeringCall) Header() http.Header { func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksupdatepeeringrequest) if err != nil { return nil, err } @@ -61051,8 +60600,7 @@ func (c *NodeGroupsAddNodesCall) Header() http.Header { func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsaddnodesrequest) if err != nil { return nil, err } @@ -61266,12 +60814,11 @@ func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61404,12 +60951,11 @@ func (c *NodeGroupsDeleteCall) Header() http.Header { func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -61524,8 +61070,7 @@ func (c *NodeGroupsDeleteNodesCall) Header() http.Header { func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsdeletenodesrequest) if err != nil { return nil, err } @@ -61645,12 +61190,11 @@ func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61768,12 +61312,11 @@ func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61888,8 +61431,7 @@ func (c *NodeGroupsInsertCall) Header() http.Header { func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -62082,12 +61624,11 @@ func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62283,12 +61824,11 @@ func (c *NodeGroupsListNodesCall) Header() http.Header { func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62425,8 +61965,7 @@ func (c *NodeGroupsPatchCall) Header() http.Header { func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -62550,8 +62089,7 @@ func (c *NodeGroupsPerformMaintenanceCall) Header() http.Header { func (c *NodeGroupsPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsperformmaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsperformmaintenancerequest) if err != nil { return nil, err } @@ -62660,8 +62198,7 @@ func (c *NodeGroupsSetIamPolicyCall) Header() http.Header { func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -62784,8 +62321,7 @@ func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header { func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupssetnodetemplaterequest) if err != nil { return nil, err } @@ -62910,8 +62446,7 @@ func (c *NodeGroupsSimulateMaintenanceEventCall) Header() http.Header { func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssimulatemaintenanceeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupssimulatemaintenanceeventrequest) if err != nil { return nil, err } @@ -63020,8 +62555,7 @@ func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header { func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -63235,12 +62769,11 @@ func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63373,12 +62906,11 @@ func (c *NodeTemplatesDeleteCall) Header() http.Header { func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -63488,12 +63020,11 @@ func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63611,12 +63142,11 @@ func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63729,8 +63259,7 @@ func (c *NodeTemplatesInsertCall) Header() http.Header { func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodetemplate) if err != nil { return nil, err } @@ -63922,12 +63451,11 @@ func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64049,8 +63577,7 @@ func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header { func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -64159,8 +63686,7 @@ func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header { func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -64374,12 +63900,11 @@ func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64509,12 +64034,11 @@ func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes/{nodeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64699,12 +64223,11 @@ func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64842,8 +64365,7 @@ func (c *OrganizationSecurityPoliciesAddAssociationCall) Header() http.Header { func (c *OrganizationSecurityPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyassociation) if err != nil { return nil, err } @@ -64958,8 +64480,7 @@ func (c *OrganizationSecurityPoliciesAddRuleCall) Header() http.Header { func (c *OrganizationSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -65079,12 +64600,11 @@ func (c *OrganizationSecurityPoliciesCopyRulesCall) Header() http.Header { func (c *OrganizationSecurityPoliciesCopyRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/copyRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -65189,12 +64709,11 @@ func (c *OrganizationSecurityPoliciesDeleteCall) Header() http.Header { func (c *OrganizationSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -65296,12 +64815,11 @@ func (c *OrganizationSecurityPoliciesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65411,12 +64929,11 @@ func (c *OrganizationSecurityPoliciesGetAssociationCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65527,12 +65044,11 @@ func (c *OrganizationSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65645,8 +65161,7 @@ func (c *OrganizationSecurityPoliciesInsertCall) Header() http.Header { func (c *OrganizationSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -65834,12 +65349,11 @@ func (c *OrganizationSecurityPoliciesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65964,12 +65478,11 @@ func (c *OrganizationSecurityPoliciesListAssociationsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/listAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66150,12 +65663,11 @@ func (c *OrganizationSecurityPoliciesListPreconfiguredExpressionSetsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/listPreconfiguredExpressionSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -66265,12 +65777,11 @@ func (c *OrganizationSecurityPoliciesMoveCall) Header() http.Header { func (c *OrganizationSecurityPoliciesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -66377,8 +65888,7 @@ func (c *OrganizationSecurityPoliciesPatchCall) Header() http.Header { func (c *OrganizationSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -66500,8 +66010,7 @@ func (c *OrganizationSecurityPoliciesPatchRuleCall) Header() http.Header { func (c *OrganizationSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -66621,12 +66130,11 @@ func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Header() http.Header func (c *OrganizationSecurityPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -66738,12 +66246,11 @@ func (c *OrganizationSecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *OrganizationSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -66946,12 +66453,11 @@ func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67084,12 +66590,11 @@ func (c *PacketMirroringsDeleteCall) Header() http.Header { func (c *PacketMirroringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -67199,12 +66704,11 @@ func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67318,8 +66822,7 @@ func (c *PacketMirroringsInsertCall) Header() http.Header { func (c *PacketMirroringsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.packetmirroring) if err != nil { return nil, err } @@ -67512,12 +67015,11 @@ func (c *PacketMirroringsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -67655,8 +67157,7 @@ func (c *PacketMirroringsPatchCall) Header() http.Header { func (c *PacketMirroringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.packetmirroring) if err != nil { return nil, err } @@ -67765,8 +67266,7 @@ func (c *PacketMirroringsTestIamPermissionsCall) Header() http.Header { func (c *PacketMirroringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -67882,12 +67382,11 @@ func (c *ProjectsDisableXpnHostCall) Header() http.Header { func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -67995,8 +67494,7 @@ func (c *ProjectsDisableXpnResourceCall) Header() http.Header { func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsdisablexpnresourcerequest) if err != nil { return nil, err } @@ -68109,12 +67607,11 @@ func (c *ProjectsEnableXpnHostCall) Header() http.Header { func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -68223,8 +67720,7 @@ func (c *ProjectsEnableXpnResourceCall) Header() http.Header { func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsenablexpnresourcerequest) if err != nil { return nil, err } @@ -68340,12 +67836,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68448,12 +67943,11 @@ func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68634,12 +68128,11 @@ func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -68832,8 +68325,7 @@ func (c *ProjectsListXpnHostsCall) Header() http.Header { func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectslistxpnhostsrequest) if err != nil { return nil, err } @@ -68969,8 +68461,7 @@ func (c *ProjectsMoveDiskCall) Header() http.Header { func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diskmoverequest) if err != nil { return nil, err } @@ -69091,8 +68582,7 @@ func (c *ProjectsMoveInstanceCall) Header() http.Header { func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancemoverequest) if err != nil { return nil, err } @@ -69210,8 +68700,7 @@ func (c *ProjectsSetCloudArmorTierCall) Header() http.Header { func (c *ProjectsSetCloudArmorTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetcloudarmortierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetcloudarmortierrequest) if err != nil { return nil, err } @@ -69327,8 +68816,7 @@ func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header { func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadata) if err != nil { return nil, err } @@ -69445,8 +68933,7 @@ func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header { func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetdefaultnetworktierrequest) if err != nil { return nil, err } @@ -69563,8 +69050,7 @@ func (c *ProjectsSetDefaultServiceAccountCall) Header() http.Header { func (c *ProjectsSetDefaultServiceAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetdefaultserviceaccountrequest) if err != nil { return nil, err } @@ -69682,8 +69168,7 @@ func (c *ProjectsSetManagedProtectionTierCall) Header() http.Header { func (c *ProjectsSetManagedProtectionTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetmanagedprotectiontierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetmanagedprotectiontierrequest) if err != nil { return nil, err } @@ -69800,8 +69285,7 @@ func (c *ProjectsSetUsageExportBucketCall) Header() http.Header { func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.usageexportlocation) if err != nil { return nil, err } @@ -69918,12 +69402,11 @@ func (c *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header { func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -70033,12 +69516,11 @@ func (c *PublicAdvertisedPrefixesDeleteCall) Header() http.Header { func (c *PublicAdvertisedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -70145,12 +69627,11 @@ func (c *PublicAdvertisedPrefixesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70260,8 +69741,7 @@ func (c *PublicAdvertisedPrefixesInsertCall) Header() http.Header { func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicadvertisedprefix) if err != nil { return nil, err } @@ -70449,12 +69929,11 @@ func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -70589,8 +70068,7 @@ func (c *PublicAdvertisedPrefixesPatchCall) Header() http.Header { func (c *PublicAdvertisedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicadvertisedprefix) if err != nil { return nil, err } @@ -70708,12 +70186,11 @@ func (c *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header { func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -70917,12 +70394,11 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71057,12 +70533,11 @@ func (c *PublicDelegatedPrefixesAnnounceCall) Header() http.Header { func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -71176,12 +70651,11 @@ func (c *PublicDelegatedPrefixesDeleteCall) Header() http.Header { func (c *PublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -71293,12 +70767,11 @@ func (c *PublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71412,8 +70885,7 @@ func (c *PublicDelegatedPrefixesInsertCall) Header() http.Header { func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -71605,12 +71077,11 @@ func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -71749,8 +71220,7 @@ func (c *PublicDelegatedPrefixesPatchCall) Header() http.Header { func (c *PublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -71873,12 +71343,11 @@ func (c *PublicDelegatedPrefixesWithdrawCall) Header() http.Header { func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -71991,12 +71460,11 @@ func (c *RegionAutoscalersDeleteCall) Header() http.Header { func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -72106,12 +71574,11 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72224,8 +71691,7 @@ func (c *RegionAutoscalersInsertCall) Header() http.Header { func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -72417,12 +71883,11 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -72564,8 +72029,7 @@ func (c *RegionAutoscalersPatchCall) Header() http.Header { func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -72673,8 +72137,7 @@ func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header { func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -72803,8 +72266,7 @@ func (c *RegionAutoscalersUpdateCall) Header() http.Header { func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } diff --git a/compute/v0.alpha/compute3-gen.go b/compute/v0.alpha/compute3-gen.go index 50cee9f9f5d..2a1e8de7d40 100644 --- a/compute/v0.alpha/compute3-gen.go +++ b/compute/v0.alpha/compute3-gen.go @@ -9,7 +9,6 @@ package compute import ( "context" "fmt" - "io" "net/http" googleapi "google.golang.org/api/googleapi" @@ -79,12 +78,11 @@ func (c *RegionBackendServicesDeleteCall) Header() http.Header { func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -194,12 +192,11 @@ func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -301,8 +298,7 @@ func (c *RegionBackendServicesGetHealthCall) Header() http.Header { func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcegroupreference) if err != nil { return nil, err } @@ -429,12 +425,11 @@ func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -548,8 +543,7 @@ func (c *RegionBackendServicesInsertCall) Header() http.Header { func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -742,12 +736,11 @@ func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -955,12 +948,11 @@ func (c *RegionBackendServicesListUsableCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1099,8 +1091,7 @@ func (c *RegionBackendServicesPatchCall) Header() http.Header { func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -1209,8 +1200,7 @@ func (c *RegionBackendServicesSetIamPolicyCall) Header() http.Header { func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -1336,8 +1326,7 @@ func (c *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header { func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -1446,8 +1435,7 @@ func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header { func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -1573,8 +1561,7 @@ func (c *RegionBackendServicesUpdateCall) Header() http.Header { func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -1787,12 +1774,11 @@ func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1926,12 +1912,11 @@ func (c *RegionCommitmentsCalculateCancellationFeeCall) Header() http.Header { func (c *RegionCommitmentsCalculateCancellationFeeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}/calculateCancellationFee") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2044,12 +2029,11 @@ func (c *RegionCommitmentsCancelCall) Header() http.Header { func (c *RegionCommitmentsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2159,12 +2143,11 @@ func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2277,8 +2260,7 @@ func (c *RegionCommitmentsInsertCall) Header() http.Header { func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitment) if err != nil { return nil, err } @@ -2470,12 +2452,11 @@ func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2596,8 +2577,7 @@ func (c *RegionCommitmentsTestIamPermissionsCall) Header() http.Header { func (c *RegionCommitmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -2736,8 +2716,7 @@ func (c *RegionCommitmentsUpdateCall) Header() http.Header { func (c *RegionCommitmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitment2) if err != nil { return nil, err } @@ -2862,8 +2841,7 @@ func (c *RegionCommitmentsUpdateReservationsCall) Header() http.Header { func (c *RegionCommitmentsUpdateReservationsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioncommitmentsupdatereservationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioncommitmentsupdatereservationsrequest) if err != nil { return nil, err } @@ -2978,12 +2956,11 @@ func (c *RegionDiskSettingsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3101,8 +3078,7 @@ func (c *RegionDiskSettingsPatchCall) Header() http.Header { func (c *RegionDiskSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksettings) if err != nil { return nil, err } @@ -3219,12 +3195,11 @@ func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3410,12 +3385,11 @@ func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3553,8 +3527,7 @@ func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header { func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -3674,8 +3647,7 @@ func (c *RegionDisksBulkInsertCall) Header() http.Header { func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertdiskresource) if err != nil { return nil, err } @@ -3808,8 +3780,7 @@ func (c *RegionDisksCreateSnapshotCall) Header() http.Header { func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -3933,12 +3904,11 @@ func (c *RegionDisksDeleteCall) Header() http.Header { func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4048,12 +4018,11 @@ func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4165,12 +4134,11 @@ func (c *RegionDisksGetAsyncReplicationStatusCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/getAsyncReplicationStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4289,12 +4257,11 @@ func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4414,8 +4381,7 @@ func (c *RegionDisksInsertCall) Header() http.Header { func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk) if err != nil { return nil, err } @@ -4608,12 +4574,11 @@ func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4748,8 +4713,7 @@ func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header { func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -4872,8 +4836,7 @@ func (c *RegionDisksResizeCall) Header() http.Header { func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksresizerequest) if err != nil { return nil, err } @@ -4982,8 +4945,7 @@ func (c *RegionDisksSetIamPolicyCall) Header() http.Header { func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -5106,8 +5068,7 @@ func (c *RegionDisksSetLabelsCall) Header() http.Header { func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -5231,8 +5192,7 @@ func (c *RegionDisksStartAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksstartasyncreplicationrequest) if err != nil { return nil, err } @@ -5354,12 +5314,11 @@ func (c *RegionDisksStopAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5473,8 +5432,7 @@ func (c *RegionDisksStopGroupAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstopgroupasyncreplicationresource) if err != nil { return nil, err } @@ -5582,8 +5540,7 @@ func (c *RegionDisksTestIamPermissionsCall) Header() http.Header { func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -5722,8 +5679,7 @@ func (c *RegionDisksUpdateCall) Header() http.Header { func (c *RegionDisksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk2) if err != nil { return nil, err } @@ -5848,8 +5804,7 @@ func (c *RegionDisksWaitForReplicationCatchUpCall) Header() http.Header { func (c *RegionDisksWaitForReplicationCatchUpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionwaitforreplicationcatchuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionwaitforreplicationcatchuprequest) if err != nil { return nil, err } @@ -6063,12 +6018,11 @@ func (c *RegionHealthCheckServicesAggregatedListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/healthCheckServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6202,12 +6156,11 @@ func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header { func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6318,12 +6271,11 @@ func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6437,8 +6389,7 @@ func (c *RegionHealthCheckServicesInsertCall) Header() http.Header { func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheckservice) if err != nil { return nil, err } @@ -6631,12 +6582,11 @@ func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6775,8 +6725,7 @@ func (c *RegionHealthCheckServicesPatchCall) Header() http.Header { func (c *RegionHealthCheckServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheckservice) if err != nil { return nil, err } @@ -6885,8 +6834,7 @@ func (c *RegionHealthCheckServicesTestIamPermissionsCall) Header() http.Header { func (c *RegionHealthCheckServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -7008,12 +6956,11 @@ func (c *RegionHealthChecksDeleteCall) Header() http.Header { func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7123,12 +7070,11 @@ func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7241,8 +7187,7 @@ func (c *RegionHealthChecksInsertCall) Header() http.Header { func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -7435,12 +7380,11 @@ func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7578,8 +7522,7 @@ func (c *RegionHealthChecksPatchCall) Header() http.Header { func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -7688,8 +7631,7 @@ func (c *RegionHealthChecksTestIamPermissionsCall) Header() http.Header { func (c *RegionHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -7814,8 +7756,7 @@ func (c *RegionHealthChecksUpdateCall) Header() http.Header { func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -7944,12 +7885,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsCancelCall) Header() http.Heade func (c *RegionInstanceGroupManagerResizeRequestsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8071,12 +8011,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsDeleteCall) Header() http.Heade func (c *RegionInstanceGroupManagerResizeRequestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8193,12 +8132,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8319,8 +8257,7 @@ func (c *RegionInstanceGroupManagerResizeRequestsInsertCall) Header() http.Heade func (c *RegionInstanceGroupManagerResizeRequestsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerresizerequest) if err != nil { return nil, err } @@ -8519,12 +8456,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8672,8 +8608,7 @@ func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } @@ -8784,8 +8719,7 @@ func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.H func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersapplyupdatesrequest) if err != nil { return nil, err } @@ -8914,8 +8848,7 @@ func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } @@ -9037,12 +8970,11 @@ func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header { func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9167,8 +9099,7 @@ func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersdeleteinstancesrequest) if err != nil { return nil, err } @@ -9279,8 +9210,7 @@ func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerdeleteinstanceconfigreq) if err != nil { return nil, err } @@ -9398,12 +9328,11 @@ func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9522,8 +9451,7 @@ func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header { func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -9716,12 +9644,11 @@ func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9936,12 +9863,11 @@ func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10144,12 +10070,11 @@ func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Head func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10351,12 +10276,11 @@ func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.He func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10502,8 +10426,7 @@ func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header { func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -10630,8 +10553,7 @@ func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.H func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerpatchinstanceconfigreq) if err != nil { return nil, err } @@ -10763,8 +10685,7 @@ func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersrecreaterequest) if err != nil { return nil, err } @@ -10897,12 +10818,11 @@ func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header { func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11029,8 +10949,7 @@ func (c *RegionInstanceGroupManagersResizeAdvancedCall) Header() http.Header { func (c *RegionInstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersresizeadvancedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersresizeadvancedrequest) if err != nil { return nil, err } @@ -11165,8 +11084,7 @@ func (c *RegionInstanceGroupManagersResumeInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersresumeinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } @@ -11291,8 +11209,7 @@ func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.He func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssetautohealingrequest) if err != nil { return nil, err } @@ -11417,8 +11334,7 @@ func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Heade func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssettemplaterequest) if err != nil { return nil, err } @@ -11542,8 +11458,7 @@ func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header { func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } @@ -11677,8 +11592,7 @@ func (c *RegionInstanceGroupManagersStartInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstartinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } @@ -11818,8 +11732,7 @@ func (c *RegionInstanceGroupManagersStopInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstopinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } @@ -11960,8 +11873,7 @@ func (c *RegionInstanceGroupManagersSuspendInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssuspendinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } @@ -12070,8 +11982,7 @@ func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -12203,8 +12114,7 @@ func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header { func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -12331,8 +12241,7 @@ func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerupdateinstanceconfigreq) if err != nil { return nil, err } @@ -12450,12 +12359,11 @@ func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12641,12 +12549,11 @@ func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12849,8 +12756,7 @@ func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header { func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupslistinstancesrequest) if err != nil { return nil, err } @@ -12997,8 +12903,7 @@ func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header { func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupssetnamedportsrequest) if err != nil { return nil, err } @@ -13107,8 +13012,7 @@ func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header { func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -13231,12 +13135,11 @@ func (c *RegionInstanceTemplatesDeleteCall) Header() http.Header { func (c *RegionInstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13360,12 +13263,11 @@ func (c *RegionInstanceTemplatesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13479,8 +13381,7 @@ func (c *RegionInstanceTemplatesInsertCall) Header() http.Header { func (c *RegionInstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancetemplate) if err != nil { return nil, err } @@ -13687,12 +13588,11 @@ func (c *RegionInstanceTemplatesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13826,8 +13726,7 @@ func (c *RegionInstancesBulkInsertCall) Header() http.Header { func (c *RegionInstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertinstanceresource) if err != nil { return nil, err } @@ -13947,12 +13846,11 @@ func (c *RegionInstantSnapshotGroupsDeleteCall) Header() http.Header { func (c *RegionInstantSnapshotGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshotGroups/{instantSnapshotGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14063,12 +13961,11 @@ func (c *RegionInstantSnapshotGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshotGroups/{instantSnapshotGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14187,12 +14084,11 @@ func (c *RegionInstantSnapshotGroupsGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshotGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14311,8 +14207,7 @@ func (c *RegionInstantSnapshotGroupsInsertCall) Header() http.Header { func (c *RegionInstantSnapshotGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshotgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshotgroup) if err != nil { return nil, err } @@ -14505,12 +14400,11 @@ func (c *RegionInstantSnapshotGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshotGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14632,8 +14526,7 @@ func (c *RegionInstantSnapshotGroupsSetIamPolicyCall) Header() http.Header { func (c *RegionInstantSnapshotGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -14742,8 +14635,7 @@ func (c *RegionInstantSnapshotGroupsTestIamPermissionsCall) Header() http.Header func (c *RegionInstantSnapshotGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -14870,12 +14762,11 @@ func (c *RegionInstantSnapshotsDeleteCall) Header() http.Header { func (c *RegionInstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14985,12 +14876,11 @@ func (c *RegionInstantSnapshotsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15109,12 +14999,11 @@ func (c *RegionInstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15226,8 +15115,7 @@ func (c *RegionInstantSnapshotsInsertCall) Header() http.Header { func (c *RegionInstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshot) if err != nil { return nil, err } @@ -15420,12 +15308,11 @@ func (c *RegionInstantSnapshotsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15547,8 +15434,7 @@ func (c *RegionInstantSnapshotsSetIamPolicyCall) Header() http.Header { func (c *RegionInstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -15672,8 +15558,7 @@ func (c *RegionInstantSnapshotsSetLabelsCall) Header() http.Header { func (c *RegionInstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -15782,8 +15667,7 @@ func (c *RegionInstantSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *RegionInstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -15905,12 +15789,11 @@ func (c *RegionMultiMigsDeleteCall) Header() http.Header { func (c *RegionMultiMigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs/{multiMig}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16020,12 +15903,11 @@ func (c *RegionMultiMigsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs/{multiMig}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16137,8 +16019,7 @@ func (c *RegionMultiMigsInsertCall) Header() http.Header { func (c *RegionMultiMigsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.multimig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.multimig) if err != nil { return nil, err } @@ -16330,12 +16211,11 @@ func (c *RegionMultiMigsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16473,8 +16353,7 @@ func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.He func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionnetworkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -16598,12 +16477,11 @@ func (c *RegionNetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *RegionNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16722,8 +16600,7 @@ func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.He func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionnetworkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -16843,12 +16720,11 @@ func (c *RegionNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16963,8 +16839,7 @@ func (c *RegionNetworkEndpointGroupsInsertCall) Header() http.Header { func (c *RegionNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -17158,12 +17033,11 @@ func (c *RegionNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17364,12 +17238,11 @@ func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Head func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17525,8 +17398,7 @@ func (c *RegionNetworkFirewallPoliciesAddAssociationCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -17665,8 +17537,7 @@ func (c *RegionNetworkFirewallPoliciesAddRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -17794,12 +17665,11 @@ func (c *RegionNetworkFirewallPoliciesCloneRulesCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17912,12 +17782,11 @@ func (c *RegionNetworkFirewallPoliciesDeleteCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18027,12 +17896,11 @@ func (c *RegionNetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18150,12 +18018,11 @@ func (c *RegionNetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18265,12 +18132,11 @@ func (c *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18388,12 +18254,11 @@ func (c *RegionNetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18511,12 +18376,11 @@ func (c *RegionNetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18630,8 +18494,7 @@ func (c *RegionNetworkFirewallPoliciesInsertCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -18824,12 +18687,11 @@ func (c *RegionNetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18965,8 +18827,7 @@ func (c *RegionNetworkFirewallPoliciesPatchCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -19090,8 +18951,7 @@ func (c *RegionNetworkFirewallPoliciesPatchAssociationCall) Header() http.Header func (c *RegionNetworkFirewallPoliciesPatchAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -19221,8 +19081,7 @@ func (c *RegionNetworkFirewallPoliciesPatchRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -19351,12 +19210,11 @@ func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) Header() http.Heade func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19476,12 +19334,11 @@ func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19582,8 +19439,7 @@ func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -19692,8 +19548,7 @@ func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Head func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -19906,12 +19761,11 @@ func (c *RegionNotificationEndpointsAggregatedListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/notificationEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20044,12 +19898,11 @@ func (c *RegionNotificationEndpointsDeleteCall) Header() http.Header { func (c *RegionNotificationEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20160,12 +20013,11 @@ func (c *RegionNotificationEndpointsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20279,8 +20131,7 @@ func (c *RegionNotificationEndpointsInsertCall) Header() http.Header { func (c *RegionNotificationEndpointsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationendpoint) if err != nil { return nil, err } @@ -20472,12 +20323,11 @@ func (c *RegionNotificationEndpointsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20599,8 +20449,7 @@ func (c *RegionNotificationEndpointsTestIamPermissionsCall) Header() http.Header func (c *RegionNotificationEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -20708,12 +20557,11 @@ func (c *RegionOperationsDeleteCall) Header() http.Header { func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20801,12 +20649,11 @@ func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20992,12 +20839,11 @@ func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21126,12 +20972,11 @@ func (c *RegionOperationsWaitCall) Header() http.Header { func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -21238,8 +21083,7 @@ func (c *RegionSecurityPoliciesAddRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -21360,12 +21204,11 @@ func (c *RegionSecurityPoliciesDeleteCall) Header() http.Header { func (c *RegionSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21475,12 +21318,11 @@ func (c *RegionSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21598,12 +21440,11 @@ func (c *RegionSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21724,8 +21565,7 @@ func (c *RegionSecurityPoliciesInsertCall) Header() http.Header { func (c *RegionSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -21918,12 +21758,11 @@ func (c *RegionSecurityPoliciesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22076,8 +21915,7 @@ func (c *RegionSecurityPoliciesPatchCall) Header() http.Header { func (c *RegionSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -22207,8 +22045,7 @@ func (c *RegionSecurityPoliciesPatchRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -22321,12 +22158,11 @@ func (c *RegionSecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -22442,8 +22278,7 @@ func (c *RegionSecurityPoliciesSetLabelsCall) Header() http.Header { func (c *RegionSecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -22558,12 +22393,11 @@ func (c *RegionSnapshotSettingsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/snapshotSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22682,8 +22516,7 @@ func (c *RegionSnapshotSettingsPatchCall) Header() http.Header { func (c *RegionSnapshotSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshotsettings) if err != nil { return nil, err } @@ -22807,12 +22640,11 @@ func (c *RegionSnapshotsDeleteCall) Header() http.Header { func (c *RegionSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22922,12 +22754,11 @@ func (c *RegionSnapshotsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23045,12 +22876,11 @@ func (c *RegionSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/snapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23163,8 +22993,7 @@ func (c *RegionSnapshotsInsertCall) Header() http.Header { func (c *RegionSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -23357,12 +23186,11 @@ func (c *RegionSnapshotsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23483,8 +23311,7 @@ func (c *RegionSnapshotsSetIamPolicyCall) Header() http.Header { func (c *RegionSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -23608,8 +23435,7 @@ func (c *RegionSnapshotsSetLabelsCall) Header() http.Header { func (c *RegionSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -23718,8 +23544,7 @@ func (c *RegionSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *RegionSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -23841,12 +23666,11 @@ func (c *RegionSslCertificatesDeleteCall) Header() http.Header { func (c *RegionSslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23957,12 +23781,11 @@ func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24075,8 +23898,7 @@ func (c *RegionSslCertificatesInsertCall) Header() http.Header { func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertificate) if err != nil { return nil, err } @@ -24269,12 +24091,11 @@ func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24396,8 +24217,7 @@ func (c *RegionSslCertificatesTestIamPermissionsCall) Header() http.Header { func (c *RegionSslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -24522,12 +24342,11 @@ func (c *RegionSslPoliciesDeleteCall) Header() http.Header { func (c *RegionSslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24638,12 +24457,11 @@ func (c *RegionSslPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24756,8 +24574,7 @@ func (c *RegionSslPoliciesInsertCall) Header() http.Header { func (c *RegionSslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -24950,12 +24767,11 @@ func (c *RegionSslPoliciesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25162,12 +24978,11 @@ func (c *RegionSslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25284,8 +25099,7 @@ func (c *RegionSslPoliciesPatchCall) Header() http.Header { func (c *RegionSslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -25394,8 +25208,7 @@ func (c *RegionSslPoliciesTestIamPermissionsCall) Header() http.Header { func (c *RegionSslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -25517,12 +25330,11 @@ func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header { func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25632,12 +25444,11 @@ func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25751,8 +25562,7 @@ func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header { func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -25945,12 +25755,11 @@ func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26086,8 +25895,7 @@ func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header { func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -26196,8 +26004,7 @@ func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Header() http.Header { func (c *RegionTargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -26319,12 +26126,11 @@ func (c *RegionTargetHttpsProxiesDeleteCall) Header() http.Header { func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26435,12 +26241,11 @@ func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26554,8 +26359,7 @@ func (c *RegionTargetHttpsProxiesInsertCall) Header() http.Header { func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -26748,12 +26552,11 @@ func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26891,8 +26694,7 @@ func (c *RegionTargetHttpsProxiesPatchCall) Header() http.Header { func (c *RegionTargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -27016,8 +26818,7 @@ func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header { func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiontargethttpsproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -27140,8 +26941,7 @@ func (c *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header { func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -27250,8 +27050,7 @@ func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Header() http.Header { func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -27373,12 +27172,11 @@ func (c *RegionTargetTcpProxiesDeleteCall) Header() http.Header { func (c *RegionTargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27488,12 +27286,11 @@ func (c *RegionTargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27606,8 +27403,7 @@ func (c *RegionTargetTcpProxiesInsertCall) Header() http.Header { func (c *RegionTargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxy) if err != nil { return nil, err } @@ -27800,12 +27596,11 @@ func (c *RegionTargetTcpProxiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27927,8 +27722,7 @@ func (c *RegionTargetTcpProxiesTestIamPermissionsCall) Header() http.Header { func (c *RegionTargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -28042,12 +27836,11 @@ func (c *RegionUrlMapsDeleteCall) Header() http.Header { func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28157,12 +27950,11 @@ func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28267,8 +28059,7 @@ func (c *RegionUrlMapsInsertCall) Header() http.Header { func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -28384,8 +28175,7 @@ func (c *RegionUrlMapsInvalidateCacheCall) Header() http.Header { func (c *RegionUrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cacheinvalidationrule) if err != nil { return nil, err } @@ -28579,12 +28369,11 @@ func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28713,8 +28502,7 @@ func (c *RegionUrlMapsPatchCall) Header() http.Header { func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -28823,8 +28611,7 @@ func (c *RegionUrlMapsTestIamPermissionsCall) Header() http.Header { func (c *RegionUrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -28941,8 +28728,7 @@ func (c *RegionUrlMapsUpdateCall) Header() http.Header { func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -29052,8 +28838,7 @@ func (c *RegionUrlMapsValidateCall) Header() http.Header { func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionurlmapsvalidaterequest) if err != nil { return nil, err } @@ -29248,12 +29033,11 @@ func (c *RegionZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29392,12 +29176,11 @@ func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29591,12 +29374,11 @@ func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29731,12 +29513,11 @@ func (c *ReservationBlocksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks/{reservationBlock}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29928,12 +29709,11 @@ func (c *ReservationBlocksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30077,8 +29857,7 @@ func (c *ReservationBlocksPerformMaintenanceCall) Header() http.Header { func (c *ReservationBlocksPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsblocksperformmaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservationsblocksperformmaintenancerequest) if err != nil { return nil, err } @@ -30292,12 +30071,11 @@ func (c *ReservationsAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30430,12 +30208,11 @@ func (c *ReservationsDeleteCall) Header() http.Header { func (c *ReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30545,12 +30322,11 @@ func (c *ReservationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30668,12 +30444,11 @@ func (c *ReservationsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30786,8 +30561,7 @@ func (c *ReservationsInsertCall) Header() http.Header { func (c *ReservationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -30980,12 +30754,11 @@ func (c *ReservationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31123,8 +30896,7 @@ func (c *ReservationsPerformMaintenanceCall) Header() http.Header { func (c *ReservationsPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsperformmaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservationsperformmaintenancerequest) if err != nil { return nil, err } @@ -31248,8 +31020,7 @@ func (c *ReservationsResizeCall) Header() http.Header { func (c *ReservationsResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservationsresizerequest) if err != nil { return nil, err } @@ -31358,8 +31129,7 @@ func (c *ReservationsSetIamPolicyCall) Header() http.Header { func (c *ReservationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -31468,8 +31238,7 @@ func (c *ReservationsTestIamPermissionsCall) Header() http.Header { func (c *ReservationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -31606,8 +31375,7 @@ func (c *ReservationsUpdateCall) Header() http.Header { func (c *ReservationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation2) if err != nil { return nil, err } @@ -31820,12 +31588,11 @@ func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31958,12 +31725,11 @@ func (c *ResourcePoliciesDeleteCall) Header() http.Header { func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32073,12 +31839,11 @@ func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32196,12 +31961,11 @@ func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32313,8 +32077,7 @@ func (c *ResourcePoliciesInsertCall) Header() http.Header { func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcepolicy) if err != nil { return nil, err } @@ -32507,12 +32270,11 @@ func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32661,8 +32423,7 @@ func (c *ResourcePoliciesPatchCall) Header() http.Header { func (c *ResourcePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcepolicy) if err != nil { return nil, err } @@ -32771,8 +32532,7 @@ func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header { func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -32881,8 +32641,7 @@ func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header { func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -33096,12 +32855,11 @@ func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/routers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33234,12 +32992,11 @@ func (c *RoutersDeleteCall) Header() http.Header { func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33359,12 +33116,11 @@ func (c *RoutersDeleteNamedSetCall) Header() http.Header { func (c *RoutersDeleteNamedSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/deleteNamedSet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -33484,12 +33240,11 @@ func (c *RoutersDeleteRoutePolicyCall) Header() http.Header { func (c *RoutersDeleteRoutePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/deleteRoutePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -33599,12 +33354,11 @@ func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33722,12 +33476,11 @@ func (c *RoutersGetNamedSetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNamedSet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33847,12 +33600,11 @@ func (c *RoutersGetNatIpInfoCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNatIpInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34051,12 +33803,11 @@ func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34196,12 +33947,11 @@ func (c *RoutersGetRoutePolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getRoutePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34312,12 +34062,11 @@ func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getRouterStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34431,8 +34180,7 @@ func (c *RoutersInsertCall) Header() http.Header { func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router) if err != nil { return nil, err } @@ -34625,12 +34373,11 @@ func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34887,12 +34634,11 @@ func (c *RoutersListBgpRoutesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/listBgpRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35104,12 +34850,11 @@ func (c *RoutersListNamedSetsCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/listNamedSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35321,12 +35066,11 @@ func (c *RoutersListRoutePoliciesCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/listRoutePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35465,8 +35209,7 @@ func (c *RoutersPatchCall) Header() http.Header { func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -35589,8 +35332,7 @@ func (c *RoutersPatchNamedSetCall) Header() http.Header { func (c *RoutersPatchNamedSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namedset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namedset) if err != nil { return nil, err } @@ -35713,8 +35455,7 @@ func (c *RoutersPatchRoutePolicyCall) Header() http.Header { func (c *RoutersPatchRoutePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.routepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.routepolicy) if err != nil { return nil, err } @@ -35823,8 +35564,7 @@ func (c *RoutersPreviewCall) Header() http.Header { func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -35934,8 +35674,7 @@ func (c *RoutersTestIamPermissionsCall) Header() http.Header { func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -36062,8 +35801,7 @@ func (c *RoutersUpdateCall) Header() http.Header { func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -36186,8 +35924,7 @@ func (c *RoutersUpdateNamedSetCall) Header() http.Header { func (c *RoutersUpdateNamedSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namedset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namedset) if err != nil { return nil, err } @@ -36310,8 +36047,7 @@ func (c *RoutersUpdateRoutePolicyCall) Header() http.Header { func (c *RoutersUpdateRoutePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.routepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.routepolicy) if err != nil { return nil, err } @@ -36429,12 +36165,11 @@ func (c *RoutesDeleteCall) Header() http.Header { func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36540,12 +36275,11 @@ func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36654,8 +36388,7 @@ func (c *RoutesInsertCall) Header() http.Header { func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.route) if err != nil { return nil, err } @@ -36844,12 +36577,11 @@ func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36966,8 +36698,7 @@ func (c *RoutesTestIamPermissionsCall) Header() http.Header { func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -37079,8 +36810,7 @@ func (c *SecurityPoliciesAddRuleCall) Header() http.Header { func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -37292,12 +37022,11 @@ func (c *SecurityPoliciesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37427,12 +37156,11 @@ func (c *SecurityPoliciesDeleteCall) Header() http.Header { func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37538,12 +37266,11 @@ func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37657,12 +37384,11 @@ func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37779,8 +37505,7 @@ func (c *SecurityPoliciesInsertCall) Header() http.Header { func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -37969,12 +37694,11 @@ func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38177,12 +37901,11 @@ func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38310,8 +38033,7 @@ func (c *SecurityPoliciesPatchCall) Header() http.Header { func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -38437,8 +38159,7 @@ func (c *SecurityPoliciesPatchRuleCall) Header() http.Header { func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -38547,12 +38268,11 @@ func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38649,8 +38369,7 @@ func (c *SecurityPoliciesSetLabelsCall) Header() http.Header { func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -38755,8 +38474,7 @@ func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header { func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -38970,12 +38688,11 @@ func (c *ServiceAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/serviceAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39108,12 +38825,11 @@ func (c *ServiceAttachmentsDeleteCall) Header() http.Header { func (c *ServiceAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39223,12 +38939,11 @@ func (c *ServiceAttachmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39347,12 +39062,11 @@ func (c *ServiceAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39465,8 +39179,7 @@ func (c *ServiceAttachmentsInsertCall) Header() http.Header { func (c *ServiceAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceattachment) if err != nil { return nil, err } @@ -39658,12 +39371,11 @@ func (c *ServiceAttachmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39803,8 +39515,7 @@ func (c *ServiceAttachmentsPatchCall) Header() http.Header { func (c *ServiceAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceattachment) if err != nil { return nil, err } @@ -39913,8 +39624,7 @@ func (c *ServiceAttachmentsSetIamPolicyCall) Header() http.Header { func (c *ServiceAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -40023,8 +39733,7 @@ func (c *ServiceAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *ServiceAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -40137,12 +39846,11 @@ func (c *SnapshotSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshotSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40257,8 +39965,7 @@ func (c *SnapshotSettingsPatchCall) Header() http.Header { func (c *SnapshotSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshotsettings) if err != nil { return nil, err } @@ -40469,12 +40176,11 @@ func (c *SnapshotsAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40608,12 +40314,11 @@ func (c *SnapshotsDeleteCall) Header() http.Header { func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40719,12 +40424,11 @@ func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40838,12 +40542,11 @@ func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40954,8 +40657,7 @@ func (c *SnapshotsInsertCall) Header() http.Header { func (c *SnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -41144,12 +40846,11 @@ func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41266,8 +40967,7 @@ func (c *SnapshotsSetIamPolicyCall) Header() http.Header { func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -41372,8 +41072,7 @@ func (c *SnapshotsSetLabelsCall) Header() http.Header { func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -41478,8 +41177,7 @@ func (c *SnapshotsTestIamPermissionsCall) Header() http.Header { func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -41692,12 +41390,11 @@ func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41827,12 +41524,11 @@ func (c *SslCertificatesDeleteCall) Header() http.Header { func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41938,12 +41634,11 @@ func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42052,8 +41747,7 @@ func (c *SslCertificatesInsertCall) Header() http.Header { func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertificate) if err != nil { return nil, err } @@ -42242,12 +41936,11 @@ func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42365,8 +42058,7 @@ func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header { func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -42579,12 +42271,11 @@ func (c *SslPoliciesAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42717,12 +42408,11 @@ func (c *SslPoliciesDeleteCall) Header() http.Header { func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42829,12 +42519,11 @@ func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42942,8 +42631,7 @@ func (c *SslPoliciesInsertCall) Header() http.Header { func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -43132,12 +42820,11 @@ func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43340,12 +43027,11 @@ func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/listAvailableFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43458,8 +43144,7 @@ func (c *SslPoliciesPatchCall) Header() http.Header { func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -43564,8 +43249,7 @@ func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header { func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -43778,12 +43462,11 @@ func (c *StoragePoolTypesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/storagePoolTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43913,12 +43596,11 @@ func (c *StoragePoolTypesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePoolTypes/{storagePoolType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44105,12 +43787,11 @@ func (c *StoragePoolTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePoolTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44336,12 +44017,11 @@ func (c *StoragePoolsAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/storagePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44477,12 +44157,11 @@ func (c *StoragePoolsDeleteCall) Header() http.Header { func (c *StoragePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44593,12 +44272,11 @@ func (c *StoragePoolsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44716,12 +44394,11 @@ func (c *StoragePoolsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44834,8 +44511,7 @@ func (c *StoragePoolsInsertCall) Header() http.Header { func (c *StoragePoolsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storagepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storagepool) if err != nil { return nil, err } @@ -45027,12 +44703,11 @@ func (c *StoragePoolsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45241,12 +44916,11 @@ func (c *StoragePoolsListDisksCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}/listDisks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45369,8 +45043,7 @@ func (c *StoragePoolsSetIamPolicyCall) Header() http.Header { func (c *StoragePoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -45494,8 +45167,7 @@ func (c *StoragePoolsSetLabelsCall) Header() http.Header { func (c *StoragePoolsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -45604,8 +45276,7 @@ func (c *StoragePoolsTestIamPermissionsCall) Header() http.Header { func (c *StoragePoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -45740,8 +45411,7 @@ func (c *StoragePoolsUpdateCall) Header() http.Header { func (c *StoragePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storagepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storagepool) if err != nil { return nil, err } @@ -45954,12 +45624,11 @@ func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/subnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46092,12 +45761,11 @@ func (c *SubnetworksDeleteCall) Header() http.Header { func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46213,8 +45881,7 @@ func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header { func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetworksexpandipcidrrangerequest) if err != nil { return nil, err } @@ -46332,12 +45999,11 @@ func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46455,12 +46121,11 @@ func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46573,8 +46238,7 @@ func (c *SubnetworksInsertCall) Header() http.Header { func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetwork) if err != nil { return nil, err } @@ -46766,12 +46430,11 @@ func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46983,12 +46646,11 @@ func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/subnetworks/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47140,8 +46802,7 @@ func (c *SubnetworksPatchCall) Header() http.Header { func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetwork2) if err != nil { return nil, err } @@ -47250,8 +46911,7 @@ func (c *SubnetworksSetIamPolicyCall) Header() http.Header { func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -47376,8 +47036,7 @@ func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header { func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetworkssetprivateipgoogleaccessrequest) if err != nil { return nil, err } @@ -47486,8 +47145,7 @@ func (c *SubnetworksTestIamPermissionsCall) Header() http.Header { func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -47606,12 +47264,11 @@ func (c *TargetGrpcProxiesDeleteCall) Header() http.Header { func (c *TargetGrpcProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47717,12 +47374,11 @@ func (c *TargetGrpcProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47832,8 +47488,7 @@ func (c *TargetGrpcProxiesInsertCall) Header() http.Header { func (c *TargetGrpcProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetgrpcproxy) if err != nil { return nil, err } @@ -48021,12 +47676,11 @@ func (c *TargetGrpcProxiesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48160,8 +47814,7 @@ func (c *TargetGrpcProxiesPatchCall) Header() http.Header { func (c *TargetGrpcProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetgrpcproxy) if err != nil { return nil, err } @@ -48266,8 +47919,7 @@ func (c *TargetGrpcProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetGrpcProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -48481,12 +48133,11 @@ func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48616,12 +48267,11 @@ func (c *TargetHttpProxiesDeleteCall) Header() http.Header { func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48727,12 +48377,11 @@ func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48842,8 +48491,7 @@ func (c *TargetHttpProxiesInsertCall) Header() http.Header { func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -49032,12 +48680,11 @@ func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49171,8 +48818,7 @@ func (c *TargetHttpProxiesPatchCall) Header() http.Header { func (c *TargetHttpProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -49291,8 +48937,7 @@ func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header { func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -49397,8 +49042,7 @@ func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -49612,12 +49256,11 @@ func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49747,12 +49390,11 @@ func (c *TargetHttpsProxiesDeleteCall) Header() http.Header { func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49858,12 +49500,11 @@ func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49973,8 +49614,7 @@ func (c *TargetHttpsProxiesInsertCall) Header() http.Header { func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -50163,12 +49803,11 @@ func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50302,8 +49941,7 @@ func (c *TargetHttpsProxiesPatchCall) Header() http.Header { func (c *TargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -50424,8 +50062,7 @@ func (c *TargetHttpsProxiesSetCertificateMapCall) Header() http.Header { func (c *TargetHttpsProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetcertificatemaprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetcertificatemaprequest) if err != nil { return nil, err } @@ -50545,8 +50182,7 @@ func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header { func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetquicoverriderequest) if err != nil { return nil, err } @@ -50666,8 +50302,7 @@ func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header { func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -50791,8 +50426,7 @@ func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header { func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicyreference) if err != nil { return nil, err } @@ -50912,8 +50546,7 @@ func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header { func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -51018,8 +50651,7 @@ func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -51232,12 +50864,11 @@ func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51370,12 +51001,11 @@ func (c *TargetInstancesDeleteCall) Header() http.Header { func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -51485,12 +51115,11 @@ func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51603,8 +51232,7 @@ func (c *TargetInstancesInsertCall) Header() http.Header { func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetinstance) if err != nil { return nil, err } @@ -51797,12 +51425,11 @@ func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51941,8 +51568,7 @@ func (c *TargetInstancesSetSecurityPolicyCall) Header() http.Header { func (c *TargetInstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -52051,8 +51677,7 @@ func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header { func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -52176,8 +51801,7 @@ func (c *TargetPoolsAddHealthCheckCall) Header() http.Header { func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsaddhealthcheckrequest) if err != nil { return nil, err } @@ -52300,8 +51924,7 @@ func (c *TargetPoolsAddInstanceCall) Header() http.Header { func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsaddinstancerequest) if err != nil { return nil, err } @@ -52514,12 +52137,11 @@ func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52652,12 +52274,11 @@ func (c *TargetPoolsDeleteCall) Header() http.Header { func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -52767,12 +52388,11 @@ func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52874,8 +52494,7 @@ func (c *TargetPoolsGetHealthCall) Header() http.Header { func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancereference) if err != nil { return nil, err } @@ -52997,8 +52616,7 @@ func (c *TargetPoolsInsertCall) Header() http.Header { func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpool) if err != nil { return nil, err } @@ -53191,12 +52809,11 @@ func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53331,8 +52948,7 @@ func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header { func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsremovehealthcheckrequest) if err != nil { return nil, err } @@ -53455,8 +53071,7 @@ func (c *TargetPoolsRemoveInstanceCall) Header() http.Header { func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsremoveinstancerequest) if err != nil { return nil, err } @@ -53586,8 +53201,7 @@ func (c *TargetPoolsSetBackupCall) Header() http.Header { func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -53712,8 +53326,7 @@ func (c *TargetPoolsSetSecurityPolicyCall) Header() http.Header { func (c *TargetPoolsSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -53822,8 +53435,7 @@ func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header { func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -53942,12 +53554,11 @@ func (c *TargetSslProxiesDeleteCall) Header() http.Header { func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -54053,12 +53664,11 @@ func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54167,8 +53777,7 @@ func (c *TargetSslProxiesInsertCall) Header() http.Header { func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxy) if err != nil { return nil, err } @@ -54357,12 +53966,11 @@ func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54495,8 +54103,7 @@ func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header { func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetbackendservicerequest) if err != nil { return nil, err } @@ -54617,8 +54224,7 @@ func (c *TargetSslProxiesSetCertificateMapCall) Header() http.Header { func (c *TargetSslProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetcertificatemaprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetcertificatemaprequest) if err != nil { return nil, err } @@ -54738,8 +54344,7 @@ func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header { func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetproxyheaderrequest) if err != nil { return nil, err } @@ -54859,8 +54464,7 @@ func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header { func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -54983,8 +54587,7 @@ func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header { func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicyreference) if err != nil { return nil, err } @@ -55089,8 +54692,7 @@ func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -55303,12 +54905,11 @@ func (c *TargetTcpProxiesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55438,12 +55039,11 @@ func (c *TargetTcpProxiesDeleteCall) Header() http.Header { func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55549,12 +55149,11 @@ func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55663,8 +55262,7 @@ func (c *TargetTcpProxiesInsertCall) Header() http.Header { func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxy) if err != nil { return nil, err } @@ -55853,12 +55451,11 @@ func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55991,8 +55588,7 @@ func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header { func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxiessetbackendservicerequest) if err != nil { return nil, err } @@ -56112,8 +55708,7 @@ func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header { func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxiessetproxyheaderrequest) if err != nil { return nil, err } @@ -56218,8 +55813,7 @@ func (c *TargetTcpProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -56432,12 +56026,11 @@ func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56570,12 +56163,11 @@ func (c *TargetVpnGatewaysDeleteCall) Header() http.Header { func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56685,12 +56277,11 @@ func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56804,8 +56395,7 @@ func (c *TargetVpnGatewaysInsertCall) Header() http.Header { func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetvpngateway) if err != nil { return nil, err } @@ -56998,12 +56588,11 @@ func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57140,8 +56729,7 @@ func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header { func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -57250,8 +56838,7 @@ func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -57465,12 +57052,11 @@ func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57600,12 +57186,11 @@ func (c *UrlMapsDeleteCall) Header() http.Header { func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -57711,12 +57296,11 @@ func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57825,8 +57409,7 @@ func (c *UrlMapsInsertCall) Header() http.Header { func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -57946,8 +57529,7 @@ func (c *UrlMapsInvalidateCacheCall) Header() http.Header { func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cacheinvalidationrule) if err != nil { return nil, err } @@ -58137,12 +57719,11 @@ func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58275,8 +57856,7 @@ func (c *UrlMapsPatchCall) Header() http.Header { func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -58381,8 +57961,7 @@ func (c *UrlMapsTestIamPermissionsCall) Header() http.Header { func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -58503,8 +58082,7 @@ func (c *UrlMapsUpdateCall) Header() http.Header { func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -58610,8 +58188,7 @@ func (c *UrlMapsValidateCall) Header() http.Header { func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapsvalidaterequest) if err != nil { return nil, err } @@ -58824,12 +58401,11 @@ func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/vpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58962,12 +58538,11 @@ func (c *VpnGatewaysDeleteCall) Header() http.Header { func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -59077,12 +58652,11 @@ func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59192,12 +58766,11 @@ func (c *VpnGatewaysGetStatusCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59311,8 +58884,7 @@ func (c *VpnGatewaysInsertCall) Header() http.Header { func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpngateway) if err != nil { return nil, err } @@ -59505,12 +59077,11 @@ func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59646,8 +59217,7 @@ func (c *VpnGatewaysSetLabelsCall) Header() http.Header { func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -59756,8 +59326,7 @@ func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -59971,12 +59540,11 @@ func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/vpnTunnels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60109,12 +59677,11 @@ func (c *VpnTunnelsDeleteCall) Header() http.Header { func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -60224,12 +59791,11 @@ func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60342,8 +59908,7 @@ func (c *VpnTunnelsInsertCall) Header() http.Header { func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpntunnel) if err != nil { return nil, err } @@ -60536,12 +60101,11 @@ func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60677,8 +60241,7 @@ func (c *VpnTunnelsSetLabelsCall) Header() http.Header { func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -60787,8 +60350,7 @@ func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header { func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -60911,12 +60473,11 @@ func (c *WireGroupsDeleteCall) Header() http.Header { func (c *WireGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/crossSiteNetworks/{crossSiteNetwork}/wireGroups/{wireGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -61026,12 +60587,11 @@ func (c *WireGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/crossSiteNetworks/{crossSiteNetwork}/wireGroups/{wireGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61152,8 +60712,7 @@ func (c *WireGroupsInsertCall) Header() http.Header { func (c *WireGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wiregroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wiregroup) if err != nil { return nil, err } @@ -61345,12 +60904,11 @@ func (c *WireGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/crossSiteNetworks/{crossSiteNetwork}/wireGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61502,8 +61060,7 @@ func (c *WireGroupsPatchCall) Header() http.Header { func (c *WireGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wiregroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wiregroup) if err != nil { return nil, err } @@ -61610,12 +61167,11 @@ func (c *ZoneOperationsDeleteCall) Header() http.Header { func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -61703,12 +61259,11 @@ func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61894,12 +61449,11 @@ func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62027,12 +61581,11 @@ func (c *ZoneOperationsWaitCall) Header() http.Header { func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62237,12 +61790,11 @@ func (c *ZoneQueuedResourcesAggregatedListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/queuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62376,12 +61928,11 @@ func (c *ZoneQueuedResourcesCancelCall) Header() http.Header { func (c *ZoneQueuedResourcesCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/queuedResources/{queuedResource}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -62498,12 +62049,11 @@ func (c *ZoneQueuedResourcesDeleteCall) Header() http.Header { func (c *ZoneQueuedResourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/queuedResources/{queuedResource}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -62613,12 +62163,11 @@ func (c *ZoneQueuedResourcesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/queuedResources/{queuedResource}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62730,8 +62279,7 @@ func (c *ZoneQueuedResourcesInsertCall) Header() http.Header { func (c *ZoneQueuedResourcesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queuedresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queuedresource) if err != nil { return nil, err } @@ -62923,12 +62471,11 @@ func (c *ZoneQueuedResourcesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/queuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63056,12 +62603,11 @@ func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63243,12 +62789,11 @@ func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/compute/v0.beta/compute-gen.go b/compute/v0.beta/compute-gen.go index 3779c7acefc..7ca9fef260b 100644 --- a/compute/v0.beta/compute-gen.go +++ b/compute/v0.beta/compute-gen.go @@ -142,25 +142,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.AcceleratorTypes = NewAcceleratorTypesService(s) s.Addresses = NewAddressesService(s) @@ -268,9 +249,27 @@ func New(client *http.Client) (*Service, error) { s.VpnTunnels = NewVpnTunnelsService(s) s.ZoneOperations = NewZoneOperationsService(s) s.Zones = NewZonesService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL diff --git a/compute/v0.beta/compute2-gen.go b/compute/v0.beta/compute2-gen.go index 7a9062e4b49..2e6ed845ec4 100644 --- a/compute/v0.beta/compute2-gen.go +++ b/compute/v0.beta/compute2-gen.go @@ -9,7 +9,6 @@ package compute import ( "context" "fmt" - "io" "net/http" googleapi "google.golang.org/api/googleapi" @@ -171,12 +170,11 @@ func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -306,12 +304,11 @@ func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -498,12 +495,11 @@ func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -729,12 +725,11 @@ func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -867,12 +862,11 @@ func (c *AddressesDeleteCall) Header() http.Header { func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -982,12 +976,11 @@ func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1100,8 +1093,7 @@ func (c *AddressesInsertCall) Header() http.Header { func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.address) if err != nil { return nil, err } @@ -1293,12 +1285,11 @@ func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1433,8 +1424,7 @@ func (c *AddressesMoveCall) Header() http.Header { func (c *AddressesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionaddressesmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionaddressesmoverequest) if err != nil { return nil, err } @@ -1558,8 +1548,7 @@ func (c *AddressesSetLabelsCall) Header() http.Header { func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -1668,8 +1657,7 @@ func (c *AddressesTestIamPermissionsCall) Header() http.Header { func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -1883,12 +1871,11 @@ func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2021,12 +2008,11 @@ func (c *AutoscalersDeleteCall) Header() http.Header { func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2136,12 +2122,11 @@ func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2254,8 +2239,7 @@ func (c *AutoscalersInsertCall) Header() http.Header { func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2447,12 +2431,11 @@ func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2593,8 +2576,7 @@ func (c *AutoscalersPatchCall) Header() http.Header { func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2702,8 +2684,7 @@ func (c *AutoscalersTestIamPermissionsCall) Header() http.Header { func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -2832,8 +2813,7 @@ func (c *AutoscalersUpdateCall) Header() http.Header { func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2954,8 +2934,7 @@ func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header { func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signedurlkey) if err != nil { return nil, err } @@ -3072,12 +3051,11 @@ func (c *BackendBucketsDeleteCall) Header() http.Header { func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3190,12 +3168,11 @@ func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header { func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3301,12 +3278,11 @@ func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3420,12 +3396,11 @@ func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3534,8 +3509,7 @@ func (c *BackendBucketsInsertCall) Header() http.Header { func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -3724,12 +3698,11 @@ func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3863,8 +3836,7 @@ func (c *BackendBucketsPatchCall) Header() http.Header { func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -3985,8 +3957,7 @@ func (c *BackendBucketsSetEdgeSecurityPolicyCall) Header() http.Header { func (c *BackendBucketsSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -4091,8 +4062,7 @@ func (c *BackendBucketsSetIamPolicyCall) Header() http.Header { func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -4197,8 +4167,7 @@ func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header { func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -4319,8 +4288,7 @@ func (c *BackendBucketsUpdateCall) Header() http.Header { func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -4441,8 +4409,7 @@ func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header { func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signedurlkey) if err != nil { return nil, err } @@ -4654,12 +4621,11 @@ func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4789,12 +4755,11 @@ func (c *BackendServicesDeleteCall) Header() http.Header { func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4907,12 +4872,11 @@ func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header { func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5018,12 +4982,11 @@ func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5130,12 +5093,11 @@ func (c *BackendServicesGetEffectiveSecurityPoliciesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/getEffectiveSecurityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5235,8 +5197,7 @@ func (c *BackendServicesGetHealthCall) Header() http.Header { func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcegroupreference) if err != nil { return nil, err } @@ -5359,12 +5320,11 @@ func (c *BackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5474,8 +5434,7 @@ func (c *BackendServicesInsertCall) Header() http.Header { func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -5664,12 +5623,11 @@ func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5872,12 +5830,11 @@ func (c *BackendServicesListUsableCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6012,8 +5969,7 @@ func (c *BackendServicesPatchCall) Header() http.Header { func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -6134,8 +6090,7 @@ func (c *BackendServicesSetEdgeSecurityPolicyCall) Header() http.Header { func (c *BackendServicesSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -6240,8 +6195,7 @@ func (c *BackendServicesSetIamPolicyCall) Header() http.Header { func (c *BackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -6363,8 +6317,7 @@ func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header { func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -6469,8 +6422,7 @@ func (c *BackendServicesTestIamPermissionsCall) Header() http.Header { func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -6591,8 +6543,7 @@ func (c *BackendServicesUpdateCall) Header() http.Header { func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -6804,12 +6755,11 @@ func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6939,12 +6889,11 @@ func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7129,12 +7078,11 @@ func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7271,8 +7219,7 @@ func (c *DisksAddResourcePoliciesCall) Header() http.Header { func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -7485,12 +7432,11 @@ func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7622,8 +7568,7 @@ func (c *DisksBulkInsertCall) Header() http.Header { func (c *DisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertdiskresource) if err != nil { return nil, err } @@ -7756,8 +7701,7 @@ func (c *DisksCreateSnapshotCall) Header() http.Header { func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -7881,12 +7825,11 @@ func (c *DisksDeleteCall) Header() http.Header { func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7996,12 +7939,11 @@ func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8119,12 +8061,11 @@ func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8247,8 +8188,7 @@ func (c *DisksInsertCall) Header() http.Header { func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk) if err != nil { return nil, err } @@ -8441,12 +8381,11 @@ func (c *DisksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8581,8 +8520,7 @@ func (c *DisksRemoveResourcePoliciesCall) Header() http.Header { func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -8706,8 +8644,7 @@ func (c *DisksResizeCall) Header() http.Header { func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksresizerequest) if err != nil { return nil, err } @@ -8816,8 +8753,7 @@ func (c *DisksSetIamPolicyCall) Header() http.Header { func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -8941,8 +8877,7 @@ func (c *DisksSetLabelsCall) Header() http.Header { func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -9066,8 +9001,7 @@ func (c *DisksStartAsyncReplicationCall) Header() http.Header { func (c *DisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstartasyncreplicationrequest) if err != nil { return nil, err } @@ -9189,12 +9123,11 @@ func (c *DisksStopAsyncReplicationCall) Header() http.Header { func (c *DisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9308,8 +9241,7 @@ func (c *DisksStopGroupAsyncReplicationCall) Header() http.Header { func (c *DisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstopgroupasyncreplicationresource) if err != nil { return nil, err } @@ -9417,8 +9349,7 @@ func (c *DisksTestIamPermissionsCall) Header() http.Header { func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -9557,8 +9488,7 @@ func (c *DisksUpdateCall) Header() http.Header { func (c *DisksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk2) if err != nil { return nil, err } @@ -9676,12 +9606,11 @@ func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header { func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9788,12 +9717,11 @@ func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9903,8 +9831,7 @@ func (c *ExternalVpnGatewaysInsertCall) Header() http.Header { func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalvpngateway) if err != nil { return nil, err } @@ -10093,12 +10020,11 @@ func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10216,8 +10142,7 @@ func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header { func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -10322,8 +10247,7 @@ func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -10449,8 +10373,7 @@ func (c *FirewallPoliciesAddAssociationCall) Header() http.Header { func (c *FirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -10566,8 +10489,7 @@ func (c *FirewallPoliciesAddPacketMirroringRuleCall) Header() http.Header { func (c *FirewallPoliciesAddPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -10682,8 +10604,7 @@ func (c *FirewallPoliciesAddRuleCall) Header() http.Header { func (c *FirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -10803,12 +10724,11 @@ func (c *FirewallPoliciesCloneRulesCall) Header() http.Header { func (c *FirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10913,12 +10833,11 @@ func (c *FirewallPoliciesDeleteCall) Header() http.Header { func (c *FirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11020,12 +10939,11 @@ func (c *FirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11135,12 +11053,11 @@ func (c *FirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11251,12 +11168,11 @@ func (c *FirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11367,12 +11283,11 @@ func (c *FirewallPoliciesGetPacketMirroringRuleCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getPacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11483,12 +11398,11 @@ func (c *FirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11601,8 +11515,7 @@ func (c *FirewallPoliciesInsertCall) Header() http.Header { func (c *FirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -11792,12 +11705,11 @@ func (c *FirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11922,12 +11834,11 @@ func (c *FirewallPoliciesListAssociationsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/listAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12039,12 +11950,11 @@ func (c *FirewallPoliciesMoveCall) Header() http.Header { func (c *FirewallPoliciesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12151,8 +12061,7 @@ func (c *FirewallPoliciesPatchCall) Header() http.Header { func (c *FirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -12275,8 +12184,7 @@ func (c *FirewallPoliciesPatchPacketMirroringRuleCall) Header() http.Header { func (c *FirewallPoliciesPatchPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -12398,8 +12306,7 @@ func (c *FirewallPoliciesPatchRuleCall) Header() http.Header { func (c *FirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -12519,12 +12426,11 @@ func (c *FirewallPoliciesRemoveAssociationCall) Header() http.Header { func (c *FirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12637,12 +12543,11 @@ func (c *FirewallPoliciesRemovePacketMirroringRuleCall) Header() http.Header { func (c *FirewallPoliciesRemovePacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removePacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12754,12 +12659,11 @@ func (c *FirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *FirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12852,8 +12756,7 @@ func (c *FirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *FirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalorganizationsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalorganizationsetpolicyrequest) if err != nil { return nil, err } @@ -12954,8 +12857,7 @@ func (c *FirewallPoliciesTestIamPermissionsCall) Header() http.Header { func (c *FirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -13072,12 +12974,11 @@ func (c *FirewallsDeleteCall) Header() http.Header { func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13183,12 +13084,11 @@ func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13297,8 +13197,7 @@ func (c *FirewallsInsertCall) Header() http.Header { func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall) if err != nil { return nil, err } @@ -13487,12 +13386,11 @@ func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13625,8 +13523,7 @@ func (c *FirewallsPatchCall) Header() http.Header { func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall2) if err != nil { return nil, err } @@ -13731,8 +13628,7 @@ func (c *FirewallsTestIamPermissionsCall) Header() http.Header { func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -13854,8 +13750,7 @@ func (c *FirewallsUpdateCall) Header() http.Header { func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall2) if err != nil { return nil, err } @@ -14067,12 +13962,11 @@ func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14205,12 +14099,11 @@ func (c *ForwardingRulesDeleteCall) Header() http.Header { func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14320,12 +14213,11 @@ func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14438,8 +14330,7 @@ func (c *ForwardingRulesInsertCall) Header() http.Header { func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -14632,12 +14523,11 @@ func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14776,8 +14666,7 @@ func (c *ForwardingRulesPatchCall) Header() http.Header { func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -14901,8 +14790,7 @@ func (c *ForwardingRulesSetLabelsCall) Header() http.Header { func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -15027,8 +14915,7 @@ func (c *ForwardingRulesSetTargetCall) Header() http.Header { func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -15137,8 +15024,7 @@ func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header { func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -15352,12 +15238,11 @@ func (c *FutureReservationsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/futureReservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15491,12 +15376,11 @@ func (c *FutureReservationsCancelCall) Header() http.Header { func (c *FutureReservationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations/{futureReservation}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -15610,12 +15494,11 @@ func (c *FutureReservationsDeleteCall) Header() http.Header { func (c *FutureReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations/{futureReservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15726,12 +15609,11 @@ func (c *FutureReservationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations/{futureReservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15844,8 +15726,7 @@ func (c *FutureReservationsInsertCall) Header() http.Header { func (c *FutureReservationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.futurereservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.futurereservation) if err != nil { return nil, err } @@ -16038,12 +15919,11 @@ func (c *FutureReservationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/futureReservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16187,8 +16067,7 @@ func (c *FutureReservationsUpdateCall) Header() http.Header { func (c *FutureReservationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.futurereservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.futurereservation) if err != nil { return nil, err } @@ -16306,12 +16185,11 @@ func (c *GlobalAddressesDeleteCall) Header() http.Header { func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16417,12 +16295,11 @@ func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16531,8 +16408,7 @@ func (c *GlobalAddressesInsertCall) Header() http.Header { func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.address) if err != nil { return nil, err } @@ -16720,12 +16596,11 @@ func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16857,8 +16732,7 @@ func (c *GlobalAddressesMoveCall) Header() http.Header { func (c *GlobalAddressesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globaladdressesmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globaladdressesmoverequest) if err != nil { return nil, err } @@ -16963,8 +16837,7 @@ func (c *GlobalAddressesSetLabelsCall) Header() http.Header { func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -17069,8 +16942,7 @@ func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header { func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -17188,12 +17060,11 @@ func (c *GlobalForwardingRulesDeleteCall) Header() http.Header { func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17300,12 +17171,11 @@ func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17414,8 +17284,7 @@ func (c *GlobalForwardingRulesInsertCall) Header() http.Header { func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -17604,12 +17473,11 @@ func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17744,8 +17612,7 @@ func (c *GlobalForwardingRulesPatchCall) Header() http.Header { func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -17850,8 +17717,7 @@ func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header { func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -17972,8 +17838,7 @@ func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header { func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -18078,8 +17943,7 @@ func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header { func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -18201,8 +18065,7 @@ func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.He func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalnetworkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -18321,12 +18184,11 @@ func (c *GlobalNetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *GlobalNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18439,8 +18301,7 @@ func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.He func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalnetworkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -18555,12 +18416,11 @@ func (c *GlobalNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18670,8 +18530,7 @@ func (c *GlobalNetworkEndpointGroupsInsertCall) Header() http.Header { func (c *GlobalNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -18860,12 +18719,11 @@ func (c *GlobalNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19061,12 +18919,11 @@ func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Head func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19292,12 +19149,11 @@ func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19413,12 +19269,11 @@ func (c *GlobalOperationsDeleteCall) Header() http.Header { func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19502,12 +19357,11 @@ func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19689,12 +19543,11 @@ func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19819,12 +19672,11 @@ func (c *GlobalOperationsWaitCall) Header() http.Header { func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19922,12 +19774,11 @@ func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header { func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20014,12 +19865,11 @@ func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20202,12 +20052,11 @@ func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20334,12 +20183,11 @@ func (c *GlobalPublicDelegatedPrefixesDeleteCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20446,12 +20294,11 @@ func (c *GlobalPublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20561,8 +20408,7 @@ func (c *GlobalPublicDelegatedPrefixesInsertCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -20750,12 +20596,11 @@ func (c *GlobalPublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20890,8 +20735,7 @@ func (c *GlobalPublicDelegatedPrefixesPatchCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -21103,12 +20947,11 @@ func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21238,12 +21081,11 @@ func (c *HealthChecksDeleteCall) Header() http.Header { func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21349,12 +21191,11 @@ func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21463,8 +21304,7 @@ func (c *HealthChecksInsertCall) Header() http.Header { func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -21653,12 +21493,11 @@ func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21792,8 +21631,7 @@ func (c *HealthChecksPatchCall) Header() http.Header { func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -21898,8 +21736,7 @@ func (c *HealthChecksTestIamPermissionsCall) Header() http.Header { func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -22020,8 +21857,7 @@ func (c *HealthChecksUpdateCall) Header() http.Header { func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -22138,12 +21974,11 @@ func (c *HttpHealthChecksDeleteCall) Header() http.Header { func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22249,12 +22084,11 @@ func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22364,8 +22198,7 @@ func (c *HttpHealthChecksInsertCall) Header() http.Header { func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -22554,12 +22387,11 @@ func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22693,8 +22525,7 @@ func (c *HttpHealthChecksPatchCall) Header() http.Header { func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -22799,8 +22630,7 @@ func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header { func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -22921,8 +22751,7 @@ func (c *HttpHealthChecksUpdateCall) Header() http.Header { func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -23039,12 +22868,11 @@ func (c *HttpsHealthChecksDeleteCall) Header() http.Header { func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23150,12 +22978,11 @@ func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23265,8 +23092,7 @@ func (c *HttpsHealthChecksInsertCall) Header() http.Header { func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -23455,12 +23281,11 @@ func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23594,8 +23419,7 @@ func (c *HttpsHealthChecksPatchCall) Header() http.Header { func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -23700,8 +23524,7 @@ func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header { func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -23822,8 +23645,7 @@ func (c *HttpsHealthChecksUpdateCall) Header() http.Header { func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -23941,12 +23763,11 @@ func (c *ImageFamilyViewsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/imageFamilyViews/{family}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24057,12 +23878,11 @@ func (c *ImagesDeleteCall) Header() http.Header { func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24174,8 +23994,7 @@ func (c *ImagesDeprecateCall) Header() http.Header { func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deprecationstatus) if err != nil { return nil, err } @@ -24289,12 +24108,11 @@ func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24403,12 +24221,11 @@ func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/family/{family}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24522,12 +24339,11 @@ func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24643,8 +24459,7 @@ func (c *ImagesInsertCall) Header() http.Header { func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.image) if err != nil { return nil, err } @@ -24843,12 +24658,11 @@ func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24981,8 +24795,7 @@ func (c *ImagesPatchCall) Header() http.Header { func (c *ImagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.image2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.image2) if err != nil { return nil, err } @@ -25087,8 +24900,7 @@ func (c *ImagesSetIamPolicyCall) Header() http.Header { func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -25193,8 +25005,7 @@ func (c *ImagesSetLabelsCall) Header() http.Header { func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -25299,8 +25110,7 @@ func (c *ImagesTestIamPermissionsCall) Header() http.Header { func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -25430,12 +25240,11 @@ func (c *InstanceGroupManagerResizeRequestsCancelCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -25557,12 +25366,11 @@ func (c *InstanceGroupManagerResizeRequestsDeleteCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25679,12 +25487,11 @@ func (c *InstanceGroupManagerResizeRequestsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25805,8 +25612,7 @@ func (c *InstanceGroupManagerResizeRequestsInsertCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerresizerequest) if err != nil { return nil, err } @@ -26005,12 +25811,11 @@ func (c *InstanceGroupManagerResizeRequestsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26158,8 +25963,7 @@ func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header { func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } @@ -26372,12 +26176,11 @@ func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26501,8 +26304,7 @@ func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersapplyupdatesrequest) if err != nil { return nil, err } @@ -26631,8 +26433,7 @@ func (c *InstanceGroupManagersCreateInstancesCall) Header() http.Header { func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } @@ -26755,12 +26556,11 @@ func (c *InstanceGroupManagersDeleteCall) Header() http.Header { func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26885,8 +26685,7 @@ func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header { func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersdeleteinstancesrequest) if err != nil { return nil, err } @@ -26997,8 +26796,7 @@ func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersdeleteperinstanceconfigsreq) if err != nil { return nil, err } @@ -27116,12 +26914,11 @@ func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27242,8 +27039,7 @@ func (c *InstanceGroupManagersInsertCall) Header() http.Header { func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -27436,12 +27232,11 @@ func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27656,12 +27451,11 @@ func (c *InstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27866,12 +27660,11 @@ func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header { func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -28073,12 +27866,11 @@ func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header { func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -28225,8 +28017,7 @@ func (c *InstanceGroupManagersPatchCall) Header() http.Header { func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -28353,8 +28144,7 @@ func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerspatchperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerspatchperinstanceconfigsreq) if err != nil { return nil, err } @@ -28486,8 +28276,7 @@ func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header { func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersrecreateinstancesrequest) if err != nil { return nil, err } @@ -28626,12 +28415,11 @@ func (c *InstanceGroupManagersResizeCall) Header() http.Header { func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -28757,8 +28545,7 @@ func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header { func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersresizeadvancedrequest) if err != nil { return nil, err } @@ -28893,8 +28680,7 @@ func (c *InstanceGroupManagersResumeInstancesCall) Header() http.Header { func (c *InstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresumeinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } @@ -29019,8 +28805,7 @@ func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header { func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssetautohealingrequest) if err != nil { return nil, err } @@ -29146,8 +28931,7 @@ func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header { func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssetinstancetemplaterequest) if err != nil { return nil, err } @@ -29275,8 +29059,7 @@ func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header { func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } @@ -29410,8 +29193,7 @@ func (c *InstanceGroupManagersStartInstancesCall) Header() http.Header { func (c *InstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstartinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } @@ -29551,8 +29333,7 @@ func (c *InstanceGroupManagersStopInstancesCall) Header() http.Header { func (c *InstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstopinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } @@ -29693,8 +29474,7 @@ func (c *InstanceGroupManagersSuspendInstancesCall) Header() http.Header { func (c *InstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssuspendinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } @@ -29803,8 +29583,7 @@ func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header { func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -29937,8 +29716,7 @@ func (c *InstanceGroupManagersUpdateCall) Header() http.Header { func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -30065,8 +29843,7 @@ func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersupdateperinstanceconfigsreq) if err != nil { return nil, err } @@ -30192,8 +29969,7 @@ func (c *InstanceGroupsAddInstancesCall) Header() http.Header { func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupsaddinstancesrequest) if err != nil { return nil, err } @@ -30406,12 +30182,11 @@ func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30546,12 +30321,11 @@ func (c *InstanceGroupsDeleteCall) Header() http.Header { func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30664,12 +30438,11 @@ func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30782,8 +30555,7 @@ func (c *InstanceGroupsInsertCall) Header() http.Header { func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroup) if err != nil { return nil, err } @@ -30977,12 +30749,11 @@ func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31185,8 +30956,7 @@ func (c *InstanceGroupsListInstancesCall) Header() http.Header { func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupslistinstancesrequest) if err != nil { return nil, err } @@ -31336,8 +31106,7 @@ func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header { func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupsremoveinstancesrequest) if err != nil { return nil, err } @@ -31461,8 +31230,7 @@ func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header { func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupssetnamedportsrequest) if err != nil { return nil, err } @@ -31571,8 +31339,7 @@ func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header { func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -31688,12 +31455,11 @@ func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31812,8 +31578,7 @@ func (c *InstanceSettingsPatchCall) Header() http.Header { func (c *InstanceSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesettings) if err != nil { return nil, err } @@ -32026,12 +31791,11 @@ func (c *InstanceTemplatesAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32163,12 +31927,11 @@ func (c *InstanceTemplatesDeleteCall) Header() http.Header { func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32288,12 +32051,11 @@ func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32408,12 +32170,11 @@ func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32525,8 +32286,7 @@ func (c *InstanceTemplatesInsertCall) Header() http.Header { func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancetemplate) if err != nil { return nil, err } @@ -32729,12 +32489,11 @@ func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32852,8 +32611,7 @@ func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header { func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -32958,8 +32716,7 @@ func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header { func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -33085,8 +32842,7 @@ func (c *InstancesAddAccessConfigCall) Header() http.Header { func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessconfig) if err != nil { return nil, err } @@ -33211,8 +32967,7 @@ func (c *InstancesAddResourcePoliciesCall) Header() http.Header { func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -33427,12 +33182,11 @@ func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33579,8 +33333,7 @@ func (c *InstancesAttachDiskCall) Header() http.Header { func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attacheddisk) if err != nil { return nil, err } @@ -33701,8 +33454,7 @@ func (c *InstancesBulkInsertCall) Header() http.Header { func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertinstanceresource) if err != nil { return nil, err } @@ -33830,12 +33582,11 @@ func (c *InstancesDeleteCall) Header() http.Header { func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33953,12 +33704,11 @@ func (c *InstancesDeleteAccessConfigCall) Header() http.Header { func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34074,12 +33824,11 @@ func (c *InstancesDetachDiskCall) Header() http.Header { func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/detachDisk") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34203,12 +33952,11 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34322,12 +34070,11 @@ func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34452,12 +34199,11 @@ func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34576,12 +34322,11 @@ func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34699,12 +34444,11 @@ func (c *InstancesGetPartnerMetadataCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getPartnerMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34815,12 +34559,11 @@ func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/screenshot") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34957,12 +34700,11 @@ func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/serialPort") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35074,12 +34816,11 @@ func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35190,12 +34931,11 @@ func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35335,8 +35075,7 @@ func (c *InstancesInsertCall) Header() http.Header { func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -35542,12 +35281,11 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35760,12 +35498,11 @@ func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/referrers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35902,8 +35639,7 @@ func (c *InstancesPatchPartnerMetadataCall) Header() http.Header { func (c *InstancesPatchPartnerMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.partnermetadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.partnermetadata) if err != nil { return nil, err } @@ -36024,12 +35760,11 @@ func (c *InstancesPerformMaintenanceCall) Header() http.Header { func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -36144,8 +35879,7 @@ func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header { func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -36267,12 +36001,11 @@ func (c *InstancesResetCall) Header() http.Header { func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -36388,8 +36121,7 @@ func (c *InstancesResumeCall) Header() http.Header { func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesresumerequest) if err != nil { return nil, err } @@ -36495,12 +36227,11 @@ func (c *InstancesSendDiagnosticInterruptCall) Header() http.Header { func (c *InstancesSendDiagnosticInterruptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -36597,12 +36328,11 @@ func (c *InstancesSetDeletionProtectionCall) Header() http.Header { func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -36721,12 +36451,11 @@ func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header { func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -36827,8 +36556,7 @@ func (c *InstancesSetIamPolicyCall) Header() http.Header { func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -36952,8 +36680,7 @@ func (c *InstancesSetLabelsCall) Header() http.Header { func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetlabelsrequest) if err != nil { return nil, err } @@ -37077,8 +36804,7 @@ func (c *InstancesSetMachineResourcesCall) Header() http.Header { func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmachineresourcesrequest) if err != nil { return nil, err } @@ -37202,8 +36928,7 @@ func (c *InstancesSetMachineTypeCall) Header() http.Header { func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmachinetyperequest) if err != nil { return nil, err } @@ -37327,8 +37052,7 @@ func (c *InstancesSetMetadataCall) Header() http.Header { func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadata) if err != nil { return nil, err } @@ -37453,8 +37177,7 @@ func (c *InstancesSetMinCpuPlatformCall) Header() http.Header { func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmincpuplatformrequest) if err != nil { return nil, err } @@ -37577,8 +37300,7 @@ func (c *InstancesSetNameCall) Header() http.Header { func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetnamerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetnamerequest) if err != nil { return nil, err } @@ -37705,8 +37427,7 @@ func (c *InstancesSetSchedulingCall) Header() http.Header { func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scheduling) if err != nil { return nil, err } @@ -37831,8 +37552,7 @@ func (c *InstancesSetSecurityPolicyCall) Header() http.Header { func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetsecuritypolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetsecuritypolicyrequest) if err != nil { return nil, err } @@ -37957,8 +37677,7 @@ func (c *InstancesSetServiceAccountCall) Header() http.Header { func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetserviceaccountrequest) if err != nil { return nil, err } @@ -38084,8 +37803,7 @@ func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header { func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedinstanceintegritypolicy) if err != nil { return nil, err } @@ -38211,8 +37929,7 @@ func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header { func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedvmintegritypolicy) if err != nil { return nil, err } @@ -38336,8 +38053,7 @@ func (c *InstancesSetTagsCall) Header() http.Header { func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tags) if err != nil { return nil, err } @@ -38467,12 +38183,11 @@ func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header { func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38586,12 +38301,11 @@ func (c *InstancesStartCall) Header() http.Header { func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/start") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38707,8 +38421,7 @@ func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header { func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesstartwithencryptionkeyrequest) if err != nil { return nil, err } @@ -38850,12 +38563,11 @@ func (c *InstancesStopCall) Header() http.Header { func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/stop") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38983,12 +38695,11 @@ func (c *InstancesSuspendCall) Header() http.Header { func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/suspend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -39089,8 +38800,7 @@ func (c *InstancesTestIamPermissionsCall) Header() http.Header { func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -39250,8 +38960,7 @@ func (c *InstancesUpdateCall) Header() http.Header { func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance2) if err != nil { return nil, err } @@ -39380,8 +39089,7 @@ func (c *InstancesUpdateAccessConfigCall) Header() http.Header { func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessconfig) if err != nil { return nil, err } @@ -39506,8 +39214,7 @@ func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header { func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.displaydevice) if err != nil { return nil, err } @@ -39636,8 +39343,7 @@ func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header { func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkinterface) if err != nil { return nil, err } @@ -39763,8 +39469,7 @@ func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header { func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedinstanceconfig) if err != nil { return nil, err } @@ -39889,8 +39594,7 @@ func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header { func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedvmconfig) if err != nil { return nil, err } @@ -40103,12 +39807,11 @@ func (c *InstantSnapshotsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40246,12 +39949,11 @@ func (c *InstantSnapshotsDeleteCall) Header() http.Header { func (c *InstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40361,12 +40063,11 @@ func (c *InstantSnapshotsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40485,12 +40186,11 @@ func (c *InstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40602,8 +40302,7 @@ func (c *InstantSnapshotsInsertCall) Header() http.Header { func (c *InstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshot) if err != nil { return nil, err } @@ -40796,12 +40495,11 @@ func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40923,8 +40621,7 @@ func (c *InstantSnapshotsSetIamPolicyCall) Header() http.Header { func (c *InstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -41048,8 +40745,7 @@ func (c *InstantSnapshotsSetLabelsCall) Header() http.Header { func (c *InstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -41158,8 +40854,7 @@ func (c *InstantSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *InstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -41373,12 +41068,11 @@ func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41511,12 +41205,11 @@ func (c *InterconnectAttachmentsDeleteCall) Header() http.Header { func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41626,12 +41319,11 @@ func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41752,8 +41444,7 @@ func (c *InterconnectAttachmentsInsertCall) Header() http.Header { func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachment) if err != nil { return nil, err } @@ -41946,12 +41637,11 @@ func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42089,8 +41779,7 @@ func (c *InterconnectAttachmentsPatchCall) Header() http.Header { func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachment) if err != nil { return nil, err } @@ -42214,8 +41903,7 @@ func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header { func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -42324,8 +42012,7 @@ func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -42442,12 +42129,11 @@ func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations/{interconnectLocation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42630,12 +42316,11 @@ func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42765,12 +42450,11 @@ func (c *InterconnectRemoteLocationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42953,12 +42637,11 @@ func (c *InterconnectRemoteLocationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43088,12 +42771,11 @@ func (c *InterconnectsDeleteCall) Header() http.Header { func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43200,12 +42882,11 @@ func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43315,12 +42996,11 @@ func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getDiagnostics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43428,12 +43108,11 @@ func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43543,8 +43222,7 @@ func (c *InterconnectsInsertCall) Header() http.Header { func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnect) if err != nil { return nil, err } @@ -43733,12 +43411,11 @@ func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43872,8 +43549,7 @@ func (c *InterconnectsPatchCall) Header() http.Header { func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnect2) if err != nil { return nil, err } @@ -43978,8 +43654,7 @@ func (c *InterconnectsSetLabelsCall) Header() http.Header { func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -44084,8 +43759,7 @@ func (c *InterconnectsTestIamPermissionsCall) Header() http.Header { func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -44203,12 +43877,11 @@ func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{licenseCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44306,8 +43979,7 @@ func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header { func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -44427,12 +44099,11 @@ func (c *LicensesDeleteCall) Header() http.Header { func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44540,12 +44211,11 @@ func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44660,12 +44330,11 @@ func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44775,8 +44444,7 @@ func (c *LicensesInsertCall) Header() http.Header { func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.license) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.license) if err != nil { return nil, err } @@ -44970,12 +44638,11 @@ func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45094,8 +44761,7 @@ func (c *LicensesSetIamPolicyCall) Header() http.Header { func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -45201,8 +44867,7 @@ func (c *LicensesTestIamPermissionsCall) Header() http.Header { func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -45321,12 +44986,11 @@ func (c *MachineImagesDeleteCall) Header() http.Header { func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45432,12 +45096,11 @@ func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45551,12 +45214,11 @@ func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45674,8 +45336,7 @@ func (c *MachineImagesInsertCall) Header() http.Header { func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.machineimage) if err != nil { return nil, err } @@ -45864,12 +45525,11 @@ func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45987,8 +45647,7 @@ func (c *MachineImagesSetIamPolicyCall) Header() http.Header { func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -46093,8 +45752,7 @@ func (c *MachineImagesTestIamPermissionsCall) Header() http.Header { func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -46307,12 +45965,11 @@ func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/machineTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46442,12 +46099,11 @@ func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes/{machineType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46632,12 +46288,11 @@ func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46864,12 +46519,11 @@ func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47003,12 +46657,11 @@ func (c *NetworkAttachmentsDeleteCall) Header() http.Header { func (c *NetworkAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47118,12 +46771,11 @@ func (c *NetworkAttachmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47242,12 +46894,11 @@ func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47361,8 +47012,7 @@ func (c *NetworkAttachmentsInsertCall) Header() http.Header { func (c *NetworkAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkattachment) if err != nil { return nil, err } @@ -47554,12 +47204,11 @@ func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47698,8 +47347,7 @@ func (c *NetworkAttachmentsPatchCall) Header() http.Header { func (c *NetworkAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkattachment) if err != nil { return nil, err } @@ -47808,8 +47456,7 @@ func (c *NetworkAttachmentsSetIamPolicyCall) Header() http.Header { func (c *NetworkAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -47918,8 +47565,7 @@ func (c *NetworkAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *NetworkAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -48133,12 +47779,11 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEdgeSecurityServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48272,12 +47917,11 @@ func (c *NetworkEdgeSecurityServicesDeleteCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48388,12 +48032,11 @@ func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48514,8 +48157,7 @@ func (c *NetworkEdgeSecurityServicesInsertCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkedgesecurityservice) if err != nil { return nil, err } @@ -48651,8 +48293,7 @@ func (c *NetworkEdgeSecurityServicesPatchCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkedgesecurityservice) if err != nil { return nil, err } @@ -48865,12 +48506,11 @@ func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49008,8 +48648,7 @@ func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -49135,12 +48774,11 @@ func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49258,8 +48896,7 @@ func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -49379,12 +49016,11 @@ func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49499,8 +49135,7 @@ func (c *NetworkEndpointGroupsInsertCall) Header() http.Header { func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -49694,12 +49329,11 @@ func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49902,8 +49536,7 @@ func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupslistendpointsrequest) if err != nil { return nil, err } @@ -50034,8 +49667,7 @@ func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header { func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -50165,8 +49797,7 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -50302,8 +49933,7 @@ func (c *NetworkFirewallPoliciesAddPacketMirroringRuleCall) Header() http.Header func (c *NetworkFirewallPoliciesAddPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -50438,8 +50068,7 @@ func (c *NetworkFirewallPoliciesAddRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -50563,12 +50192,11 @@ func (c *NetworkFirewallPoliciesCloneRulesCall) Header() http.Header { func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -50677,12 +50305,11 @@ func (c *NetworkFirewallPoliciesDeleteCall) Header() http.Header { func (c *NetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50788,12 +50415,11 @@ func (c *NetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50907,12 +50533,11 @@ func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51027,12 +50652,11 @@ func (c *NetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51147,12 +50771,11 @@ func (c *NetworkFirewallPoliciesGetPacketMirroringRuleCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getPacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51267,12 +50890,11 @@ func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51382,8 +51004,7 @@ func (c *NetworkFirewallPoliciesInsertCall) Header() http.Header { func (c *NetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -51572,12 +51193,11 @@ func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51709,8 +51329,7 @@ func (c *NetworkFirewallPoliciesPatchCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -51837,8 +51456,7 @@ func (c *NetworkFirewallPoliciesPatchPacketMirroringRuleCall) Header() http.Head func (c *NetworkFirewallPoliciesPatchPacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -51964,8 +51582,7 @@ func (c *NetworkFirewallPoliciesPatchRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -52089,12 +51706,11 @@ func (c *NetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -52211,12 +51827,11 @@ func (c *NetworkFirewallPoliciesRemovePacketMirroringRuleCall) Header() http.Hea func (c *NetworkFirewallPoliciesRemovePacketMirroringRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removePacketMirroringRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -52332,12 +51947,11 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -52434,8 +52048,7 @@ func (c *NetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *NetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -52540,8 +52153,7 @@ func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header { func (c *NetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -52656,12 +52268,11 @@ func (c *NetworkProfilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles/{networkProfile}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52843,12 +52454,11 @@ func (c *NetworkProfilesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52980,8 +52590,7 @@ func (c *NetworksAddPeeringCall) Header() http.Header { func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksaddpeeringrequest) if err != nil { return nil, err } @@ -53098,12 +52707,11 @@ func (c *NetworksDeleteCall) Header() http.Header { func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -53209,12 +52817,11 @@ func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53320,12 +52927,11 @@ func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53435,8 +53041,7 @@ func (c *NetworksInsertCall) Header() http.Header { func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network) if err != nil { return nil, err } @@ -53624,12 +53229,11 @@ func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53861,12 +53465,11 @@ func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listPeeringRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54000,8 +53603,7 @@ func (c *NetworksPatchCall) Header() http.Header { func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network2) if err != nil { return nil, err } @@ -54120,8 +53722,7 @@ func (c *NetworksRemovePeeringCall) Header() http.Header { func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksremovepeeringrequest) if err != nil { return nil, err } @@ -54239,12 +53840,11 @@ func (c *NetworksSwitchToCustomModeCall) Header() http.Header { func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/switchToCustomMode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -54341,8 +53941,7 @@ func (c *NetworksTestIamPermissionsCall) Header() http.Header { func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -54465,8 +54064,7 @@ func (c *NetworksUpdatePeeringCall) Header() http.Header { func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksupdatepeeringrequest) if err != nil { return nil, err } @@ -54588,8 +54186,7 @@ func (c *NodeGroupsAddNodesCall) Header() http.Header { func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsaddnodesrequest) if err != nil { return nil, err } @@ -54803,12 +54400,11 @@ func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54941,12 +54537,11 @@ func (c *NodeGroupsDeleteCall) Header() http.Header { func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55061,8 +54656,7 @@ func (c *NodeGroupsDeleteNodesCall) Header() http.Header { func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsdeletenodesrequest) if err != nil { return nil, err } @@ -55182,12 +54776,11 @@ func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55305,12 +54898,11 @@ func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55425,8 +55017,7 @@ func (c *NodeGroupsInsertCall) Header() http.Header { func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -55619,12 +55210,11 @@ func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55820,12 +55410,11 @@ func (c *NodeGroupsListNodesCall) Header() http.Header { func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -55962,8 +55551,7 @@ func (c *NodeGroupsPatchCall) Header() http.Header { func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -56087,8 +55675,7 @@ func (c *NodeGroupsPerformMaintenanceCall) Header() http.Header { func (c *NodeGroupsPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsperformmaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsperformmaintenancerequest) if err != nil { return nil, err } @@ -56197,8 +55784,7 @@ func (c *NodeGroupsSetIamPolicyCall) Header() http.Header { func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -56321,8 +55907,7 @@ func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header { func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupssetnodetemplaterequest) if err != nil { return nil, err } @@ -56447,8 +56032,7 @@ func (c *NodeGroupsSimulateMaintenanceEventCall) Header() http.Header { func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssimulatemaintenanceeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupssimulatemaintenanceeventrequest) if err != nil { return nil, err } @@ -56557,8 +56141,7 @@ func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header { func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -56772,12 +56355,11 @@ func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56910,12 +56492,11 @@ func (c *NodeTemplatesDeleteCall) Header() http.Header { func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -57025,12 +56606,11 @@ func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57148,12 +56728,11 @@ func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57266,8 +56845,7 @@ func (c *NodeTemplatesInsertCall) Header() http.Header { func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodetemplate) if err != nil { return nil, err } @@ -57459,12 +57037,11 @@ func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57586,8 +57163,7 @@ func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header { func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -57696,8 +57272,7 @@ func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header { func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -57911,12 +57486,11 @@ func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58046,12 +57620,11 @@ func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes/{nodeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58236,12 +57809,11 @@ func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58379,8 +57951,7 @@ func (c *OrganizationSecurityPoliciesAddAssociationCall) Header() http.Header { func (c *OrganizationSecurityPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyassociation) if err != nil { return nil, err } @@ -58495,8 +58066,7 @@ func (c *OrganizationSecurityPoliciesAddRuleCall) Header() http.Header { func (c *OrganizationSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -58616,12 +58186,11 @@ func (c *OrganizationSecurityPoliciesCopyRulesCall) Header() http.Header { func (c *OrganizationSecurityPoliciesCopyRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/copyRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -58726,12 +58295,11 @@ func (c *OrganizationSecurityPoliciesDeleteCall) Header() http.Header { func (c *OrganizationSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -58833,12 +58401,11 @@ func (c *OrganizationSecurityPoliciesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58948,12 +58515,11 @@ func (c *OrganizationSecurityPoliciesGetAssociationCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59064,12 +58630,11 @@ func (c *OrganizationSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59182,8 +58747,7 @@ func (c *OrganizationSecurityPoliciesInsertCall) Header() http.Header { func (c *OrganizationSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -59371,12 +58935,11 @@ func (c *OrganizationSecurityPoliciesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59501,12 +59064,11 @@ func (c *OrganizationSecurityPoliciesListAssociationsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/listAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59687,12 +59249,11 @@ func (c *OrganizationSecurityPoliciesListPreconfiguredExpressionSetsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/listPreconfiguredExpressionSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -59802,12 +59363,11 @@ func (c *OrganizationSecurityPoliciesMoveCall) Header() http.Header { func (c *OrganizationSecurityPoliciesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -59914,8 +59474,7 @@ func (c *OrganizationSecurityPoliciesPatchCall) Header() http.Header { func (c *OrganizationSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -60037,8 +59596,7 @@ func (c *OrganizationSecurityPoliciesPatchRuleCall) Header() http.Header { func (c *OrganizationSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -60158,12 +59716,11 @@ func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Header() http.Header func (c *OrganizationSecurityPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -60275,12 +59832,11 @@ func (c *OrganizationSecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *OrganizationSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -60483,12 +60039,11 @@ func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60621,12 +60176,11 @@ func (c *PacketMirroringsDeleteCall) Header() http.Header { func (c *PacketMirroringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -60736,12 +60290,11 @@ func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -60855,8 +60408,7 @@ func (c *PacketMirroringsInsertCall) Header() http.Header { func (c *PacketMirroringsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.packetmirroring) if err != nil { return nil, err } @@ -61049,12 +60601,11 @@ func (c *PacketMirroringsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61192,8 +60743,7 @@ func (c *PacketMirroringsPatchCall) Header() http.Header { func (c *PacketMirroringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.packetmirroring) if err != nil { return nil, err } @@ -61302,8 +60852,7 @@ func (c *PacketMirroringsTestIamPermissionsCall) Header() http.Header { func (c *PacketMirroringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -61419,12 +60968,11 @@ func (c *ProjectsDisableXpnHostCall) Header() http.Header { func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -61532,8 +61080,7 @@ func (c *ProjectsDisableXpnResourceCall) Header() http.Header { func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsdisablexpnresourcerequest) if err != nil { return nil, err } @@ -61646,12 +61193,11 @@ func (c *ProjectsEnableXpnHostCall) Header() http.Header { func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -61760,8 +61306,7 @@ func (c *ProjectsEnableXpnResourceCall) Header() http.Header { func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsenablexpnresourcerequest) if err != nil { return nil, err } @@ -61877,12 +61422,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -61985,12 +61529,11 @@ func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62171,12 +61714,11 @@ func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -62369,8 +61911,7 @@ func (c *ProjectsListXpnHostsCall) Header() http.Header { func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectslistxpnhostsrequest) if err != nil { return nil, err } @@ -62506,8 +62047,7 @@ func (c *ProjectsMoveDiskCall) Header() http.Header { func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diskmoverequest) if err != nil { return nil, err } @@ -62628,8 +62168,7 @@ func (c *ProjectsMoveInstanceCall) Header() http.Header { func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancemoverequest) if err != nil { return nil, err } @@ -62747,8 +62286,7 @@ func (c *ProjectsSetCloudArmorTierCall) Header() http.Header { func (c *ProjectsSetCloudArmorTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetcloudarmortierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetcloudarmortierrequest) if err != nil { return nil, err } @@ -62864,8 +62402,7 @@ func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header { func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadata) if err != nil { return nil, err } @@ -62982,8 +62519,7 @@ func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header { func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetdefaultnetworktierrequest) if err != nil { return nil, err } @@ -63101,8 +62637,7 @@ func (c *ProjectsSetManagedProtectionTierCall) Header() http.Header { func (c *ProjectsSetManagedProtectionTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetmanagedprotectiontierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetmanagedprotectiontierrequest) if err != nil { return nil, err } @@ -63219,8 +62754,7 @@ func (c *ProjectsSetUsageExportBucketCall) Header() http.Header { func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.usageexportlocation) if err != nil { return nil, err } @@ -63337,12 +62871,11 @@ func (c *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header { func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -63452,12 +62985,11 @@ func (c *PublicAdvertisedPrefixesDeleteCall) Header() http.Header { func (c *PublicAdvertisedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -63564,12 +63096,11 @@ func (c *PublicAdvertisedPrefixesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -63679,8 +63210,7 @@ func (c *PublicAdvertisedPrefixesInsertCall) Header() http.Header { func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicadvertisedprefix) if err != nil { return nil, err } @@ -63868,12 +63398,11 @@ func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64008,8 +63537,7 @@ func (c *PublicAdvertisedPrefixesPatchCall) Header() http.Header { func (c *PublicAdvertisedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicadvertisedprefix) if err != nil { return nil, err } @@ -64127,12 +63655,11 @@ func (c *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header { func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64336,12 +63863,11 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64476,12 +64002,11 @@ func (c *PublicDelegatedPrefixesAnnounceCall) Header() http.Header { func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -64595,12 +64120,11 @@ func (c *PublicDelegatedPrefixesDeleteCall) Header() http.Header { func (c *PublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -64712,12 +64236,11 @@ func (c *PublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -64831,8 +64354,7 @@ func (c *PublicDelegatedPrefixesInsertCall) Header() http.Header { func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -65024,12 +64546,11 @@ func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65168,8 +64689,7 @@ func (c *PublicDelegatedPrefixesPatchCall) Header() http.Header { func (c *PublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -65292,12 +64812,11 @@ func (c *PublicDelegatedPrefixesWithdrawCall) Header() http.Header { func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -65410,12 +64929,11 @@ func (c *RegionAutoscalersDeleteCall) Header() http.Header { func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -65525,12 +65043,11 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65643,8 +65160,7 @@ func (c *RegionAutoscalersInsertCall) Header() http.Header { func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -65836,12 +65352,11 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -65983,8 +65498,7 @@ func (c *RegionAutoscalersPatchCall) Header() http.Header { func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -66092,8 +65606,7 @@ func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header { func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -66222,8 +65735,7 @@ func (c *RegionAutoscalersUpdateCall) Header() http.Header { func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } diff --git a/compute/v0.beta/compute3-gen.go b/compute/v0.beta/compute3-gen.go index 1de0a863fc9..83c11990193 100644 --- a/compute/v0.beta/compute3-gen.go +++ b/compute/v0.beta/compute3-gen.go @@ -9,7 +9,6 @@ package compute import ( "context" "fmt" - "io" "net/http" googleapi "google.golang.org/api/googleapi" @@ -79,12 +78,11 @@ func (c *RegionBackendServicesDeleteCall) Header() http.Header { func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -194,12 +192,11 @@ func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -301,8 +298,7 @@ func (c *RegionBackendServicesGetHealthCall) Header() http.Header { func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcegroupreference) if err != nil { return nil, err } @@ -429,12 +425,11 @@ func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -548,8 +543,7 @@ func (c *RegionBackendServicesInsertCall) Header() http.Header { func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -742,12 +736,11 @@ func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -955,12 +948,11 @@ func (c *RegionBackendServicesListUsableCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1099,8 +1091,7 @@ func (c *RegionBackendServicesPatchCall) Header() http.Header { func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -1209,8 +1200,7 @@ func (c *RegionBackendServicesSetIamPolicyCall) Header() http.Header { func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -1336,8 +1326,7 @@ func (c *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header { func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -1446,8 +1435,7 @@ func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header { func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -1573,8 +1561,7 @@ func (c *RegionBackendServicesUpdateCall) Header() http.Header { func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -1787,12 +1774,11 @@ func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1922,12 +1908,11 @@ func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2040,8 +2025,7 @@ func (c *RegionCommitmentsInsertCall) Header() http.Header { func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitment) if err != nil { return nil, err } @@ -2233,12 +2217,11 @@ func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2359,8 +2342,7 @@ func (c *RegionCommitmentsTestIamPermissionsCall) Header() http.Header { func (c *RegionCommitmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -2499,8 +2481,7 @@ func (c *RegionCommitmentsUpdateCall) Header() http.Header { func (c *RegionCommitmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitment2) if err != nil { return nil, err } @@ -2625,8 +2606,7 @@ func (c *RegionCommitmentsUpdateReservationsCall) Header() http.Header { func (c *RegionCommitmentsUpdateReservationsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioncommitmentsupdatereservationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioncommitmentsupdatereservationsrequest) if err != nil { return nil, err } @@ -2744,12 +2724,11 @@ func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2935,12 +2914,11 @@ func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3078,8 +3056,7 @@ func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header { func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -3199,8 +3176,7 @@ func (c *RegionDisksBulkInsertCall) Header() http.Header { func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertdiskresource) if err != nil { return nil, err } @@ -3325,8 +3301,7 @@ func (c *RegionDisksCreateSnapshotCall) Header() http.Header { func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -3450,12 +3425,11 @@ func (c *RegionDisksDeleteCall) Header() http.Header { func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3565,12 +3539,11 @@ func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3688,12 +3661,11 @@ func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3813,8 +3785,7 @@ func (c *RegionDisksInsertCall) Header() http.Header { func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk) if err != nil { return nil, err } @@ -4007,12 +3978,11 @@ func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4147,8 +4117,7 @@ func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header { func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -4271,8 +4240,7 @@ func (c *RegionDisksResizeCall) Header() http.Header { func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksresizerequest) if err != nil { return nil, err } @@ -4381,8 +4349,7 @@ func (c *RegionDisksSetIamPolicyCall) Header() http.Header { func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -4505,8 +4472,7 @@ func (c *RegionDisksSetLabelsCall) Header() http.Header { func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -4630,8 +4596,7 @@ func (c *RegionDisksStartAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksstartasyncreplicationrequest) if err != nil { return nil, err } @@ -4753,12 +4718,11 @@ func (c *RegionDisksStopAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4872,8 +4836,7 @@ func (c *RegionDisksStopGroupAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstopgroupasyncreplicationresource) if err != nil { return nil, err } @@ -4981,8 +4944,7 @@ func (c *RegionDisksTestIamPermissionsCall) Header() http.Header { func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -5121,8 +5083,7 @@ func (c *RegionDisksUpdateCall) Header() http.Header { func (c *RegionDisksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk2) if err != nil { return nil, err } @@ -5244,12 +5205,11 @@ func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header { func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5360,12 +5320,11 @@ func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5479,8 +5438,7 @@ func (c *RegionHealthCheckServicesInsertCall) Header() http.Header { func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheckservice) if err != nil { return nil, err } @@ -5673,12 +5631,11 @@ func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5817,8 +5774,7 @@ func (c *RegionHealthCheckServicesPatchCall) Header() http.Header { func (c *RegionHealthCheckServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheckservice) if err != nil { return nil, err } @@ -5927,8 +5883,7 @@ func (c *RegionHealthCheckServicesTestIamPermissionsCall) Header() http.Header { func (c *RegionHealthCheckServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -6050,12 +6005,11 @@ func (c *RegionHealthChecksDeleteCall) Header() http.Header { func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6165,12 +6119,11 @@ func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6283,8 +6236,7 @@ func (c *RegionHealthChecksInsertCall) Header() http.Header { func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -6477,12 +6429,11 @@ func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6620,8 +6571,7 @@ func (c *RegionHealthChecksPatchCall) Header() http.Header { func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -6730,8 +6680,7 @@ func (c *RegionHealthChecksTestIamPermissionsCall) Header() http.Header { func (c *RegionHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -6856,8 +6805,7 @@ func (c *RegionHealthChecksUpdateCall) Header() http.Header { func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -6986,12 +6934,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsCancelCall) Header() http.Heade func (c *RegionInstanceGroupManagerResizeRequestsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7113,12 +7060,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsDeleteCall) Header() http.Heade func (c *RegionInstanceGroupManagerResizeRequestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7235,12 +7181,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7361,8 +7306,7 @@ func (c *RegionInstanceGroupManagerResizeRequestsInsertCall) Header() http.Heade func (c *RegionInstanceGroupManagerResizeRequestsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerresizerequest) if err != nil { return nil, err } @@ -7561,12 +7505,11 @@ func (c *RegionInstanceGroupManagerResizeRequestsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7714,8 +7657,7 @@ func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } @@ -7826,8 +7768,7 @@ func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.H func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersapplyupdatesrequest) if err != nil { return nil, err } @@ -7956,8 +7897,7 @@ func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } @@ -8079,12 +8019,11 @@ func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header { func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8209,8 +8148,7 @@ func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersdeleteinstancesrequest) if err != nil { return nil, err } @@ -8321,8 +8259,7 @@ func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerdeleteinstanceconfigreq) if err != nil { return nil, err } @@ -8440,12 +8377,11 @@ func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8564,8 +8500,7 @@ func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header { func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -8758,12 +8693,11 @@ func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8978,12 +8912,11 @@ func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9186,12 +9119,11 @@ func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Head func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9393,12 +9325,11 @@ func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.He func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9544,8 +9475,7 @@ func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header { func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -9672,8 +9602,7 @@ func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.H func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerpatchinstanceconfigreq) if err != nil { return nil, err } @@ -9805,8 +9734,7 @@ func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersrecreaterequest) if err != nil { return nil, err } @@ -9939,12 +9867,11 @@ func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header { func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10071,8 +9998,7 @@ func (c *RegionInstanceGroupManagersResizeAdvancedCall) Header() http.Header { func (c *RegionInstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersresizeadvancedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersresizeadvancedrequest) if err != nil { return nil, err } @@ -10207,8 +10133,7 @@ func (c *RegionInstanceGroupManagersResumeInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersresumeinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } @@ -10333,8 +10258,7 @@ func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.He func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssetautohealingrequest) if err != nil { return nil, err } @@ -10459,8 +10383,7 @@ func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Heade func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssettemplaterequest) if err != nil { return nil, err } @@ -10584,8 +10507,7 @@ func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header { func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } @@ -10719,8 +10641,7 @@ func (c *RegionInstanceGroupManagersStartInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstartinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } @@ -10860,8 +10781,7 @@ func (c *RegionInstanceGroupManagersStopInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstopinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } @@ -11002,8 +10922,7 @@ func (c *RegionInstanceGroupManagersSuspendInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssuspendinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } @@ -11112,8 +11031,7 @@ func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -11245,8 +11163,7 @@ func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header { func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -11373,8 +11290,7 @@ func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerupdateinstanceconfigreq) if err != nil { return nil, err } @@ -11492,12 +11408,11 @@ func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11683,12 +11598,11 @@ func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11891,8 +11805,7 @@ func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header { func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupslistinstancesrequest) if err != nil { return nil, err } @@ -12039,8 +11952,7 @@ func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header { func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupssetnamedportsrequest) if err != nil { return nil, err } @@ -12149,8 +12061,7 @@ func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header { func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -12273,12 +12184,11 @@ func (c *RegionInstanceTemplatesDeleteCall) Header() http.Header { func (c *RegionInstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12402,12 +12312,11 @@ func (c *RegionInstanceTemplatesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12521,8 +12430,7 @@ func (c *RegionInstanceTemplatesInsertCall) Header() http.Header { func (c *RegionInstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancetemplate) if err != nil { return nil, err } @@ -12729,12 +12637,11 @@ func (c *RegionInstanceTemplatesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12868,8 +12775,7 @@ func (c *RegionInstancesBulkInsertCall) Header() http.Header { func (c *RegionInstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertinstanceresource) if err != nil { return nil, err } @@ -12994,12 +12900,11 @@ func (c *RegionInstantSnapshotsDeleteCall) Header() http.Header { func (c *RegionInstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13109,12 +13014,11 @@ func (c *RegionInstantSnapshotsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13233,12 +13137,11 @@ func (c *RegionInstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13350,8 +13253,7 @@ func (c *RegionInstantSnapshotsInsertCall) Header() http.Header { func (c *RegionInstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshot) if err != nil { return nil, err } @@ -13544,12 +13446,11 @@ func (c *RegionInstantSnapshotsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13671,8 +13572,7 @@ func (c *RegionInstantSnapshotsSetIamPolicyCall) Header() http.Header { func (c *RegionInstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -13796,8 +13696,7 @@ func (c *RegionInstantSnapshotsSetLabelsCall) Header() http.Header { func (c *RegionInstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -13906,8 +13805,7 @@ func (c *RegionInstantSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *RegionInstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -14029,12 +13927,11 @@ func (c *RegionMultiMigsDeleteCall) Header() http.Header { func (c *RegionMultiMigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs/{multiMig}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14144,12 +14041,11 @@ func (c *RegionMultiMigsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs/{multiMig}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14261,8 +14157,7 @@ func (c *RegionMultiMigsInsertCall) Header() http.Header { func (c *RegionMultiMigsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.multimig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.multimig) if err != nil { return nil, err } @@ -14454,12 +14349,11 @@ func (c *RegionMultiMigsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14597,8 +14491,7 @@ func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.He func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionnetworkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -14722,12 +14615,11 @@ func (c *RegionNetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *RegionNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14846,8 +14738,7 @@ func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.He func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionnetworkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -14967,12 +14858,11 @@ func (c *RegionNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15087,8 +14977,7 @@ func (c *RegionNetworkEndpointGroupsInsertCall) Header() http.Header { func (c *RegionNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -15282,12 +15171,11 @@ func (c *RegionNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15488,12 +15376,11 @@ func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Head func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -15640,8 +15527,7 @@ func (c *RegionNetworkFirewallPoliciesAddAssociationCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -15780,8 +15666,7 @@ func (c *RegionNetworkFirewallPoliciesAddRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -15909,12 +15794,11 @@ func (c *RegionNetworkFirewallPoliciesCloneRulesCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -16027,12 +15911,11 @@ func (c *RegionNetworkFirewallPoliciesDeleteCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16142,12 +16025,11 @@ func (c *RegionNetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16265,12 +16147,11 @@ func (c *RegionNetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16380,12 +16261,11 @@ func (c *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16503,12 +16383,11 @@ func (c *RegionNetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16626,12 +16505,11 @@ func (c *RegionNetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16745,8 +16623,7 @@ func (c *RegionNetworkFirewallPoliciesInsertCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -16939,12 +16816,11 @@ func (c *RegionNetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17080,8 +16956,7 @@ func (c *RegionNetworkFirewallPoliciesPatchCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -17211,8 +17086,7 @@ func (c *RegionNetworkFirewallPoliciesPatchRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -17341,12 +17215,11 @@ func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) Header() http.Heade func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17466,12 +17339,11 @@ func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17572,8 +17444,7 @@ func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -17682,8 +17553,7 @@ func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Head func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -17805,12 +17675,11 @@ func (c *RegionNotificationEndpointsDeleteCall) Header() http.Header { func (c *RegionNotificationEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17921,12 +17790,11 @@ func (c *RegionNotificationEndpointsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18040,8 +17908,7 @@ func (c *RegionNotificationEndpointsInsertCall) Header() http.Header { func (c *RegionNotificationEndpointsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationendpoint) if err != nil { return nil, err } @@ -18233,12 +18100,11 @@ func (c *RegionNotificationEndpointsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18360,8 +18226,7 @@ func (c *RegionNotificationEndpointsTestIamPermissionsCall) Header() http.Header func (c *RegionNotificationEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -18469,12 +18334,11 @@ func (c *RegionOperationsDeleteCall) Header() http.Header { func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18562,12 +18426,11 @@ func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18753,12 +18616,11 @@ func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18887,12 +18749,11 @@ func (c *RegionOperationsWaitCall) Header() http.Header { func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -18999,8 +18860,7 @@ func (c *RegionSecurityPoliciesAddRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -19121,12 +18981,11 @@ func (c *RegionSecurityPoliciesDeleteCall) Header() http.Header { func (c *RegionSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19236,12 +19095,11 @@ func (c *RegionSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19359,12 +19217,11 @@ func (c *RegionSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19485,8 +19342,7 @@ func (c *RegionSecurityPoliciesInsertCall) Header() http.Header { func (c *RegionSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -19679,12 +19535,11 @@ func (c *RegionSecurityPoliciesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19831,8 +19686,7 @@ func (c *RegionSecurityPoliciesPatchCall) Header() http.Header { func (c *RegionSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -19962,8 +19816,7 @@ func (c *RegionSecurityPoliciesPatchRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -20076,12 +19929,11 @@ func (c *RegionSecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20197,8 +20049,7 @@ func (c *RegionSecurityPoliciesSetLabelsCall) Header() http.Header { func (c *RegionSecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -20319,12 +20170,11 @@ func (c *RegionSslCertificatesDeleteCall) Header() http.Header { func (c *RegionSslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20435,12 +20285,11 @@ func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20553,8 +20402,7 @@ func (c *RegionSslCertificatesInsertCall) Header() http.Header { func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertificate) if err != nil { return nil, err } @@ -20747,12 +20595,11 @@ func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20874,8 +20721,7 @@ func (c *RegionSslCertificatesTestIamPermissionsCall) Header() http.Header { func (c *RegionSslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -21000,12 +20846,11 @@ func (c *RegionSslPoliciesDeleteCall) Header() http.Header { func (c *RegionSslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21116,12 +20961,11 @@ func (c *RegionSslPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21234,8 +21078,7 @@ func (c *RegionSslPoliciesInsertCall) Header() http.Header { func (c *RegionSslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -21428,12 +21271,11 @@ func (c *RegionSslPoliciesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21640,12 +21482,11 @@ func (c *RegionSslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21762,8 +21603,7 @@ func (c *RegionSslPoliciesPatchCall) Header() http.Header { func (c *RegionSslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -21872,8 +21712,7 @@ func (c *RegionSslPoliciesTestIamPermissionsCall) Header() http.Header { func (c *RegionSslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -21995,12 +21834,11 @@ func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header { func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22110,12 +21948,11 @@ func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22229,8 +22066,7 @@ func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header { func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -22423,12 +22259,11 @@ func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22564,8 +22399,7 @@ func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header { func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -22674,8 +22508,7 @@ func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Header() http.Header { func (c *RegionTargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -22797,12 +22630,11 @@ func (c *RegionTargetHttpsProxiesDeleteCall) Header() http.Header { func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22913,12 +22745,11 @@ func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23032,8 +22863,7 @@ func (c *RegionTargetHttpsProxiesInsertCall) Header() http.Header { func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -23226,12 +23056,11 @@ func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23369,8 +23198,7 @@ func (c *RegionTargetHttpsProxiesPatchCall) Header() http.Header { func (c *RegionTargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -23494,8 +23322,7 @@ func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header { func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiontargethttpsproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -23618,8 +23445,7 @@ func (c *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header { func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -23728,8 +23554,7 @@ func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Header() http.Header { func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -23851,12 +23676,11 @@ func (c *RegionTargetTcpProxiesDeleteCall) Header() http.Header { func (c *RegionTargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23966,12 +23790,11 @@ func (c *RegionTargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24084,8 +23907,7 @@ func (c *RegionTargetTcpProxiesInsertCall) Header() http.Header { func (c *RegionTargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxy) if err != nil { return nil, err } @@ -24278,12 +24100,11 @@ func (c *RegionTargetTcpProxiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24405,8 +24226,7 @@ func (c *RegionTargetTcpProxiesTestIamPermissionsCall) Header() http.Header { func (c *RegionTargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -24520,12 +24340,11 @@ func (c *RegionUrlMapsDeleteCall) Header() http.Header { func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24635,12 +24454,11 @@ func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24745,8 +24563,7 @@ func (c *RegionUrlMapsInsertCall) Header() http.Header { func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -24862,8 +24679,7 @@ func (c *RegionUrlMapsInvalidateCacheCall) Header() http.Header { func (c *RegionUrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cacheinvalidationrule) if err != nil { return nil, err } @@ -25057,12 +24873,11 @@ func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25191,8 +25006,7 @@ func (c *RegionUrlMapsPatchCall) Header() http.Header { func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -25301,8 +25115,7 @@ func (c *RegionUrlMapsTestIamPermissionsCall) Header() http.Header { func (c *RegionUrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -25419,8 +25232,7 @@ func (c *RegionUrlMapsUpdateCall) Header() http.Header { func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -25530,8 +25342,7 @@ func (c *RegionUrlMapsValidateCall) Header() http.Header { func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionurlmapsvalidaterequest) if err != nil { return nil, err } @@ -25726,12 +25537,11 @@ func (c *RegionZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25870,12 +25680,11 @@ func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26069,12 +25878,11 @@ func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26209,12 +26017,11 @@ func (c *ReservationBlocksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks/{reservationBlock}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26406,12 +26213,11 @@ func (c *ReservationBlocksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26638,12 +26444,11 @@ func (c *ReservationsAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26776,12 +26581,11 @@ func (c *ReservationsDeleteCall) Header() http.Header { func (c *ReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26891,12 +26695,11 @@ func (c *ReservationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27014,12 +26817,11 @@ func (c *ReservationsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27132,8 +26934,7 @@ func (c *ReservationsInsertCall) Header() http.Header { func (c *ReservationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -27326,12 +27127,11 @@ func (c *ReservationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27468,8 +27268,7 @@ func (c *ReservationsResizeCall) Header() http.Header { func (c *ReservationsResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservationsresizerequest) if err != nil { return nil, err } @@ -27578,8 +27377,7 @@ func (c *ReservationsSetIamPolicyCall) Header() http.Header { func (c *ReservationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -27688,8 +27486,7 @@ func (c *ReservationsTestIamPermissionsCall) Header() http.Header { func (c *ReservationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -27826,8 +27623,7 @@ func (c *ReservationsUpdateCall) Header() http.Header { func (c *ReservationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation2) if err != nil { return nil, err } @@ -28040,12 +27836,11 @@ func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28178,12 +27973,11 @@ func (c *ResourcePoliciesDeleteCall) Header() http.Header { func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28293,12 +28087,11 @@ func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28416,12 +28209,11 @@ func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28533,8 +28325,7 @@ func (c *ResourcePoliciesInsertCall) Header() http.Header { func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcepolicy) if err != nil { return nil, err } @@ -28727,12 +28518,11 @@ func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28875,8 +28665,7 @@ func (c *ResourcePoliciesPatchCall) Header() http.Header { func (c *ResourcePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcepolicy) if err != nil { return nil, err } @@ -28985,8 +28774,7 @@ func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header { func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -29095,8 +28883,7 @@ func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header { func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -29310,12 +29097,11 @@ func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/routers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29448,12 +29234,11 @@ func (c *RoutersDeleteCall) Header() http.Header { func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29573,12 +29358,11 @@ func (c *RoutersDeleteRoutePolicyCall) Header() http.Header { func (c *RoutersDeleteRoutePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/deleteRoutePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -29688,12 +29472,11 @@ func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29812,12 +29595,11 @@ func (c *RoutersGetNatIpInfoCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNatIpInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30016,12 +29798,11 @@ func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30161,12 +29942,11 @@ func (c *RoutersGetRoutePolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getRoutePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30277,12 +30057,11 @@ func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getRouterStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30396,8 +30175,7 @@ func (c *RoutersInsertCall) Header() http.Header { func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router) if err != nil { return nil, err } @@ -30590,12 +30368,11 @@ func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30852,12 +30629,11 @@ func (c *RoutersListBgpRoutesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/listBgpRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31069,12 +30845,11 @@ func (c *RoutersListRoutePoliciesCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/listRoutePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31213,8 +30988,7 @@ func (c *RoutersPatchCall) Header() http.Header { func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -31337,8 +31111,7 @@ func (c *RoutersPatchRoutePolicyCall) Header() http.Header { func (c *RoutersPatchRoutePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.routepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.routepolicy) if err != nil { return nil, err } @@ -31447,8 +31220,7 @@ func (c *RoutersPreviewCall) Header() http.Header { func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -31558,8 +31330,7 @@ func (c *RoutersTestIamPermissionsCall) Header() http.Header { func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -31686,8 +31457,7 @@ func (c *RoutersUpdateCall) Header() http.Header { func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -31810,8 +31580,7 @@ func (c *RoutersUpdateRoutePolicyCall) Header() http.Header { func (c *RoutersUpdateRoutePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.routepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.routepolicy) if err != nil { return nil, err } @@ -31929,12 +31698,11 @@ func (c *RoutesDeleteCall) Header() http.Header { func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32040,12 +31808,11 @@ func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32154,8 +31921,7 @@ func (c *RoutesInsertCall) Header() http.Header { func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.route) if err != nil { return nil, err } @@ -32344,12 +32110,11 @@ func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32466,8 +32231,7 @@ func (c *RoutesTestIamPermissionsCall) Header() http.Header { func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -32579,8 +32343,7 @@ func (c *SecurityPoliciesAddRuleCall) Header() http.Header { func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -32792,12 +32555,11 @@ func (c *SecurityPoliciesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32927,12 +32689,11 @@ func (c *SecurityPoliciesDeleteCall) Header() http.Header { func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33038,12 +32799,11 @@ func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33157,12 +32917,11 @@ func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33279,8 +33038,7 @@ func (c *SecurityPoliciesInsertCall) Header() http.Header { func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -33469,12 +33227,11 @@ func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33677,12 +33434,11 @@ func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33804,8 +33560,7 @@ func (c *SecurityPoliciesPatchCall) Header() http.Header { func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -33931,8 +33686,7 @@ func (c *SecurityPoliciesPatchRuleCall) Header() http.Header { func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -34041,12 +33795,11 @@ func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34143,8 +33896,7 @@ func (c *SecurityPoliciesSetLabelsCall) Header() http.Header { func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -34249,8 +34001,7 @@ func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header { func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -34464,12 +34215,11 @@ func (c *ServiceAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/serviceAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34602,12 +34352,11 @@ func (c *ServiceAttachmentsDeleteCall) Header() http.Header { func (c *ServiceAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34717,12 +34466,11 @@ func (c *ServiceAttachmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34841,12 +34589,11 @@ func (c *ServiceAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34959,8 +34706,7 @@ func (c *ServiceAttachmentsInsertCall) Header() http.Header { func (c *ServiceAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceattachment) if err != nil { return nil, err } @@ -35152,12 +34898,11 @@ func (c *ServiceAttachmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35297,8 +35042,7 @@ func (c *ServiceAttachmentsPatchCall) Header() http.Header { func (c *ServiceAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceattachment) if err != nil { return nil, err } @@ -35407,8 +35151,7 @@ func (c *ServiceAttachmentsSetIamPolicyCall) Header() http.Header { func (c *ServiceAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -35517,8 +35260,7 @@ func (c *ServiceAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *ServiceAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -35631,12 +35373,11 @@ func (c *SnapshotSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshotSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35751,8 +35492,7 @@ func (c *SnapshotSettingsPatchCall) Header() http.Header { func (c *SnapshotSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshotsettings) if err != nil { return nil, err } @@ -35872,12 +35612,11 @@ func (c *SnapshotsDeleteCall) Header() http.Header { func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35983,12 +35722,11 @@ func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36102,12 +35840,11 @@ func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36218,8 +35955,7 @@ func (c *SnapshotsInsertCall) Header() http.Header { func (c *SnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -36408,12 +36144,11 @@ func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36530,8 +36265,7 @@ func (c *SnapshotsSetIamPolicyCall) Header() http.Header { func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -36636,8 +36370,7 @@ func (c *SnapshotsSetLabelsCall) Header() http.Header { func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -36742,8 +36475,7 @@ func (c *SnapshotsTestIamPermissionsCall) Header() http.Header { func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -36956,12 +36688,11 @@ func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37091,12 +36822,11 @@ func (c *SslCertificatesDeleteCall) Header() http.Header { func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37202,12 +36932,11 @@ func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37316,8 +37045,7 @@ func (c *SslCertificatesInsertCall) Header() http.Header { func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertificate) if err != nil { return nil, err } @@ -37506,12 +37234,11 @@ func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37629,8 +37356,7 @@ func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header { func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -37843,12 +37569,11 @@ func (c *SslPoliciesAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37981,12 +37706,11 @@ func (c *SslPoliciesDeleteCall) Header() http.Header { func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38093,12 +37817,11 @@ func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38206,8 +37929,7 @@ func (c *SslPoliciesInsertCall) Header() http.Header { func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -38396,12 +38118,11 @@ func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38604,12 +38325,11 @@ func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/listAvailableFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38722,8 +38442,7 @@ func (c *SslPoliciesPatchCall) Header() http.Header { func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -38828,8 +38547,7 @@ func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header { func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -39042,12 +38760,11 @@ func (c *StoragePoolTypesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/storagePoolTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39177,12 +38894,11 @@ func (c *StoragePoolTypesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePoolTypes/{storagePoolType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39369,12 +39085,11 @@ func (c *StoragePoolTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePoolTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39600,12 +39315,11 @@ func (c *StoragePoolsAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/storagePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39741,12 +39455,11 @@ func (c *StoragePoolsDeleteCall) Header() http.Header { func (c *StoragePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39857,12 +39570,11 @@ func (c *StoragePoolsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39980,12 +39692,11 @@ func (c *StoragePoolsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40098,8 +39809,7 @@ func (c *StoragePoolsInsertCall) Header() http.Header { func (c *StoragePoolsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storagepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storagepool) if err != nil { return nil, err } @@ -40291,12 +40001,11 @@ func (c *StoragePoolsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40505,12 +40214,11 @@ func (c *StoragePoolsListDisksCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}/listDisks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40633,8 +40341,7 @@ func (c *StoragePoolsSetIamPolicyCall) Header() http.Header { func (c *StoragePoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -40743,8 +40450,7 @@ func (c *StoragePoolsTestIamPermissionsCall) Header() http.Header { func (c *StoragePoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -40879,8 +40585,7 @@ func (c *StoragePoolsUpdateCall) Header() http.Header { func (c *StoragePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storagepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storagepool) if err != nil { return nil, err } @@ -41093,12 +40798,11 @@ func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/subnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41231,12 +40935,11 @@ func (c *SubnetworksDeleteCall) Header() http.Header { func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41352,8 +41055,7 @@ func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header { func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetworksexpandipcidrrangerequest) if err != nil { return nil, err } @@ -41471,12 +41173,11 @@ func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41594,12 +41295,11 @@ func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41712,8 +41412,7 @@ func (c *SubnetworksInsertCall) Header() http.Header { func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetwork) if err != nil { return nil, err } @@ -41905,12 +41604,11 @@ func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42122,12 +41820,11 @@ func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/subnetworks/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42279,8 +41976,7 @@ func (c *SubnetworksPatchCall) Header() http.Header { func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetwork2) if err != nil { return nil, err } @@ -42389,8 +42085,7 @@ func (c *SubnetworksSetIamPolicyCall) Header() http.Header { func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -42515,8 +42210,7 @@ func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header { func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetworkssetprivateipgoogleaccessrequest) if err != nil { return nil, err } @@ -42625,8 +42319,7 @@ func (c *SubnetworksTestIamPermissionsCall) Header() http.Header { func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -42745,12 +42438,11 @@ func (c *TargetGrpcProxiesDeleteCall) Header() http.Header { func (c *TargetGrpcProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42856,12 +42548,11 @@ func (c *TargetGrpcProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42971,8 +42662,7 @@ func (c *TargetGrpcProxiesInsertCall) Header() http.Header { func (c *TargetGrpcProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetgrpcproxy) if err != nil { return nil, err } @@ -43160,12 +42850,11 @@ func (c *TargetGrpcProxiesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43299,8 +42988,7 @@ func (c *TargetGrpcProxiesPatchCall) Header() http.Header { func (c *TargetGrpcProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetgrpcproxy) if err != nil { return nil, err } @@ -43405,8 +43093,7 @@ func (c *TargetGrpcProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetGrpcProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -43620,12 +43307,11 @@ func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43755,12 +43441,11 @@ func (c *TargetHttpProxiesDeleteCall) Header() http.Header { func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43866,12 +43551,11 @@ func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43981,8 +43665,7 @@ func (c *TargetHttpProxiesInsertCall) Header() http.Header { func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -44171,12 +43854,11 @@ func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44310,8 +43992,7 @@ func (c *TargetHttpProxiesPatchCall) Header() http.Header { func (c *TargetHttpProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -44430,8 +44111,7 @@ func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header { func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -44536,8 +44216,7 @@ func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -44751,12 +44430,11 @@ func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44886,12 +44564,11 @@ func (c *TargetHttpsProxiesDeleteCall) Header() http.Header { func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44997,12 +44674,11 @@ func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45112,8 +44788,7 @@ func (c *TargetHttpsProxiesInsertCall) Header() http.Header { func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -45302,12 +44977,11 @@ func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45441,8 +45115,7 @@ func (c *TargetHttpsProxiesPatchCall) Header() http.Header { func (c *TargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -45563,8 +45236,7 @@ func (c *TargetHttpsProxiesSetCertificateMapCall) Header() http.Header { func (c *TargetHttpsProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetcertificatemaprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetcertificatemaprequest) if err != nil { return nil, err } @@ -45684,8 +45356,7 @@ func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header { func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetquicoverriderequest) if err != nil { return nil, err } @@ -45805,8 +45476,7 @@ func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header { func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -45930,8 +45600,7 @@ func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header { func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicyreference) if err != nil { return nil, err } @@ -46051,8 +45720,7 @@ func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header { func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -46157,8 +45825,7 @@ func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -46371,12 +46038,11 @@ func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46509,12 +46175,11 @@ func (c *TargetInstancesDeleteCall) Header() http.Header { func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46624,12 +46289,11 @@ func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46742,8 +46406,7 @@ func (c *TargetInstancesInsertCall) Header() http.Header { func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetinstance) if err != nil { return nil, err } @@ -46936,12 +46599,11 @@ func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47080,8 +46742,7 @@ func (c *TargetInstancesSetSecurityPolicyCall) Header() http.Header { func (c *TargetInstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -47190,8 +46851,7 @@ func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header { func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -47315,8 +46975,7 @@ func (c *TargetPoolsAddHealthCheckCall) Header() http.Header { func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsaddhealthcheckrequest) if err != nil { return nil, err } @@ -47439,8 +47098,7 @@ func (c *TargetPoolsAddInstanceCall) Header() http.Header { func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsaddinstancerequest) if err != nil { return nil, err } @@ -47653,12 +47311,11 @@ func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47791,12 +47448,11 @@ func (c *TargetPoolsDeleteCall) Header() http.Header { func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47906,12 +47562,11 @@ func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48013,8 +47668,7 @@ func (c *TargetPoolsGetHealthCall) Header() http.Header { func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancereference) if err != nil { return nil, err } @@ -48136,8 +47790,7 @@ func (c *TargetPoolsInsertCall) Header() http.Header { func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpool) if err != nil { return nil, err } @@ -48330,12 +47983,11 @@ func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48470,8 +48122,7 @@ func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header { func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsremovehealthcheckrequest) if err != nil { return nil, err } @@ -48594,8 +48245,7 @@ func (c *TargetPoolsRemoveInstanceCall) Header() http.Header { func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsremoveinstancerequest) if err != nil { return nil, err } @@ -48725,8 +48375,7 @@ func (c *TargetPoolsSetBackupCall) Header() http.Header { func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -48851,8 +48500,7 @@ func (c *TargetPoolsSetSecurityPolicyCall) Header() http.Header { func (c *TargetPoolsSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -48961,8 +48609,7 @@ func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header { func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -49081,12 +48728,11 @@ func (c *TargetSslProxiesDeleteCall) Header() http.Header { func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49192,12 +48838,11 @@ func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49306,8 +48951,7 @@ func (c *TargetSslProxiesInsertCall) Header() http.Header { func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxy) if err != nil { return nil, err } @@ -49496,12 +49140,11 @@ func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49634,8 +49277,7 @@ func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header { func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetbackendservicerequest) if err != nil { return nil, err } @@ -49756,8 +49398,7 @@ func (c *TargetSslProxiesSetCertificateMapCall) Header() http.Header { func (c *TargetSslProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetcertificatemaprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetcertificatemaprequest) if err != nil { return nil, err } @@ -49877,8 +49518,7 @@ func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header { func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetproxyheaderrequest) if err != nil { return nil, err } @@ -49998,8 +49638,7 @@ func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header { func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -50122,8 +49761,7 @@ func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header { func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicyreference) if err != nil { return nil, err } @@ -50228,8 +49866,7 @@ func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -50442,12 +50079,11 @@ func (c *TargetTcpProxiesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50577,12 +50213,11 @@ func (c *TargetTcpProxiesDeleteCall) Header() http.Header { func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50688,12 +50323,11 @@ func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50802,8 +50436,7 @@ func (c *TargetTcpProxiesInsertCall) Header() http.Header { func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxy) if err != nil { return nil, err } @@ -50992,12 +50625,11 @@ func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51130,8 +50762,7 @@ func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header { func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxiessetbackendservicerequest) if err != nil { return nil, err } @@ -51251,8 +50882,7 @@ func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header { func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxiessetproxyheaderrequest) if err != nil { return nil, err } @@ -51357,8 +50987,7 @@ func (c *TargetTcpProxiesTestIamPermissionsCall) Header() http.Header { func (c *TargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -51571,12 +51200,11 @@ func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51709,12 +51337,11 @@ func (c *TargetVpnGatewaysDeleteCall) Header() http.Header { func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -51824,12 +51451,11 @@ func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51943,8 +51569,7 @@ func (c *TargetVpnGatewaysInsertCall) Header() http.Header { func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetvpngateway) if err != nil { return nil, err } @@ -52137,12 +51762,11 @@ func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52279,8 +51903,7 @@ func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header { func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -52389,8 +52012,7 @@ func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -52604,12 +52226,11 @@ func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52739,12 +52360,11 @@ func (c *UrlMapsDeleteCall) Header() http.Header { func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -52850,12 +52470,11 @@ func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52964,8 +52583,7 @@ func (c *UrlMapsInsertCall) Header() http.Header { func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -53085,8 +52703,7 @@ func (c *UrlMapsInvalidateCacheCall) Header() http.Header { func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cacheinvalidationrule) if err != nil { return nil, err } @@ -53276,12 +52893,11 @@ func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53414,8 +53030,7 @@ func (c *UrlMapsPatchCall) Header() http.Header { func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -53520,8 +53135,7 @@ func (c *UrlMapsTestIamPermissionsCall) Header() http.Header { func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -53642,8 +53256,7 @@ func (c *UrlMapsUpdateCall) Header() http.Header { func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -53749,8 +53362,7 @@ func (c *UrlMapsValidateCall) Header() http.Header { func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapsvalidaterequest) if err != nil { return nil, err } @@ -53963,12 +53575,11 @@ func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/vpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54101,12 +53712,11 @@ func (c *VpnGatewaysDeleteCall) Header() http.Header { func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -54216,12 +53826,11 @@ func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54331,12 +53940,11 @@ func (c *VpnGatewaysGetStatusCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54450,8 +54058,7 @@ func (c *VpnGatewaysInsertCall) Header() http.Header { func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpngateway) if err != nil { return nil, err } @@ -54644,12 +54251,11 @@ func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54785,8 +54391,7 @@ func (c *VpnGatewaysSetLabelsCall) Header() http.Header { func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -54895,8 +54500,7 @@ func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -55110,12 +54714,11 @@ func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/vpnTunnels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55248,12 +54851,11 @@ func (c *VpnTunnelsDeleteCall) Header() http.Header { func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -55363,12 +54965,11 @@ func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55481,8 +55082,7 @@ func (c *VpnTunnelsInsertCall) Header() http.Header { func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpntunnel) if err != nil { return nil, err } @@ -55675,12 +55275,11 @@ func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55816,8 +55415,7 @@ func (c *VpnTunnelsSetLabelsCall) Header() http.Header { func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -55926,8 +55524,7 @@ func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header { func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -56035,12 +55632,11 @@ func (c *ZoneOperationsDeleteCall) Header() http.Header { func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56128,12 +55724,11 @@ func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56319,12 +55914,11 @@ func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56452,12 +56046,11 @@ func (c *ZoneOperationsWaitCall) Header() http.Header { func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -56564,12 +56157,11 @@ func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56751,12 +56343,11 @@ func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/compute/v1/compute-gen.go b/compute/v1/compute-gen.go index 678061a207f..3e1565ed06c 100644 --- a/compute/v1/compute-gen.go +++ b/compute/v1/compute-gen.go @@ -142,25 +142,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.AcceleratorTypes = NewAcceleratorTypesService(s) s.Addresses = NewAddressesService(s) @@ -263,9 +244,27 @@ func New(client *http.Client) (*Service, error) { s.VpnTunnels = NewVpnTunnelsService(s) s.ZoneOperations = NewZoneOperationsService(s) s.Zones = NewZonesService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL diff --git a/compute/v1/compute2-gen.go b/compute/v1/compute2-gen.go index 1cf1f4e406f..507af08a231 100644 --- a/compute/v1/compute2-gen.go +++ b/compute/v1/compute2-gen.go @@ -9,7 +9,6 @@ package compute import ( "context" "fmt" - "io" "net/http" googleapi "google.golang.org/api/googleapi" @@ -171,12 +170,11 @@ func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -306,12 +304,11 @@ func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -498,12 +495,11 @@ func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -729,12 +725,11 @@ func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -867,12 +862,11 @@ func (c *AddressesDeleteCall) Header() http.Header { func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -982,12 +976,11 @@ func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1100,8 +1093,7 @@ func (c *AddressesInsertCall) Header() http.Header { func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.address) if err != nil { return nil, err } @@ -1293,12 +1285,11 @@ func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1433,8 +1424,7 @@ func (c *AddressesMoveCall) Header() http.Header { func (c *AddressesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionaddressesmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionaddressesmoverequest) if err != nil { return nil, err } @@ -1558,8 +1548,7 @@ func (c *AddressesSetLabelsCall) Header() http.Header { func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -1772,12 +1761,11 @@ func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1910,12 +1898,11 @@ func (c *AutoscalersDeleteCall) Header() http.Header { func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2025,12 +2012,11 @@ func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2143,8 +2129,7 @@ func (c *AutoscalersInsertCall) Header() http.Header { func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2336,12 +2321,11 @@ func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2482,8 +2466,7 @@ func (c *AutoscalersPatchCall) Header() http.Header { func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2610,8 +2593,7 @@ func (c *AutoscalersUpdateCall) Header() http.Header { func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -2732,8 +2714,7 @@ func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header { func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signedurlkey) if err != nil { return nil, err } @@ -2850,12 +2831,11 @@ func (c *BackendBucketsDeleteCall) Header() http.Header { func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2968,12 +2948,11 @@ func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header { func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3079,12 +3058,11 @@ func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3198,12 +3176,11 @@ func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3312,8 +3289,7 @@ func (c *BackendBucketsInsertCall) Header() http.Header { func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -3502,12 +3478,11 @@ func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3641,8 +3616,7 @@ func (c *BackendBucketsPatchCall) Header() http.Header { func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -3763,8 +3737,7 @@ func (c *BackendBucketsSetEdgeSecurityPolicyCall) Header() http.Header { func (c *BackendBucketsSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -3869,8 +3842,7 @@ func (c *BackendBucketsSetIamPolicyCall) Header() http.Header { func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -3975,8 +3947,7 @@ func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header { func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -4097,8 +4068,7 @@ func (c *BackendBucketsUpdateCall) Header() http.Header { func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendbucket) if err != nil { return nil, err } @@ -4219,8 +4189,7 @@ func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header { func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signedurlkey) if err != nil { return nil, err } @@ -4432,12 +4401,11 @@ func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4567,12 +4535,11 @@ func (c *BackendServicesDeleteCall) Header() http.Header { func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4685,12 +4652,11 @@ func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header { func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4796,12 +4762,11 @@ func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4900,8 +4865,7 @@ func (c *BackendServicesGetHealthCall) Header() http.Header { func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcegroupreference) if err != nil { return nil, err } @@ -5024,12 +4988,11 @@ func (c *BackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5139,8 +5102,7 @@ func (c *BackendServicesInsertCall) Header() http.Header { func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -5329,12 +5291,11 @@ func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5537,12 +5498,11 @@ func (c *BackendServicesListUsableCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5677,8 +5637,7 @@ func (c *BackendServicesPatchCall) Header() http.Header { func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -5799,8 +5758,7 @@ func (c *BackendServicesSetEdgeSecurityPolicyCall) Header() http.Header { func (c *BackendServicesSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -5905,8 +5863,7 @@ func (c *BackendServicesSetIamPolicyCall) Header() http.Header { func (c *BackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -6028,8 +5985,7 @@ func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header { func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -6134,8 +6090,7 @@ func (c *BackendServicesTestIamPermissionsCall) Header() http.Header { func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -6256,8 +6211,7 @@ func (c *BackendServicesUpdateCall) Header() http.Header { func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -6469,12 +6423,11 @@ func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6604,12 +6557,11 @@ func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6794,12 +6746,11 @@ func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6936,8 +6887,7 @@ func (c *DisksAddResourcePoliciesCall) Header() http.Header { func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -7150,12 +7100,11 @@ func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7287,8 +7236,7 @@ func (c *DisksBulkInsertCall) Header() http.Header { func (c *DisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertdiskresource) if err != nil { return nil, err } @@ -7421,8 +7369,7 @@ func (c *DisksCreateSnapshotCall) Header() http.Header { func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -7546,12 +7493,11 @@ func (c *DisksDeleteCall) Header() http.Header { func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7661,12 +7607,11 @@ func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7784,12 +7729,11 @@ func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7912,8 +7856,7 @@ func (c *DisksInsertCall) Header() http.Header { func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk) if err != nil { return nil, err } @@ -8106,12 +8049,11 @@ func (c *DisksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8246,8 +8188,7 @@ func (c *DisksRemoveResourcePoliciesCall) Header() http.Header { func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -8371,8 +8312,7 @@ func (c *DisksResizeCall) Header() http.Header { func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksresizerequest) if err != nil { return nil, err } @@ -8481,8 +8421,7 @@ func (c *DisksSetIamPolicyCall) Header() http.Header { func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -8606,8 +8545,7 @@ func (c *DisksSetLabelsCall) Header() http.Header { func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -8731,8 +8669,7 @@ func (c *DisksStartAsyncReplicationCall) Header() http.Header { func (c *DisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstartasyncreplicationrequest) if err != nil { return nil, err } @@ -8854,12 +8791,11 @@ func (c *DisksStopAsyncReplicationCall) Header() http.Header { func (c *DisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8973,8 +8909,7 @@ func (c *DisksStopGroupAsyncReplicationCall) Header() http.Header { func (c *DisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstopgroupasyncreplicationresource) if err != nil { return nil, err } @@ -9082,8 +9017,7 @@ func (c *DisksTestIamPermissionsCall) Header() http.Header { func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -9222,8 +9156,7 @@ func (c *DisksUpdateCall) Header() http.Header { func (c *DisksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk2) if err != nil { return nil, err } @@ -9341,12 +9274,11 @@ func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header { func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9453,12 +9385,11 @@ func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9568,8 +9499,7 @@ func (c *ExternalVpnGatewaysInsertCall) Header() http.Header { func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalvpngateway) if err != nil { return nil, err } @@ -9758,12 +9688,11 @@ func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9881,8 +9810,7 @@ func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header { func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -9987,8 +9915,7 @@ func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -10114,8 +10041,7 @@ func (c *FirewallPoliciesAddAssociationCall) Header() http.Header { func (c *FirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -10230,8 +10156,7 @@ func (c *FirewallPoliciesAddRuleCall) Header() http.Header { func (c *FirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -10351,12 +10276,11 @@ func (c *FirewallPoliciesCloneRulesCall) Header() http.Header { func (c *FirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10461,12 +10385,11 @@ func (c *FirewallPoliciesDeleteCall) Header() http.Header { func (c *FirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10568,12 +10491,11 @@ func (c *FirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10683,12 +10605,11 @@ func (c *FirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10799,12 +10720,11 @@ func (c *FirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10914,12 +10834,11 @@ func (c *FirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11032,8 +10951,7 @@ func (c *FirewallPoliciesInsertCall) Header() http.Header { func (c *FirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -11223,12 +11141,11 @@ func (c *FirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11353,12 +11270,11 @@ func (c *FirewallPoliciesListAssociationsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/listAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11470,12 +11386,11 @@ func (c *FirewallPoliciesMoveCall) Header() http.Header { func (c *FirewallPoliciesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11582,8 +11497,7 @@ func (c *FirewallPoliciesPatchCall) Header() http.Header { func (c *FirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -11705,8 +11619,7 @@ func (c *FirewallPoliciesPatchRuleCall) Header() http.Header { func (c *FirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -11826,12 +11739,11 @@ func (c *FirewallPoliciesRemoveAssociationCall) Header() http.Header { func (c *FirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11943,12 +11855,11 @@ func (c *FirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *FirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12041,8 +11952,7 @@ func (c *FirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *FirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalorganizationsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalorganizationsetpolicyrequest) if err != nil { return nil, err } @@ -12143,8 +12053,7 @@ func (c *FirewallPoliciesTestIamPermissionsCall) Header() http.Header { func (c *FirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -12261,12 +12170,11 @@ func (c *FirewallsDeleteCall) Header() http.Header { func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12372,12 +12280,11 @@ func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12486,8 +12393,7 @@ func (c *FirewallsInsertCall) Header() http.Header { func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall) if err != nil { return nil, err } @@ -12676,12 +12582,11 @@ func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12814,8 +12719,7 @@ func (c *FirewallsPatchCall) Header() http.Header { func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall2) if err != nil { return nil, err } @@ -12936,8 +12840,7 @@ func (c *FirewallsUpdateCall) Header() http.Header { func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewall2) if err != nil { return nil, err } @@ -13149,12 +13052,11 @@ func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13287,12 +13189,11 @@ func (c *ForwardingRulesDeleteCall) Header() http.Header { func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13402,12 +13303,11 @@ func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13520,8 +13420,7 @@ func (c *ForwardingRulesInsertCall) Header() http.Header { func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -13714,12 +13613,11 @@ func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13858,8 +13756,7 @@ func (c *ForwardingRulesPatchCall) Header() http.Header { func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -13983,8 +13880,7 @@ func (c *ForwardingRulesSetLabelsCall) Header() http.Header { func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -14109,8 +14005,7 @@ func (c *ForwardingRulesSetTargetCall) Header() http.Header { func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -14228,12 +14123,11 @@ func (c *GlobalAddressesDeleteCall) Header() http.Header { func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14339,12 +14233,11 @@ func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14453,8 +14346,7 @@ func (c *GlobalAddressesInsertCall) Header() http.Header { func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.address) if err != nil { return nil, err } @@ -14642,12 +14534,11 @@ func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14779,8 +14670,7 @@ func (c *GlobalAddressesMoveCall) Header() http.Header { func (c *GlobalAddressesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globaladdressesmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globaladdressesmoverequest) if err != nil { return nil, err } @@ -14885,8 +14775,7 @@ func (c *GlobalAddressesSetLabelsCall) Header() http.Header { func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -15003,12 +14892,11 @@ func (c *GlobalForwardingRulesDeleteCall) Header() http.Header { func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15115,12 +15003,11 @@ func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15229,8 +15116,7 @@ func (c *GlobalForwardingRulesInsertCall) Header() http.Header { func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -15419,12 +15305,11 @@ func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15559,8 +15444,7 @@ func (c *GlobalForwardingRulesPatchCall) Header() http.Header { func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingrule) if err != nil { return nil, err } @@ -15665,8 +15549,7 @@ func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header { func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -15787,8 +15670,7 @@ func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header { func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -15909,8 +15791,7 @@ func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.He func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalnetworkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -16029,12 +15910,11 @@ func (c *GlobalNetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *GlobalNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16147,8 +16027,7 @@ func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.He func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalnetworkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -16263,12 +16142,11 @@ func (c *GlobalNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16378,8 +16256,7 @@ func (c *GlobalNetworkEndpointGroupsInsertCall) Header() http.Header { func (c *GlobalNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -16568,12 +16445,11 @@ func (c *GlobalNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16769,12 +16645,11 @@ func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Head func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17000,12 +16875,11 @@ func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17121,12 +16995,11 @@ func (c *GlobalOperationsDeleteCall) Header() http.Header { func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17210,12 +17083,11 @@ func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17397,12 +17269,11 @@ func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17527,12 +17398,11 @@ func (c *GlobalOperationsWaitCall) Header() http.Header { func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17630,12 +17500,11 @@ func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header { func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17722,12 +17591,11 @@ func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17910,12 +17778,11 @@ func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18042,12 +17909,11 @@ func (c *GlobalPublicDelegatedPrefixesDeleteCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18154,12 +18020,11 @@ func (c *GlobalPublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18269,8 +18134,7 @@ func (c *GlobalPublicDelegatedPrefixesInsertCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -18458,12 +18322,11 @@ func (c *GlobalPublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18598,8 +18461,7 @@ func (c *GlobalPublicDelegatedPrefixesPatchCall) Header() http.Header { func (c *GlobalPublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -18811,12 +18673,11 @@ func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18946,12 +18807,11 @@ func (c *HealthChecksDeleteCall) Header() http.Header { func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19057,12 +18917,11 @@ func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19171,8 +19030,7 @@ func (c *HealthChecksInsertCall) Header() http.Header { func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -19361,12 +19219,11 @@ func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19500,8 +19357,7 @@ func (c *HealthChecksPatchCall) Header() http.Header { func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -19621,8 +19477,7 @@ func (c *HealthChecksUpdateCall) Header() http.Header { func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -19739,12 +19594,11 @@ func (c *HttpHealthChecksDeleteCall) Header() http.Header { func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19850,12 +19704,11 @@ func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19965,8 +19818,7 @@ func (c *HttpHealthChecksInsertCall) Header() http.Header { func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -20155,12 +20007,11 @@ func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20294,8 +20145,7 @@ func (c *HttpHealthChecksPatchCall) Header() http.Header { func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -20415,8 +20265,7 @@ func (c *HttpHealthChecksUpdateCall) Header() http.Header { func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httphealthcheck) if err != nil { return nil, err } @@ -20533,12 +20382,11 @@ func (c *HttpsHealthChecksDeleteCall) Header() http.Header { func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20644,12 +20492,11 @@ func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20759,8 +20606,7 @@ func (c *HttpsHealthChecksInsertCall) Header() http.Header { func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -20949,12 +20795,11 @@ func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21088,8 +20933,7 @@ func (c *HttpsHealthChecksPatchCall) Header() http.Header { func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -21209,8 +21053,7 @@ func (c *HttpsHealthChecksUpdateCall) Header() http.Header { func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httpshealthcheck) if err != nil { return nil, err } @@ -21328,12 +21171,11 @@ func (c *ImageFamilyViewsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/imageFamilyViews/{family}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21444,12 +21286,11 @@ func (c *ImagesDeleteCall) Header() http.Header { func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21561,8 +21402,7 @@ func (c *ImagesDeprecateCall) Header() http.Header { func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deprecationstatus) if err != nil { return nil, err } @@ -21676,12 +21516,11 @@ func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21790,12 +21629,11 @@ func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/family/{family}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21909,12 +21747,11 @@ func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22030,8 +21867,7 @@ func (c *ImagesInsertCall) Header() http.Header { func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.image) if err != nil { return nil, err } @@ -22224,12 +22060,11 @@ func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22362,8 +22197,7 @@ func (c *ImagesPatchCall) Header() http.Header { func (c *ImagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.image2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.image2) if err != nil { return nil, err } @@ -22468,8 +22302,7 @@ func (c *ImagesSetIamPolicyCall) Header() http.Header { func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -22574,8 +22407,7 @@ func (c *ImagesSetLabelsCall) Header() http.Header { func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -22680,8 +22512,7 @@ func (c *ImagesTestIamPermissionsCall) Header() http.Header { func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -22811,12 +22642,11 @@ func (c *InstanceGroupManagerResizeRequestsCancelCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -22938,12 +22768,11 @@ func (c *InstanceGroupManagerResizeRequestsDeleteCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23060,12 +22889,11 @@ func (c *InstanceGroupManagerResizeRequestsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23186,8 +23014,7 @@ func (c *InstanceGroupManagerResizeRequestsInsertCall) Header() http.Header { func (c *InstanceGroupManagerResizeRequestsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerresizerequest) if err != nil { return nil, err } @@ -23386,12 +23213,11 @@ func (c *InstanceGroupManagerResizeRequestsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23539,8 +23365,7 @@ func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header { func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } @@ -23753,12 +23578,11 @@ func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23882,8 +23706,7 @@ func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersapplyupdatesrequest) if err != nil { return nil, err } @@ -24012,8 +23835,7 @@ func (c *InstanceGroupManagersCreateInstancesCall) Header() http.Header { func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } @@ -24136,12 +23958,11 @@ func (c *InstanceGroupManagersDeleteCall) Header() http.Header { func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24266,8 +24087,7 @@ func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header { func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersdeleteinstancesrequest) if err != nil { return nil, err } @@ -24378,8 +24198,7 @@ func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersdeleteperinstanceconfigsreq) if err != nil { return nil, err } @@ -24497,12 +24316,11 @@ func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24623,8 +24441,7 @@ func (c *InstanceGroupManagersInsertCall) Header() http.Header { func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -24817,12 +24634,11 @@ func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25037,12 +24853,11 @@ func (c *InstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25247,12 +25062,11 @@ func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header { func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -25454,12 +25268,11 @@ func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header { func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -25606,8 +25419,7 @@ func (c *InstanceGroupManagersPatchCall) Header() http.Header { func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -25734,8 +25546,7 @@ func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerspatchperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerspatchperinstanceconfigsreq) if err != nil { return nil, err } @@ -25867,8 +25678,7 @@ func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header { func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersrecreateinstancesrequest) if err != nil { return nil, err } @@ -26007,12 +25817,11 @@ func (c *InstanceGroupManagersResizeCall) Header() http.Header { func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -26139,8 +25948,7 @@ func (c *InstanceGroupManagersResumeInstancesCall) Header() http.Header { func (c *InstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresumeinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } @@ -26266,8 +26074,7 @@ func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header { func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssetinstancetemplaterequest) if err != nil { return nil, err } @@ -26395,8 +26202,7 @@ func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header { func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } @@ -26530,8 +26336,7 @@ func (c *InstanceGroupManagersStartInstancesCall) Header() http.Header { func (c *InstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstartinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } @@ -26671,8 +26476,7 @@ func (c *InstanceGroupManagersStopInstancesCall) Header() http.Header { func (c *InstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstopinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } @@ -26813,8 +26617,7 @@ func (c *InstanceGroupManagersSuspendInstancesCall) Header() http.Header { func (c *InstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssuspendinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } @@ -26941,8 +26744,7 @@ func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanagersupdateperinstanceconfigsreq) if err != nil { return nil, err } @@ -27068,8 +26870,7 @@ func (c *InstanceGroupsAddInstancesCall) Header() http.Header { func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupsaddinstancesrequest) if err != nil { return nil, err } @@ -27282,12 +27083,11 @@ func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27422,12 +27222,11 @@ func (c *InstanceGroupsDeleteCall) Header() http.Header { func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27540,12 +27339,11 @@ func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27658,8 +27456,7 @@ func (c *InstanceGroupsInsertCall) Header() http.Header { func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroup) if err != nil { return nil, err } @@ -27853,12 +27650,11 @@ func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28061,8 +27857,7 @@ func (c *InstanceGroupsListInstancesCall) Header() http.Header { func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupslistinstancesrequest) if err != nil { return nil, err } @@ -28212,8 +28007,7 @@ func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header { func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupsremoveinstancesrequest) if err != nil { return nil, err } @@ -28337,8 +28131,7 @@ func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header { func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupssetnamedportsrequest) if err != nil { return nil, err } @@ -28453,12 +28246,11 @@ func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28577,8 +28369,7 @@ func (c *InstanceSettingsPatchCall) Header() http.Header { func (c *InstanceSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesettings) if err != nil { return nil, err } @@ -28791,12 +28582,11 @@ func (c *InstanceTemplatesAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28928,12 +28718,11 @@ func (c *InstanceTemplatesDeleteCall) Header() http.Header { func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29039,12 +28828,11 @@ func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29159,12 +28947,11 @@ func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29276,8 +29063,7 @@ func (c *InstanceTemplatesInsertCall) Header() http.Header { func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancetemplate) if err != nil { return nil, err } @@ -29466,12 +29252,11 @@ func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29589,8 +29374,7 @@ func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header { func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -29695,8 +29479,7 @@ func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header { func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -29822,8 +29605,7 @@ func (c *InstancesAddAccessConfigCall) Header() http.Header { func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessconfig) if err != nil { return nil, err } @@ -29948,8 +29730,7 @@ func (c *InstancesAddResourcePoliciesCall) Header() http.Header { func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -30164,12 +29945,11 @@ func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30316,8 +30096,7 @@ func (c *InstancesAttachDiskCall) Header() http.Header { func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attacheddisk) if err != nil { return nil, err } @@ -30438,8 +30217,7 @@ func (c *InstancesBulkInsertCall) Header() http.Header { func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertinstanceresource) if err != nil { return nil, err } @@ -30560,12 +30338,11 @@ func (c *InstancesDeleteCall) Header() http.Header { func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30683,12 +30460,11 @@ func (c *InstancesDeleteAccessConfigCall) Header() http.Header { func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30804,12 +30580,11 @@ func (c *InstancesDetachDiskCall) Header() http.Header { func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/detachDisk") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30919,12 +30694,11 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31038,12 +30812,11 @@ func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31168,12 +30941,11 @@ func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31292,12 +31064,11 @@ func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31407,12 +31178,11 @@ func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/screenshot") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31549,12 +31319,11 @@ func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/serialPort") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31666,12 +31435,11 @@ func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31811,8 +31579,7 @@ func (c *InstancesInsertCall) Header() http.Header { func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -32004,12 +31771,11 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32222,12 +31988,11 @@ func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/referrers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32362,12 +32127,11 @@ func (c *InstancesPerformMaintenanceCall) Header() http.Header { func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -32482,8 +32246,7 @@ func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header { func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -32605,12 +32368,11 @@ func (c *InstancesResetCall) Header() http.Header { func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -32724,12 +32486,11 @@ func (c *InstancesResumeCall) Header() http.Header { func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/resume") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -32827,12 +32588,11 @@ func (c *InstancesSendDiagnosticInterruptCall) Header() http.Header { func (c *InstancesSendDiagnosticInterruptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -32929,12 +32689,11 @@ func (c *InstancesSetDeletionProtectionCall) Header() http.Header { func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -33053,12 +32812,11 @@ func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header { func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -33159,8 +32917,7 @@ func (c *InstancesSetIamPolicyCall) Header() http.Header { func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -33284,8 +33041,7 @@ func (c *InstancesSetLabelsCall) Header() http.Header { func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetlabelsrequest) if err != nil { return nil, err } @@ -33409,8 +33165,7 @@ func (c *InstancesSetMachineResourcesCall) Header() http.Header { func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmachineresourcesrequest) if err != nil { return nil, err } @@ -33534,8 +33289,7 @@ func (c *InstancesSetMachineTypeCall) Header() http.Header { func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmachinetyperequest) if err != nil { return nil, err } @@ -33659,8 +33413,7 @@ func (c *InstancesSetMetadataCall) Header() http.Header { func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadata) if err != nil { return nil, err } @@ -33785,8 +33538,7 @@ func (c *InstancesSetMinCpuPlatformCall) Header() http.Header { func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetmincpuplatformrequest) if err != nil { return nil, err } @@ -33909,8 +33661,7 @@ func (c *InstancesSetNameCall) Header() http.Header { func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetnamerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetnamerequest) if err != nil { return nil, err } @@ -34037,8 +33788,7 @@ func (c *InstancesSetSchedulingCall) Header() http.Header { func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scheduling) if err != nil { return nil, err } @@ -34163,8 +33913,7 @@ func (c *InstancesSetSecurityPolicyCall) Header() http.Header { func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetsecuritypolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetsecuritypolicyrequest) if err != nil { return nil, err } @@ -34289,8 +34038,7 @@ func (c *InstancesSetServiceAccountCall) Header() http.Header { func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancessetserviceaccountrequest) if err != nil { return nil, err } @@ -34416,8 +34164,7 @@ func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header { func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedinstanceintegritypolicy) if err != nil { return nil, err } @@ -34541,8 +34288,7 @@ func (c *InstancesSetTagsCall) Header() http.Header { func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tags) if err != nil { return nil, err } @@ -34672,12 +34418,11 @@ func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header { func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34791,12 +34536,11 @@ func (c *InstancesStartCall) Header() http.Header { func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/start") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34912,8 +34656,7 @@ func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header { func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesstartwithencryptionkeyrequest) if err != nil { return nil, err } @@ -35048,12 +34791,11 @@ func (c *InstancesStopCall) Header() http.Header { func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/stop") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -35181,12 +34923,11 @@ func (c *InstancesSuspendCall) Header() http.Header { func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/suspend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -35287,8 +35028,7 @@ func (c *InstancesTestIamPermissionsCall) Header() http.Header { func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -35448,8 +35188,7 @@ func (c *InstancesUpdateCall) Header() http.Header { func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance2) if err != nil { return nil, err } @@ -35578,8 +35317,7 @@ func (c *InstancesUpdateAccessConfigCall) Header() http.Header { func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accessconfig) if err != nil { return nil, err } @@ -35704,8 +35442,7 @@ func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header { func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.displaydevice) if err != nil { return nil, err } @@ -35834,8 +35571,7 @@ func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header { func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkinterface) if err != nil { return nil, err } @@ -35961,8 +35697,7 @@ func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header { func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shieldedinstanceconfig) if err != nil { return nil, err } @@ -36175,12 +35910,11 @@ func (c *InstantSnapshotsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36318,12 +36052,11 @@ func (c *InstantSnapshotsDeleteCall) Header() http.Header { func (c *InstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36433,12 +36166,11 @@ func (c *InstantSnapshotsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36557,12 +36289,11 @@ func (c *InstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36674,8 +36405,7 @@ func (c *InstantSnapshotsInsertCall) Header() http.Header { func (c *InstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshot) if err != nil { return nil, err } @@ -36868,12 +36598,11 @@ func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36995,8 +36724,7 @@ func (c *InstantSnapshotsSetIamPolicyCall) Header() http.Header { func (c *InstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -37120,8 +36848,7 @@ func (c *InstantSnapshotsSetLabelsCall) Header() http.Header { func (c *InstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetlabelsrequest) if err != nil { return nil, err } @@ -37230,8 +36957,7 @@ func (c *InstantSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *InstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -37445,12 +37171,11 @@ func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37583,12 +37308,11 @@ func (c *InterconnectAttachmentsDeleteCall) Header() http.Header { func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37698,12 +37422,11 @@ func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37824,8 +37547,7 @@ func (c *InterconnectAttachmentsInsertCall) Header() http.Header { func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachment) if err != nil { return nil, err } @@ -38018,12 +37740,11 @@ func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38161,8 +37882,7 @@ func (c *InterconnectAttachmentsPatchCall) Header() http.Header { func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnectattachment) if err != nil { return nil, err } @@ -38286,8 +38006,7 @@ func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header { func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -38403,12 +38122,11 @@ func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations/{interconnectLocation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38591,12 +38309,11 @@ func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38726,12 +38443,11 @@ func (c *InterconnectRemoteLocationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38914,12 +38630,11 @@ func (c *InterconnectRemoteLocationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39049,12 +38764,11 @@ func (c *InterconnectsDeleteCall) Header() http.Header { func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39161,12 +38875,11 @@ func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39276,12 +38989,11 @@ func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getDiagnostics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39389,12 +39101,11 @@ func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39504,8 +39215,7 @@ func (c *InterconnectsInsertCall) Header() http.Header { func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnect) if err != nil { return nil, err } @@ -39694,12 +39404,11 @@ func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39833,8 +39542,7 @@ func (c *InterconnectsPatchCall) Header() http.Header { func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interconnect2) if err != nil { return nil, err } @@ -39939,8 +39647,7 @@ func (c *InterconnectsSetLabelsCall) Header() http.Header { func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -40057,12 +39764,11 @@ func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{licenseCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40160,8 +39866,7 @@ func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header { func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -40281,12 +39986,11 @@ func (c *LicensesDeleteCall) Header() http.Header { func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40394,12 +40098,11 @@ func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40514,12 +40217,11 @@ func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40629,8 +40331,7 @@ func (c *LicensesInsertCall) Header() http.Header { func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.license) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.license) if err != nil { return nil, err } @@ -40824,12 +40525,11 @@ func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40948,8 +40648,7 @@ func (c *LicensesSetIamPolicyCall) Header() http.Header { func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -41055,8 +40754,7 @@ func (c *LicensesTestIamPermissionsCall) Header() http.Header { func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -41175,12 +40873,11 @@ func (c *MachineImagesDeleteCall) Header() http.Header { func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41286,12 +40983,11 @@ func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41405,12 +41101,11 @@ func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41528,8 +41223,7 @@ func (c *MachineImagesInsertCall) Header() http.Header { func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.machineimage) if err != nil { return nil, err } @@ -41718,12 +41412,11 @@ func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41841,8 +41534,7 @@ func (c *MachineImagesSetIamPolicyCall) Header() http.Header { func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -41947,8 +41639,7 @@ func (c *MachineImagesTestIamPermissionsCall) Header() http.Header { func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -42161,12 +41852,11 @@ func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/machineTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42296,12 +41986,11 @@ func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes/{machineType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42486,12 +42175,11 @@ func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42718,12 +42406,11 @@ func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42857,12 +42544,11 @@ func (c *NetworkAttachmentsDeleteCall) Header() http.Header { func (c *NetworkAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42972,12 +42658,11 @@ func (c *NetworkAttachmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43096,12 +42781,11 @@ func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43215,8 +42899,7 @@ func (c *NetworkAttachmentsInsertCall) Header() http.Header { func (c *NetworkAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkattachment) if err != nil { return nil, err } @@ -43408,12 +43091,11 @@ func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43552,8 +43234,7 @@ func (c *NetworkAttachmentsPatchCall) Header() http.Header { func (c *NetworkAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkattachment) if err != nil { return nil, err } @@ -43662,8 +43343,7 @@ func (c *NetworkAttachmentsSetIamPolicyCall) Header() http.Header { func (c *NetworkAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -43772,8 +43452,7 @@ func (c *NetworkAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *NetworkAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -43987,12 +43666,11 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEdgeSecurityServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44126,12 +43804,11 @@ func (c *NetworkEdgeSecurityServicesDeleteCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44242,12 +43919,11 @@ func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44368,8 +44044,7 @@ func (c *NetworkEdgeSecurityServicesInsertCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkedgesecurityservice) if err != nil { return nil, err } @@ -44505,8 +44180,7 @@ func (c *NetworkEdgeSecurityServicesPatchCall) Header() http.Header { func (c *NetworkEdgeSecurityServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkedgesecurityservice) if err != nil { return nil, err } @@ -44719,12 +44393,11 @@ func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44862,8 +44535,7 @@ func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -44989,12 +44661,11 @@ func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45112,8 +44783,7 @@ func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -45233,12 +44903,11 @@ func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45353,8 +45022,7 @@ func (c *NetworkEndpointGroupsInsertCall) Header() http.Header { func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -45548,12 +45216,11 @@ func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45756,8 +45423,7 @@ func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header { func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroupslistendpointsrequest) if err != nil { return nil, err } @@ -45888,8 +45554,7 @@ func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header { func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -46019,8 +45684,7 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -46155,8 +45819,7 @@ func (c *NetworkFirewallPoliciesAddRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -46280,12 +45943,11 @@ func (c *NetworkFirewallPoliciesCloneRulesCall) Header() http.Header { func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -46394,12 +46056,11 @@ func (c *NetworkFirewallPoliciesDeleteCall) Header() http.Header { func (c *NetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46505,12 +46166,11 @@ func (c *NetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46624,12 +46284,11 @@ func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46744,12 +46403,11 @@ func (c *NetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46863,12 +46521,11 @@ func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46978,8 +46635,7 @@ func (c *NetworkFirewallPoliciesInsertCall) Header() http.Header { func (c *NetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -47168,12 +46824,11 @@ func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47305,8 +46960,7 @@ func (c *NetworkFirewallPoliciesPatchCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -47432,8 +47086,7 @@ func (c *NetworkFirewallPoliciesPatchRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -47557,12 +47210,11 @@ func (c *NetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header { func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47678,12 +47330,11 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47780,8 +47431,7 @@ func (c *NetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *NetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -47886,8 +47536,7 @@ func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header { func (c *NetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -48002,12 +47651,11 @@ func (c *NetworkProfilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles/{networkProfile}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48189,12 +47837,11 @@ func (c *NetworkProfilesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48326,8 +47973,7 @@ func (c *NetworksAddPeeringCall) Header() http.Header { func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksaddpeeringrequest) if err != nil { return nil, err } @@ -48444,12 +48090,11 @@ func (c *NetworksDeleteCall) Header() http.Header { func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48555,12 +48200,11 @@ func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48666,12 +48310,11 @@ func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48781,8 +48424,7 @@ func (c *NetworksInsertCall) Header() http.Header { func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network) if err != nil { return nil, err } @@ -48970,12 +48612,11 @@ func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49207,12 +48848,11 @@ func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listPeeringRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49346,8 +48986,7 @@ func (c *NetworksPatchCall) Header() http.Header { func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.network2) if err != nil { return nil, err } @@ -49466,8 +49105,7 @@ func (c *NetworksRemovePeeringCall) Header() http.Header { func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksremovepeeringrequest) if err != nil { return nil, err } @@ -49585,12 +49223,11 @@ func (c *NetworksSwitchToCustomModeCall) Header() http.Header { func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/switchToCustomMode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49704,8 +49341,7 @@ func (c *NetworksUpdatePeeringCall) Header() http.Header { func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networksupdatepeeringrequest) if err != nil { return nil, err } @@ -49827,8 +49463,7 @@ func (c *NodeGroupsAddNodesCall) Header() http.Header { func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsaddnodesrequest) if err != nil { return nil, err } @@ -50042,12 +49677,11 @@ func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50180,12 +49814,11 @@ func (c *NodeGroupsDeleteCall) Header() http.Header { func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50300,8 +49933,7 @@ func (c *NodeGroupsDeleteNodesCall) Header() http.Header { func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsdeletenodesrequest) if err != nil { return nil, err } @@ -50421,12 +50053,11 @@ func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50544,12 +50175,11 @@ func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50664,8 +50294,7 @@ func (c *NodeGroupsInsertCall) Header() http.Header { func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -50858,12 +50487,11 @@ func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51059,12 +50687,11 @@ func (c *NodeGroupsListNodesCall) Header() http.Header { func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -51201,8 +50828,7 @@ func (c *NodeGroupsPatchCall) Header() http.Header { func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -51326,8 +50952,7 @@ func (c *NodeGroupsPerformMaintenanceCall) Header() http.Header { func (c *NodeGroupsPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsperformmaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupsperformmaintenancerequest) if err != nil { return nil, err } @@ -51436,8 +51061,7 @@ func (c *NodeGroupsSetIamPolicyCall) Header() http.Header { func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -51560,8 +51184,7 @@ func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header { func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupssetnodetemplaterequest) if err != nil { return nil, err } @@ -51686,8 +51309,7 @@ func (c *NodeGroupsSimulateMaintenanceEventCall) Header() http.Header { func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssimulatemaintenanceeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroupssimulatemaintenanceeventrequest) if err != nil { return nil, err } @@ -51796,8 +51418,7 @@ func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header { func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -52011,12 +51632,11 @@ func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52149,12 +51769,11 @@ func (c *NodeTemplatesDeleteCall) Header() http.Header { func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -52264,12 +51883,11 @@ func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52387,12 +52005,11 @@ func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52505,8 +52122,7 @@ func (c *NodeTemplatesInsertCall) Header() http.Header { func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodetemplate) if err != nil { return nil, err } @@ -52698,12 +52314,11 @@ func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -52825,8 +52440,7 @@ func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header { func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -52935,8 +52549,7 @@ func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header { func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -53150,12 +52763,11 @@ func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53285,12 +52897,11 @@ func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes/{nodeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53475,12 +53086,11 @@ func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53705,12 +53315,11 @@ func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -53843,12 +53452,11 @@ func (c *PacketMirroringsDeleteCall) Header() http.Header { func (c *PacketMirroringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -53958,12 +53566,11 @@ func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54077,8 +53684,7 @@ func (c *PacketMirroringsInsertCall) Header() http.Header { func (c *PacketMirroringsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.packetmirroring) if err != nil { return nil, err } @@ -54271,12 +53877,11 @@ func (c *PacketMirroringsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -54414,8 +54019,7 @@ func (c *PacketMirroringsPatchCall) Header() http.Header { func (c *PacketMirroringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.packetmirroring) if err != nil { return nil, err } @@ -54524,8 +54128,7 @@ func (c *PacketMirroringsTestIamPermissionsCall) Header() http.Header { func (c *PacketMirroringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -54641,12 +54244,11 @@ func (c *ProjectsDisableXpnHostCall) Header() http.Header { func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -54754,8 +54356,7 @@ func (c *ProjectsDisableXpnResourceCall) Header() http.Header { func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsdisablexpnresourcerequest) if err != nil { return nil, err } @@ -54868,12 +54469,11 @@ func (c *ProjectsEnableXpnHostCall) Header() http.Header { func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -54982,8 +54582,7 @@ func (c *ProjectsEnableXpnResourceCall) Header() http.Header { func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectsenablexpnresourcerequest) if err != nil { return nil, err } @@ -55099,12 +54698,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55207,12 +54805,11 @@ func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55393,12 +54990,11 @@ func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -55591,8 +55187,7 @@ func (c *ProjectsListXpnHostsCall) Header() http.Header { func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectslistxpnhostsrequest) if err != nil { return nil, err } @@ -55728,8 +55323,7 @@ func (c *ProjectsMoveDiskCall) Header() http.Header { func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diskmoverequest) if err != nil { return nil, err } @@ -55850,8 +55444,7 @@ func (c *ProjectsMoveInstanceCall) Header() http.Header { func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancemoverequest) if err != nil { return nil, err } @@ -55969,8 +55562,7 @@ func (c *ProjectsSetCloudArmorTierCall) Header() http.Header { func (c *ProjectsSetCloudArmorTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetcloudarmortierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetcloudarmortierrequest) if err != nil { return nil, err } @@ -56086,8 +55678,7 @@ func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header { func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadata) if err != nil { return nil, err } @@ -56204,8 +55795,7 @@ func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header { func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectssetdefaultnetworktierrequest) if err != nil { return nil, err } @@ -56322,8 +55912,7 @@ func (c *ProjectsSetUsageExportBucketCall) Header() http.Header { func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.usageexportlocation) if err != nil { return nil, err } @@ -56440,12 +56029,11 @@ func (c *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header { func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -56555,12 +56143,11 @@ func (c *PublicAdvertisedPrefixesDeleteCall) Header() http.Header { func (c *PublicAdvertisedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -56667,12 +56254,11 @@ func (c *PublicAdvertisedPrefixesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -56782,8 +56368,7 @@ func (c *PublicAdvertisedPrefixesInsertCall) Header() http.Header { func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicadvertisedprefix) if err != nil { return nil, err } @@ -56971,12 +56556,11 @@ func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57111,8 +56695,7 @@ func (c *PublicAdvertisedPrefixesPatchCall) Header() http.Header { func (c *PublicAdvertisedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicadvertisedprefix) if err != nil { return nil, err } @@ -57230,12 +56813,11 @@ func (c *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header { func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57439,12 +57021,11 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57579,12 +57160,11 @@ func (c *PublicDelegatedPrefixesAnnounceCall) Header() http.Header { func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -57698,12 +57278,11 @@ func (c *PublicDelegatedPrefixesDeleteCall) Header() http.Header { func (c *PublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -57815,12 +57394,11 @@ func (c *PublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -57934,8 +57512,7 @@ func (c *PublicDelegatedPrefixesInsertCall) Header() http.Header { func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -58127,12 +57704,11 @@ func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -58271,8 +57847,7 @@ func (c *PublicDelegatedPrefixesPatchCall) Header() http.Header { func (c *PublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publicdelegatedprefix) if err != nil { return nil, err } @@ -58395,12 +57970,11 @@ func (c *PublicDelegatedPrefixesWithdrawCall) Header() http.Header { func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/compute/v1/compute3-gen.go b/compute/v1/compute3-gen.go index e4b814610e8..ed02fe8eff0 100644 --- a/compute/v1/compute3-gen.go +++ b/compute/v1/compute3-gen.go @@ -9,7 +9,6 @@ package compute import ( "context" "fmt" - "io" "net/http" googleapi "google.golang.org/api/googleapi" @@ -79,12 +78,11 @@ func (c *RegionAutoscalersDeleteCall) Header() http.Header { func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -194,12 +192,11 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -312,8 +309,7 @@ func (c *RegionAutoscalersInsertCall) Header() http.Header { func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -505,12 +501,11 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -652,8 +647,7 @@ func (c *RegionAutoscalersPatchCall) Header() http.Header { func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -780,8 +774,7 @@ func (c *RegionAutoscalersUpdateCall) Header() http.Header { func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscaler) if err != nil { return nil, err } @@ -901,12 +894,11 @@ func (c *RegionBackendServicesDeleteCall) Header() http.Header { func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1016,12 +1008,11 @@ func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1123,8 +1114,7 @@ func (c *RegionBackendServicesGetHealthCall) Header() http.Header { func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcegroupreference) if err != nil { return nil, err } @@ -1251,12 +1241,11 @@ func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1370,8 +1359,7 @@ func (c *RegionBackendServicesInsertCall) Header() http.Header { func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -1564,12 +1552,11 @@ func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1777,12 +1764,11 @@ func (c *RegionBackendServicesListUsableCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1921,8 +1907,7 @@ func (c *RegionBackendServicesPatchCall) Header() http.Header { func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -2031,8 +2016,7 @@ func (c *RegionBackendServicesSetIamPolicyCall) Header() http.Header { func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -2158,8 +2142,7 @@ func (c *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header { func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -2268,8 +2251,7 @@ func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header { func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -2395,8 +2377,7 @@ func (c *RegionBackendServicesUpdateCall) Header() http.Header { func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backendservice) if err != nil { return nil, err } @@ -2609,12 +2590,11 @@ func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2744,12 +2724,11 @@ func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2862,8 +2841,7 @@ func (c *RegionCommitmentsInsertCall) Header() http.Header { func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitment) if err != nil { return nil, err } @@ -3055,12 +3033,11 @@ func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3210,8 +3187,7 @@ func (c *RegionCommitmentsUpdateCall) Header() http.Header { func (c *RegionCommitmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitment2) if err != nil { return nil, err } @@ -3329,12 +3305,11 @@ func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3520,12 +3495,11 @@ func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3663,8 +3637,7 @@ func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header { func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksaddresourcepoliciesrequest) if err != nil { return nil, err } @@ -3784,8 +3757,7 @@ func (c *RegionDisksBulkInsertCall) Header() http.Header { func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertdiskresource) if err != nil { return nil, err } @@ -3910,8 +3882,7 @@ func (c *RegionDisksCreateSnapshotCall) Header() http.Header { func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -4035,12 +4006,11 @@ func (c *RegionDisksDeleteCall) Header() http.Header { func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4150,12 +4120,11 @@ func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4273,12 +4242,11 @@ func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4398,8 +4366,7 @@ func (c *RegionDisksInsertCall) Header() http.Header { func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk) if err != nil { return nil, err } @@ -4592,12 +4559,11 @@ func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4732,8 +4698,7 @@ func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header { func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksremoveresourcepoliciesrequest) if err != nil { return nil, err } @@ -4856,8 +4821,7 @@ func (c *RegionDisksResizeCall) Header() http.Header { func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksresizerequest) if err != nil { return nil, err } @@ -4966,8 +4930,7 @@ func (c *RegionDisksSetIamPolicyCall) Header() http.Header { func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -5090,8 +5053,7 @@ func (c *RegionDisksSetLabelsCall) Header() http.Header { func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -5215,8 +5177,7 @@ func (c *RegionDisksStartAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiondisksstartasyncreplicationrequest) if err != nil { return nil, err } @@ -5338,12 +5299,11 @@ func (c *RegionDisksStopAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5457,8 +5417,7 @@ func (c *RegionDisksStopGroupAsyncReplicationCall) Header() http.Header { func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disksstopgroupasyncreplicationresource) if err != nil { return nil, err } @@ -5566,8 +5525,7 @@ func (c *RegionDisksTestIamPermissionsCall) Header() http.Header { func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -5706,8 +5664,7 @@ func (c *RegionDisksUpdateCall) Header() http.Header { func (c *RegionDisksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disk2) if err != nil { return nil, err } @@ -5829,12 +5786,11 @@ func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header { func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5945,12 +5901,11 @@ func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6064,8 +6019,7 @@ func (c *RegionHealthCheckServicesInsertCall) Header() http.Header { func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheckservice) if err != nil { return nil, err } @@ -6258,12 +6212,11 @@ func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6402,8 +6355,7 @@ func (c *RegionHealthCheckServicesPatchCall) Header() http.Header { func (c *RegionHealthCheckServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheckservice) if err != nil { return nil, err } @@ -6524,12 +6476,11 @@ func (c *RegionHealthChecksDeleteCall) Header() http.Header { func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6639,12 +6590,11 @@ func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6757,8 +6707,7 @@ func (c *RegionHealthChecksInsertCall) Header() http.Header { func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -6951,12 +6900,11 @@ func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7094,8 +7042,7 @@ func (c *RegionHealthChecksPatchCall) Header() http.Header { func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -7219,8 +7166,7 @@ func (c *RegionHealthChecksUpdateCall) Header() http.Header { func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.healthcheck) if err != nil { return nil, err } @@ -7354,8 +7300,7 @@ func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } @@ -7466,8 +7411,7 @@ func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.H func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersapplyupdatesrequest) if err != nil { return nil, err } @@ -7596,8 +7540,7 @@ func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } @@ -7719,12 +7662,11 @@ func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header { func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7849,8 +7791,7 @@ func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersdeleteinstancesrequest) if err != nil { return nil, err } @@ -7961,8 +7902,7 @@ func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerdeleteinstanceconfigreq) if err != nil { return nil, err } @@ -8080,12 +8020,11 @@ func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8204,8 +8143,7 @@ func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header { func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -8398,12 +8336,11 @@ func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8618,12 +8555,11 @@ func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8826,12 +8762,11 @@ func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Head func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9033,12 +8968,11 @@ func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.He func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9184,8 +9118,7 @@ func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header { func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancegroupmanager) if err != nil { return nil, err } @@ -9312,8 +9245,7 @@ func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.H func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerpatchinstanceconfigreq) if err != nil { return nil, err } @@ -9445,8 +9377,7 @@ func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersrecreaterequest) if err != nil { return nil, err } @@ -9579,12 +9510,11 @@ func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header { func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9711,8 +9641,7 @@ func (c *RegionInstanceGroupManagersResumeInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersresumeinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } @@ -9837,8 +9766,7 @@ func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Heade func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssettemplaterequest) if err != nil { return nil, err } @@ -9962,8 +9890,7 @@ func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header { func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } @@ -10097,8 +10024,7 @@ func (c *RegionInstanceGroupManagersStartInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstartinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } @@ -10238,8 +10164,7 @@ func (c *RegionInstanceGroupManagersStopInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstopinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } @@ -10380,8 +10305,7 @@ func (c *RegionInstanceGroupManagersSuspendInstancesCall) Header() http.Header { func (c *RegionInstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssuspendinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } @@ -10508,8 +10432,7 @@ func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupmanagerupdateinstanceconfigreq) if err != nil { return nil, err } @@ -10627,12 +10550,11 @@ func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10818,12 +10740,11 @@ func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11026,8 +10947,7 @@ func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header { func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupslistinstancesrequest) if err != nil { return nil, err } @@ -11174,8 +11094,7 @@ func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header { func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regioninstancegroupssetnamedportsrequest) if err != nil { return nil, err } @@ -11297,12 +11216,11 @@ func (c *RegionInstanceTemplatesDeleteCall) Header() http.Header { func (c *RegionInstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11412,12 +11330,11 @@ func (c *RegionInstanceTemplatesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11531,8 +11448,7 @@ func (c *RegionInstanceTemplatesInsertCall) Header() http.Header { func (c *RegionInstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancetemplate) if err != nil { return nil, err } @@ -11725,12 +11641,11 @@ func (c *RegionInstanceTemplatesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11864,8 +11779,7 @@ func (c *RegionInstancesBulkInsertCall) Header() http.Header { func (c *RegionInstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkinsertinstanceresource) if err != nil { return nil, err } @@ -11990,12 +11904,11 @@ func (c *RegionInstantSnapshotsDeleteCall) Header() http.Header { func (c *RegionInstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12105,12 +12018,11 @@ func (c *RegionInstantSnapshotsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12229,12 +12141,11 @@ func (c *RegionInstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12346,8 +12257,7 @@ func (c *RegionInstantSnapshotsInsertCall) Header() http.Header { func (c *RegionInstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantsnapshot) if err != nil { return nil, err } @@ -12540,12 +12450,11 @@ func (c *RegionInstantSnapshotsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instantSnapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12667,8 +12576,7 @@ func (c *RegionInstantSnapshotsSetIamPolicyCall) Header() http.Header { func (c *RegionInstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -12792,8 +12700,7 @@ func (c *RegionInstantSnapshotsSetLabelsCall) Header() http.Header { func (c *RegionInstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -12902,8 +12809,7 @@ func (c *RegionInstantSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *RegionInstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -13030,8 +12936,7 @@ func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.He func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsattachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionnetworkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } @@ -13155,12 +13060,11 @@ func (c *RegionNetworkEndpointGroupsDeleteCall) Header() http.Header { func (c *RegionNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13279,8 +13183,7 @@ func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.He func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionnetworkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } @@ -13400,12 +13303,11 @@ func (c *RegionNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13520,8 +13422,7 @@ func (c *RegionNetworkEndpointGroupsInsertCall) Header() http.Header { func (c *RegionNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkendpointgroup) if err != nil { return nil, err } @@ -13715,12 +13616,11 @@ func (c *RegionNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13921,12 +13821,11 @@ func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Head func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14073,8 +13972,7 @@ func (c *RegionNetworkFirewallPoliciesAddAssociationCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyassociation) if err != nil { return nil, err } @@ -14213,8 +14111,7 @@ func (c *RegionNetworkFirewallPoliciesAddRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -14342,12 +14239,11 @@ func (c *RegionNetworkFirewallPoliciesCloneRulesCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14460,12 +14356,11 @@ func (c *RegionNetworkFirewallPoliciesDeleteCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14575,12 +14470,11 @@ func (c *RegionNetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14698,12 +14592,11 @@ func (c *RegionNetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14813,12 +14706,11 @@ func (c *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14936,12 +14828,11 @@ func (c *RegionNetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15059,12 +14950,11 @@ func (c *RegionNetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15178,8 +15068,7 @@ func (c *RegionNetworkFirewallPoliciesInsertCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -15372,12 +15261,11 @@ func (c *RegionNetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15513,8 +15401,7 @@ func (c *RegionNetworkFirewallPoliciesPatchCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicy) if err != nil { return nil, err } @@ -15644,8 +15531,7 @@ func (c *RegionNetworkFirewallPoliciesPatchRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallpolicyrule) if err != nil { return nil, err } @@ -15774,12 +15660,11 @@ func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) Header() http.Heade func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -15899,12 +15784,11 @@ func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -16005,8 +15889,7 @@ func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -16115,8 +15998,7 @@ func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Head func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -16238,12 +16120,11 @@ func (c *RegionNotificationEndpointsDeleteCall) Header() http.Header { func (c *RegionNotificationEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16354,12 +16235,11 @@ func (c *RegionNotificationEndpointsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16473,8 +16353,7 @@ func (c *RegionNotificationEndpointsInsertCall) Header() http.Header { func (c *RegionNotificationEndpointsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationendpoint) if err != nil { return nil, err } @@ -16666,12 +16545,11 @@ func (c *RegionNotificationEndpointsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16791,12 +16669,11 @@ func (c *RegionOperationsDeleteCall) Header() http.Header { func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16884,12 +16761,11 @@ func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17075,12 +16951,11 @@ func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17209,12 +17084,11 @@ func (c *RegionOperationsWaitCall) Header() http.Header { func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17321,8 +17195,7 @@ func (c *RegionSecurityPoliciesAddRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -17443,12 +17316,11 @@ func (c *RegionSecurityPoliciesDeleteCall) Header() http.Header { func (c *RegionSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17558,12 +17430,11 @@ func (c *RegionSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17681,12 +17552,11 @@ func (c *RegionSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17807,8 +17677,7 @@ func (c *RegionSecurityPoliciesInsertCall) Header() http.Header { func (c *RegionSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -18001,12 +17870,11 @@ func (c *RegionSecurityPoliciesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18153,8 +18021,7 @@ func (c *RegionSecurityPoliciesPatchCall) Header() http.Header { func (c *RegionSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -18284,8 +18151,7 @@ func (c *RegionSecurityPoliciesPatchRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -18398,12 +18264,11 @@ func (c *RegionSecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *RegionSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -18519,8 +18384,7 @@ func (c *RegionSecurityPoliciesSetLabelsCall) Header() http.Header { func (c *RegionSecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -18641,12 +18505,11 @@ func (c *RegionSslCertificatesDeleteCall) Header() http.Header { func (c *RegionSslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18757,12 +18620,11 @@ func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18875,8 +18737,7 @@ func (c *RegionSslCertificatesInsertCall) Header() http.Header { func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertificate) if err != nil { return nil, err } @@ -19069,12 +18930,11 @@ func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19211,12 +19071,11 @@ func (c *RegionSslPoliciesDeleteCall) Header() http.Header { func (c *RegionSslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19327,12 +19186,11 @@ func (c *RegionSslPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19445,8 +19303,7 @@ func (c *RegionSslPoliciesInsertCall) Header() http.Header { func (c *RegionSslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -19639,12 +19496,11 @@ func (c *RegionSslPoliciesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19851,12 +19707,11 @@ func (c *RegionSslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19973,8 +19828,7 @@ func (c *RegionSslPoliciesPatchCall) Header() http.Header { func (c *RegionSslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -20095,12 +19949,11 @@ func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header { func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20210,12 +20063,11 @@ func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20329,8 +20181,7 @@ func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header { func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -20523,12 +20374,11 @@ func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20664,8 +20514,7 @@ func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header { func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -20786,12 +20635,11 @@ func (c *RegionTargetHttpsProxiesDeleteCall) Header() http.Header { func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20902,12 +20750,11 @@ func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21021,8 +20868,7 @@ func (c *RegionTargetHttpsProxiesInsertCall) Header() http.Header { func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -21215,12 +21061,11 @@ func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21358,8 +21203,7 @@ func (c *RegionTargetHttpsProxiesPatchCall) Header() http.Header { func (c *RegionTargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -21483,8 +21327,7 @@ func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header { func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regiontargethttpsproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -21607,8 +21450,7 @@ func (c *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header { func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -21729,12 +21571,11 @@ func (c *RegionTargetTcpProxiesDeleteCall) Header() http.Header { func (c *RegionTargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21844,12 +21685,11 @@ func (c *RegionTargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21962,8 +21802,7 @@ func (c *RegionTargetTcpProxiesInsertCall) Header() http.Header { func (c *RegionTargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxy) if err != nil { return nil, err } @@ -22156,12 +21995,11 @@ func (c *RegionTargetTcpProxiesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22287,12 +22125,11 @@ func (c *RegionUrlMapsDeleteCall) Header() http.Header { func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22402,12 +22239,11 @@ func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22512,8 +22348,7 @@ func (c *RegionUrlMapsInsertCall) Header() http.Header { func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -22706,12 +22541,11 @@ func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22840,8 +22674,7 @@ func (c *RegionUrlMapsPatchCall) Header() http.Header { func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -22957,8 +22790,7 @@ func (c *RegionUrlMapsUpdateCall) Header() http.Header { func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -23068,8 +22900,7 @@ func (c *RegionUrlMapsValidateCall) Header() http.Header { func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionurlmapsvalidaterequest) if err != nil { return nil, err } @@ -23264,12 +23095,11 @@ func (c *RegionZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23408,12 +23238,11 @@ func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23607,12 +23436,11 @@ func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23836,12 +23664,11 @@ func (c *ReservationsAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23974,12 +23801,11 @@ func (c *ReservationsDeleteCall) Header() http.Header { func (c *ReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24089,12 +23915,11 @@ func (c *ReservationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24212,12 +24037,11 @@ func (c *ReservationsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24330,8 +24154,7 @@ func (c *ReservationsInsertCall) Header() http.Header { func (c *ReservationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -24524,12 +24347,11 @@ func (c *ReservationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24666,8 +24488,7 @@ func (c *ReservationsResizeCall) Header() http.Header { func (c *ReservationsResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsresizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservationsresizerequest) if err != nil { return nil, err } @@ -24776,8 +24597,7 @@ func (c *ReservationsSetIamPolicyCall) Header() http.Header { func (c *ReservationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -24886,8 +24706,7 @@ func (c *ReservationsTestIamPermissionsCall) Header() http.Header { func (c *ReservationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -25024,8 +24843,7 @@ func (c *ReservationsUpdateCall) Header() http.Header { func (c *ReservationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation2) if err != nil { return nil, err } @@ -25238,12 +25056,11 @@ func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25376,12 +25193,11 @@ func (c *ResourcePoliciesDeleteCall) Header() http.Header { func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25491,12 +25307,11 @@ func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25614,12 +25429,11 @@ func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25731,8 +25545,7 @@ func (c *ResourcePoliciesInsertCall) Header() http.Header { func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcepolicy) if err != nil { return nil, err } @@ -25925,12 +25738,11 @@ func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26073,8 +25885,7 @@ func (c *ResourcePoliciesPatchCall) Header() http.Header { func (c *ResourcePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcepolicy) if err != nil { return nil, err } @@ -26183,8 +25994,7 @@ func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header { func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -26293,8 +26103,7 @@ func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header { func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -26508,12 +26317,11 @@ func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/routers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26646,12 +26454,11 @@ func (c *RoutersDeleteCall) Header() http.Header { func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26761,12 +26568,11 @@ func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26885,12 +26691,11 @@ func (c *RoutersGetNatIpInfoCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNatIpInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27089,12 +26894,11 @@ func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27226,12 +27030,11 @@ func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/getRouterStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27345,8 +27148,7 @@ func (c *RoutersInsertCall) Header() http.Header { func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router) if err != nil { return nil, err } @@ -27539,12 +27341,11 @@ func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27681,8 +27482,7 @@ func (c *RoutersPatchCall) Header() http.Header { func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -27791,8 +27591,7 @@ func (c *RoutersPreviewCall) Header() http.Header { func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -27919,8 +27718,7 @@ func (c *RoutersUpdateCall) Header() http.Header { func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.router2) if err != nil { return nil, err } @@ -28038,12 +27836,11 @@ func (c *RoutesDeleteCall) Header() http.Header { func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28149,12 +27946,11 @@ func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28263,8 +28059,7 @@ func (c *RoutesInsertCall) Header() http.Header { func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.route) if err != nil { return nil, err } @@ -28453,12 +28248,11 @@ func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28581,8 +28375,7 @@ func (c *SecurityPoliciesAddRuleCall) Header() http.Header { func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -28794,12 +28587,11 @@ func (c *SecurityPoliciesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28929,12 +28721,11 @@ func (c *SecurityPoliciesDeleteCall) Header() http.Header { func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29040,12 +28831,11 @@ func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29159,12 +28949,11 @@ func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29281,8 +29070,7 @@ func (c *SecurityPoliciesInsertCall) Header() http.Header { func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -29471,12 +29259,11 @@ func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29679,12 +29466,11 @@ func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29806,8 +29592,7 @@ func (c *SecurityPoliciesPatchCall) Header() http.Header { func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicy) if err != nil { return nil, err } @@ -29933,8 +29718,7 @@ func (c *SecurityPoliciesPatchRuleCall) Header() http.Header { func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyrule) if err != nil { return nil, err } @@ -30043,12 +29827,11 @@ func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header { func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30145,8 +29928,7 @@ func (c *SecurityPoliciesSetLabelsCall) Header() http.Header { func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -30359,12 +30141,11 @@ func (c *ServiceAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/serviceAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30497,12 +30278,11 @@ func (c *ServiceAttachmentsDeleteCall) Header() http.Header { func (c *ServiceAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30612,12 +30392,11 @@ func (c *ServiceAttachmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30736,12 +30515,11 @@ func (c *ServiceAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30854,8 +30632,7 @@ func (c *ServiceAttachmentsInsertCall) Header() http.Header { func (c *ServiceAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceattachment) if err != nil { return nil, err } @@ -31047,12 +30824,11 @@ func (c *ServiceAttachmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31192,8 +30968,7 @@ func (c *ServiceAttachmentsPatchCall) Header() http.Header { func (c *ServiceAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceattachment) if err != nil { return nil, err } @@ -31302,8 +31077,7 @@ func (c *ServiceAttachmentsSetIamPolicyCall) Header() http.Header { func (c *ServiceAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -31412,8 +31186,7 @@ func (c *ServiceAttachmentsTestIamPermissionsCall) Header() http.Header { func (c *ServiceAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -31526,12 +31299,11 @@ func (c *SnapshotSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshotSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31646,8 +31418,7 @@ func (c *SnapshotSettingsPatchCall) Header() http.Header { func (c *SnapshotSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshotsettings) if err != nil { return nil, err } @@ -31767,12 +31538,11 @@ func (c *SnapshotsDeleteCall) Header() http.Header { func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31878,12 +31648,11 @@ func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31997,12 +31766,11 @@ func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32113,8 +31881,7 @@ func (c *SnapshotsInsertCall) Header() http.Header { func (c *SnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -32303,12 +32070,11 @@ func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32425,8 +32191,7 @@ func (c *SnapshotsSetIamPolicyCall) Header() http.Header { func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -32531,8 +32296,7 @@ func (c *SnapshotsSetLabelsCall) Header() http.Header { func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetlabelsrequest) if err != nil { return nil, err } @@ -32637,8 +32401,7 @@ func (c *SnapshotsTestIamPermissionsCall) Header() http.Header { func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -32851,12 +32614,11 @@ func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32986,12 +32748,11 @@ func (c *SslCertificatesDeleteCall) Header() http.Header { func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33097,12 +32858,11 @@ func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33211,8 +32971,7 @@ func (c *SslCertificatesInsertCall) Header() http.Header { func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertificate) if err != nil { return nil, err } @@ -33401,12 +33160,11 @@ func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33631,12 +33389,11 @@ func (c *SslPoliciesAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33769,12 +33526,11 @@ func (c *SslPoliciesDeleteCall) Header() http.Header { func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33881,12 +33637,11 @@ func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33994,8 +33749,7 @@ func (c *SslPoliciesInsertCall) Header() http.Header { func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -34184,12 +33938,11 @@ func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34392,12 +34145,11 @@ func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/listAvailableFeatures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34510,8 +34262,7 @@ func (c *SslPoliciesPatchCall) Header() http.Header { func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicy) if err != nil { return nil, err } @@ -34723,12 +34474,11 @@ func (c *StoragePoolTypesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/storagePoolTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34858,12 +34608,11 @@ func (c *StoragePoolTypesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePoolTypes/{storagePoolType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35050,12 +34799,11 @@ func (c *StoragePoolTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePoolTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35281,12 +35029,11 @@ func (c *StoragePoolsAggregatedListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/storagePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35422,12 +35169,11 @@ func (c *StoragePoolsDeleteCall) Header() http.Header { func (c *StoragePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35538,12 +35284,11 @@ func (c *StoragePoolsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35661,12 +35406,11 @@ func (c *StoragePoolsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35779,8 +35523,7 @@ func (c *StoragePoolsInsertCall) Header() http.Header { func (c *StoragePoolsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storagepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storagepool) if err != nil { return nil, err } @@ -35972,12 +35715,11 @@ func (c *StoragePoolsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36186,12 +35928,11 @@ func (c *StoragePoolsListDisksCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/storagePools/{storagePool}/listDisks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36314,8 +36055,7 @@ func (c *StoragePoolsSetIamPolicyCall) Header() http.Header { func (c *StoragePoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zonesetpolicyrequest) if err != nil { return nil, err } @@ -36424,8 +36164,7 @@ func (c *StoragePoolsTestIamPermissionsCall) Header() http.Header { func (c *StoragePoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -36560,8 +36299,7 @@ func (c *StoragePoolsUpdateCall) Header() http.Header { func (c *StoragePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.storagepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.storagepool) if err != nil { return nil, err } @@ -36774,12 +36512,11 @@ func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/subnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36912,12 +36649,11 @@ func (c *SubnetworksDeleteCall) Header() http.Header { func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37033,8 +36769,7 @@ func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header { func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetworksexpandipcidrrangerequest) if err != nil { return nil, err } @@ -37152,12 +36887,11 @@ func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37275,12 +37009,11 @@ func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37393,8 +37126,7 @@ func (c *SubnetworksInsertCall) Header() http.Header { func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetwork) if err != nil { return nil, err } @@ -37586,12 +37318,11 @@ func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37794,12 +37525,11 @@ func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/subnetworks/listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37951,8 +37681,7 @@ func (c *SubnetworksPatchCall) Header() http.Header { func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetwork2) if err != nil { return nil, err } @@ -38061,8 +37790,7 @@ func (c *SubnetworksSetIamPolicyCall) Header() http.Header { func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetpolicyrequest) if err != nil { return nil, err } @@ -38187,8 +37915,7 @@ func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header { func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnetworkssetprivateipgoogleaccessrequest) if err != nil { return nil, err } @@ -38297,8 +38024,7 @@ func (c *SubnetworksTestIamPermissionsCall) Header() http.Header { func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -38417,12 +38143,11 @@ func (c *TargetGrpcProxiesDeleteCall) Header() http.Header { func (c *TargetGrpcProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38528,12 +38253,11 @@ func (c *TargetGrpcProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38643,8 +38367,7 @@ func (c *TargetGrpcProxiesInsertCall) Header() http.Header { func (c *TargetGrpcProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetgrpcproxy) if err != nil { return nil, err } @@ -38832,12 +38555,11 @@ func (c *TargetGrpcProxiesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38971,8 +38693,7 @@ func (c *TargetGrpcProxiesPatchCall) Header() http.Header { func (c *TargetGrpcProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetgrpcproxy) if err != nil { return nil, err } @@ -39185,12 +38906,11 @@ func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39320,12 +39040,11 @@ func (c *TargetHttpProxiesDeleteCall) Header() http.Header { func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39431,12 +39150,11 @@ func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39546,8 +39264,7 @@ func (c *TargetHttpProxiesInsertCall) Header() http.Header { func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -39736,12 +39453,11 @@ func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39875,8 +39591,7 @@ func (c *TargetHttpProxiesPatchCall) Header() http.Header { func (c *TargetHttpProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpproxy) if err != nil { return nil, err } @@ -39995,8 +39710,7 @@ func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header { func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -40209,12 +39923,11 @@ func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40344,12 +40057,11 @@ func (c *TargetHttpsProxiesDeleteCall) Header() http.Header { func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40455,12 +40167,11 @@ func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40570,8 +40281,7 @@ func (c *TargetHttpsProxiesInsertCall) Header() http.Header { func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -40760,12 +40470,11 @@ func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40899,8 +40608,7 @@ func (c *TargetHttpsProxiesPatchCall) Header() http.Header { func (c *TargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxy) if err != nil { return nil, err } @@ -41021,8 +40729,7 @@ func (c *TargetHttpsProxiesSetCertificateMapCall) Header() http.Header { func (c *TargetHttpsProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetcertificatemaprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetcertificatemaprequest) if err != nil { return nil, err } @@ -41142,8 +40849,7 @@ func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header { func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetquicoverriderequest) if err != nil { return nil, err } @@ -41263,8 +40969,7 @@ func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header { func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targethttpsproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -41388,8 +41093,7 @@ func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header { func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicyreference) if err != nil { return nil, err } @@ -41509,8 +41213,7 @@ func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header { func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapreference) if err != nil { return nil, err } @@ -41722,12 +41425,11 @@ func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41860,12 +41562,11 @@ func (c *TargetInstancesDeleteCall) Header() http.Header { func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41975,12 +41676,11 @@ func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42093,8 +41793,7 @@ func (c *TargetInstancesInsertCall) Header() http.Header { func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetinstance) if err != nil { return nil, err } @@ -42287,12 +41986,11 @@ func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42431,8 +42129,7 @@ func (c *TargetInstancesSetSecurityPolicyCall) Header() http.Header { func (c *TargetInstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -42555,8 +42252,7 @@ func (c *TargetPoolsAddHealthCheckCall) Header() http.Header { func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsaddhealthcheckrequest) if err != nil { return nil, err } @@ -42679,8 +42375,7 @@ func (c *TargetPoolsAddInstanceCall) Header() http.Header { func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsaddinstancerequest) if err != nil { return nil, err } @@ -42893,12 +42588,11 @@ func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43031,12 +42725,11 @@ func (c *TargetPoolsDeleteCall) Header() http.Header { func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43146,12 +42839,11 @@ func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43253,8 +42945,7 @@ func (c *TargetPoolsGetHealthCall) Header() http.Header { func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancereference) if err != nil { return nil, err } @@ -43376,8 +43067,7 @@ func (c *TargetPoolsInsertCall) Header() http.Header { func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpool) if err != nil { return nil, err } @@ -43570,12 +43260,11 @@ func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43710,8 +43399,7 @@ func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header { func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsremovehealthcheckrequest) if err != nil { return nil, err } @@ -43834,8 +43522,7 @@ func (c *TargetPoolsRemoveInstanceCall) Header() http.Header { func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetpoolsremoveinstancerequest) if err != nil { return nil, err } @@ -43965,8 +43652,7 @@ func (c *TargetPoolsSetBackupCall) Header() http.Header { func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetreference) if err != nil { return nil, err } @@ -44091,8 +43777,7 @@ func (c *TargetPoolsSetSecurityPolicyCall) Header() http.Header { func (c *TargetPoolsSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitypolicyreference) if err != nil { return nil, err } @@ -44210,12 +43895,11 @@ func (c *TargetSslProxiesDeleteCall) Header() http.Header { func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44321,12 +44005,11 @@ func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44435,8 +44118,7 @@ func (c *TargetSslProxiesInsertCall) Header() http.Header { func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxy) if err != nil { return nil, err } @@ -44625,12 +44307,11 @@ func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44763,8 +44444,7 @@ func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header { func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetbackendservicerequest) if err != nil { return nil, err } @@ -44885,8 +44565,7 @@ func (c *TargetSslProxiesSetCertificateMapCall) Header() http.Header { func (c *TargetSslProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetcertificatemaprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetcertificatemaprequest) if err != nil { return nil, err } @@ -45006,8 +44685,7 @@ func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header { func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetproxyheaderrequest) if err != nil { return nil, err } @@ -45127,8 +44805,7 @@ func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header { func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetsslproxiessetsslcertificatesrequest) if err != nil { return nil, err } @@ -45251,8 +44928,7 @@ func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header { func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslpolicyreference) if err != nil { return nil, err } @@ -45464,12 +45140,11 @@ func (c *TargetTcpProxiesAggregatedListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45599,12 +45274,11 @@ func (c *TargetTcpProxiesDeleteCall) Header() http.Header { func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45710,12 +45384,11 @@ func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45824,8 +45497,7 @@ func (c *TargetTcpProxiesInsertCall) Header() http.Header { func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxy) if err != nil { return nil, err } @@ -46014,12 +45686,11 @@ func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46152,8 +45823,7 @@ func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header { func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxiessetbackendservicerequest) if err != nil { return nil, err } @@ -46273,8 +45943,7 @@ func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header { func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targettcpproxiessetproxyheaderrequest) if err != nil { return nil, err } @@ -46486,12 +46155,11 @@ func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/targetVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46624,12 +46292,11 @@ func (c *TargetVpnGatewaysDeleteCall) Header() http.Header { func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46739,12 +46406,11 @@ func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46858,8 +46524,7 @@ func (c *TargetVpnGatewaysInsertCall) Header() http.Header { func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetvpngateway) if err != nil { return nil, err } @@ -47052,12 +46717,11 @@ func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47194,8 +46858,7 @@ func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header { func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -47408,12 +47071,11 @@ func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47543,12 +47205,11 @@ func (c *UrlMapsDeleteCall) Header() http.Header { func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47654,12 +47315,11 @@ func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47768,8 +47428,7 @@ func (c *UrlMapsInsertCall) Header() http.Header { func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -47889,8 +47548,7 @@ func (c *UrlMapsInvalidateCacheCall) Header() http.Header { func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cacheinvalidationrule) if err != nil { return nil, err } @@ -48080,12 +47738,11 @@ func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48218,8 +47875,7 @@ func (c *UrlMapsPatchCall) Header() http.Header { func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -48339,8 +47995,7 @@ func (c *UrlMapsUpdateCall) Header() http.Header { func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmap) if err != nil { return nil, err } @@ -48446,8 +48101,7 @@ func (c *UrlMapsValidateCall) Header() http.Header { func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlmapsvalidaterequest) if err != nil { return nil, err } @@ -48660,12 +48314,11 @@ func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/vpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48798,12 +48451,11 @@ func (c *VpnGatewaysDeleteCall) Header() http.Header { func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48913,12 +48565,11 @@ func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49028,12 +48679,11 @@ func (c *VpnGatewaysGetStatusCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49147,8 +48797,7 @@ func (c *VpnGatewaysInsertCall) Header() http.Header { func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpngateway) if err != nil { return nil, err } @@ -49341,12 +48990,11 @@ func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49482,8 +49130,7 @@ func (c *VpnGatewaysSetLabelsCall) Header() http.Header { func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -49592,8 +49239,7 @@ func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header { func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -49807,12 +49453,11 @@ func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/vpnTunnels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49945,12 +49590,11 @@ func (c *VpnTunnelsDeleteCall) Header() http.Header { func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50060,12 +49704,11 @@ func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50178,8 +49821,7 @@ func (c *VpnTunnelsInsertCall) Header() http.Header { func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpntunnel) if err != nil { return nil, err } @@ -50372,12 +50014,11 @@ func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50513,8 +50154,7 @@ func (c *VpnTunnelsSetLabelsCall) Header() http.Header { func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionsetlabelsrequest) if err != nil { return nil, err } @@ -50621,12 +50261,11 @@ func (c *ZoneOperationsDeleteCall) Header() http.Header { func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -50714,12 +50353,11 @@ func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50905,12 +50543,11 @@ func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51038,12 +50675,11 @@ func (c *ZoneOperationsWaitCall) Header() http.Header { func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}/wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -51150,12 +50786,11 @@ func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -51337,12 +50972,11 @@ func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/config/v1/config-gen.go b/config/v1/config-gen.go index 80e69639585..f39b4b7d5f5 100644 --- a/config/v1/config-gen.go +++ b/config/v1/config-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2143,12 +2142,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2274,12 +2272,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2417,8 +2414,7 @@ func (c *ProjectsLocationsDeploymentsCreateCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment) if err != nil { return nil, err } @@ -2560,12 +2556,11 @@ func (c *ProjectsLocationsDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2658,8 +2653,7 @@ func (c *ProjectsLocationsDeploymentsDeleteStateCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsDeleteStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deletestatefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deletestatefilerequest) if err != nil { return nil, err } @@ -2770,12 +2764,11 @@ func (c *ProjectsLocationsDeploymentsExportLockCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:exportLock") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2869,8 +2862,7 @@ func (c *ProjectsLocationsDeploymentsExportStateCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsExportStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportdeploymentstatefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportdeploymentstatefilerequest) if err != nil { return nil, err } @@ -2981,12 +2973,11 @@ func (c *ProjectsLocationsDeploymentsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3108,12 +3099,11 @@ func (c *ProjectsLocationsDeploymentsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3208,8 +3198,7 @@ func (c *ProjectsLocationsDeploymentsImportStateCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsImportStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importstatefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importstatefilerequest) if err != nil { return nil, err } @@ -3359,12 +3348,11 @@ func (c *ProjectsLocationsDeploymentsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3479,8 +3467,7 @@ func (c *ProjectsLocationsDeploymentsLockCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsLockCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lockdeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lockdeploymentrequest) if err != nil { return nil, err } @@ -3608,8 +3595,7 @@ func (c *ProjectsLocationsDeploymentsPatchCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment) if err != nil { return nil, err } @@ -3713,8 +3699,7 @@ func (c *ProjectsLocationsDeploymentsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3821,8 +3806,7 @@ func (c *ProjectsLocationsDeploymentsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsDeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3924,8 +3908,7 @@ func (c *ProjectsLocationsDeploymentsUnlockCall) Header() http.Header { func (c *ProjectsLocationsDeploymentsUnlockCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unlockdeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unlockdeploymentrequest) if err != nil { return nil, err } @@ -4028,8 +4011,7 @@ func (c *ProjectsLocationsDeploymentsRevisionsExportStateCall) Header() http.Hea func (c *ProjectsLocationsDeploymentsRevisionsExportStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportrevisionstatefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportrevisionstatefilerequest) if err != nil { return nil, err } @@ -4141,12 +4123,11 @@ func (c *ProjectsLocationsDeploymentsRevisionsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4289,12 +4270,11 @@ func (c *ProjectsLocationsDeploymentsRevisionsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4420,12 +4400,11 @@ func (c *ProjectsLocationsDeploymentsRevisionsResourcesGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4568,12 +4547,11 @@ func (c *ProjectsLocationsDeploymentsRevisionsResourcesListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4695,8 +4673,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4797,12 +4774,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4906,12 +4882,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5034,12 +5009,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5176,8 +5150,7 @@ func (c *ProjectsLocationsPreviewsCreateCall) Header() http.Header { func (c *ProjectsLocationsPreviewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.preview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.preview) if err != nil { return nil, err } @@ -5292,12 +5265,11 @@ func (c *ProjectsLocationsPreviewsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPreviewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5391,8 +5363,7 @@ func (c *ProjectsLocationsPreviewsExportCall) Header() http.Header { func (c *ProjectsLocationsPreviewsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportpreviewresultrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportpreviewresultrequest) if err != nil { return nil, err } @@ -5504,12 +5475,11 @@ func (c *ProjectsLocationsPreviewsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5651,12 +5621,11 @@ func (c *ProjectsLocationsPreviewsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/previews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5782,12 +5751,11 @@ func (c *ProjectsLocationsTerraformVersionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5927,12 +5895,11 @@ func (c *ProjectsLocationsTerraformVersionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/terraformVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/connectors/v1/connectors-gen.go b/connectors/v1/connectors-gen.go index d37cdae3d5d..669d6f729bd 100644 --- a/connectors/v1/connectors-gen.go +++ b/connectors/v1/connectors-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5970,12 +5969,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6078,12 +6076,11 @@ func (c *ProjectsLocationsGetRegionalSettingsCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6187,12 +6184,11 @@ func (c *ProjectsLocationsGetRuntimeConfigCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6318,12 +6314,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6445,8 +6440,7 @@ func (c *ProjectsLocationsUpdateRegionalSettingsCall) Header() http.Header { func (c *ProjectsLocationsUpdateRegionalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionalsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionalsettings) if err != nil { return nil, err } @@ -6555,8 +6549,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -6654,12 +6647,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6774,12 +6766,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6884,12 +6875,11 @@ func (c *ProjectsLocationsConnectionsGetConnectionSchemaMetadataCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7012,12 +7002,11 @@ func (c *ProjectsLocationsConnectionsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7157,12 +7146,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7276,8 +7264,7 @@ func (c *ProjectsLocationsConnectionsListenEventCall) Header() http.Header { func (c *ProjectsLocationsConnectionsListenEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listeneventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listeneventrequest) if err != nil { return nil, err } @@ -7391,8 +7378,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -7493,8 +7479,7 @@ func (c *ProjectsLocationsConnectionsRepairEventingCall) Header() http.Header { func (c *ProjectsLocationsConnectionsRepairEventingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repaireventingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repaireventingrequest) if err != nil { return nil, err } @@ -7625,12 +7610,11 @@ func (c *ProjectsLocationsConnectionsSearchCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7748,8 +7732,7 @@ func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7856,8 +7839,7 @@ func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7976,12 +7958,11 @@ func (c *ProjectsLocationsConnectionsConnectionSchemaMetadataGetActionCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getAction") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8092,12 +8073,11 @@ func (c *ProjectsLocationsConnectionsConnectionSchemaMetadataGetEntityTypeCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getEntityType") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8233,12 +8213,11 @@ func (c *ProjectsLocationsConnectionsConnectionSchemaMetadataListActionsCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listActions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8396,12 +8375,11 @@ func (c *ProjectsLocationsConnectionsConnectionSchemaMetadataListEntityTypesCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listEntityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8517,8 +8495,7 @@ func (c *ProjectsLocationsConnectionsConnectionSchemaMetadataRefreshCall) Header func (c *ProjectsLocationsConnectionsConnectionSchemaMetadataRefreshCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.refreshconnectionschemametadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.refreshconnectionschemametadatarequest) if err != nil { return nil, err } @@ -8628,8 +8605,7 @@ func (c *ProjectsLocationsConnectionsEventSubscriptionsCreateCall) Header() http func (c *ProjectsLocationsConnectionsEventSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventsubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventsubscription) if err != nil { return nil, err } @@ -8728,12 +8704,11 @@ func (c *ProjectsLocationsConnectionsEventSubscriptionsDeleteCall) Header() http func (c *ProjectsLocationsConnectionsEventSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8836,12 +8811,11 @@ func (c *ProjectsLocationsConnectionsEventSubscriptionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8969,12 +8943,11 @@ func (c *ProjectsLocationsConnectionsEventSubscriptionsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/eventSubscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9099,8 +9072,7 @@ func (c *ProjectsLocationsConnectionsEventSubscriptionsPatchCall) Header() http. func (c *ProjectsLocationsConnectionsEventSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventsubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventsubscription) if err != nil { return nil, err } @@ -9201,8 +9173,7 @@ func (c *ProjectsLocationsConnectionsEventSubscriptionsRetryCall) Header() http. func (c *ProjectsLocationsConnectionsEventSubscriptionsRetryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.retryeventsubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.retryeventsubscriptionrequest) if err != nil { return nil, err } @@ -9341,12 +9312,11 @@ func (c *ProjectsLocationsConnectionsRuntimeActionSchemasListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runtimeActionSchemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9492,12 +9462,11 @@ func (c *ProjectsLocationsConnectionsRuntimeEntitySchemasListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runtimeEntitySchemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9611,8 +9580,7 @@ func (c *ProjectsLocationsCustomConnectorsValidateCustomConnectorSpecCall) Heade func (c *ProjectsLocationsCustomConnectorsValidateCustomConnectorSpecCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatecustomconnectorspecrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validatecustomconnectorspecrequest) if err != nil { return nil, err } @@ -9713,12 +9681,11 @@ func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsDeleteCall) Hea func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9812,8 +9779,7 @@ func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsDeprecateCall) func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsDeprecateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecatecustomconnectorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deprecatecustomconnectorversionrequest) if err != nil { return nil, err } @@ -9916,8 +9882,7 @@ func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsPublishCall) He func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishcustomconnectorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publishcustomconnectorversionrequest) if err != nil { return nil, err } @@ -10020,8 +9985,7 @@ func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsWithdrawCall) H func (c *ProjectsLocationsCustomConnectorsCustomConnectorVersionsWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.withdrawcustomconnectorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.withdrawcustomconnectorversionrequest) if err != nil { return nil, err } @@ -10130,8 +10094,7 @@ func (c *ProjectsLocationsEndpointAttachmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsEndpointAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpointattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointattachment) if err != nil { return nil, err } @@ -10230,12 +10193,11 @@ func (c *ProjectsLocationsEndpointAttachmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10355,12 +10317,11 @@ func (c *ProjectsLocationsEndpointAttachmentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10505,12 +10466,11 @@ func (c *ProjectsLocationsEndpointAttachmentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpointAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10636,8 +10596,7 @@ func (c *ProjectsLocationsEndpointAttachmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsEndpointAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpointattachment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointattachment) if err != nil { return nil, err } @@ -10748,12 +10707,11 @@ func (c *ProjectsLocationsGlobalGetSettingsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10853,8 +10811,7 @@ func (c *ProjectsLocationsGlobalUpdateSettingsCall) Header() http.Header { func (c *ProjectsLocationsGlobalUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } @@ -10963,8 +10920,7 @@ func (c *ProjectsLocationsGlobalCustomConnectorsCreateCall) Header() http.Header func (c *ProjectsLocationsGlobalCustomConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customconnector) if err != nil { return nil, err } @@ -11071,12 +11027,11 @@ func (c *ProjectsLocationsGlobalCustomConnectorsDeleteCall) Header() http.Header func (c *ProjectsLocationsGlobalCustomConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11179,12 +11134,11 @@ func (c *ProjectsLocationsGlobalCustomConnectorsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11307,12 +11261,11 @@ func (c *ProjectsLocationsGlobalCustomConnectorsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customConnectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11438,8 +11391,7 @@ func (c *ProjectsLocationsGlobalCustomConnectorsPatchCall) Header() http.Header func (c *ProjectsLocationsGlobalCustomConnectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customconnector) if err != nil { return nil, err } @@ -11551,8 +11503,7 @@ func (c *ProjectsLocationsGlobalCustomConnectorsCustomConnectorVersionsCreateCal func (c *ProjectsLocationsGlobalCustomConnectorsCustomConnectorVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customconnectorversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customconnectorversion) if err != nil { return nil, err } @@ -11664,12 +11615,11 @@ func (c *ProjectsLocationsGlobalCustomConnectorsCustomConnectorVersionsGetCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11786,12 +11736,11 @@ func (c *ProjectsLocationsGlobalCustomConnectorsCustomConnectorVersionsListCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customConnectorVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11914,8 +11863,7 @@ func (c *ProjectsLocationsGlobalManagedZonesCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalManagedZonesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -12014,12 +11962,11 @@ func (c *ProjectsLocationsGlobalManagedZonesDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12122,12 +12069,11 @@ func (c *ProjectsLocationsGlobalManagedZonesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12254,12 +12200,11 @@ func (c *ProjectsLocationsGlobalManagedZonesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/managedZones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12384,8 +12329,7 @@ func (c *ProjectsLocationsGlobalManagedZonesPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalManagedZonesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -12493,8 +12437,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12595,12 +12538,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12704,12 +12646,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12832,12 +12773,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12962,12 +12902,11 @@ func (c *ProjectsLocationsProvidersGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13089,12 +13028,11 @@ func (c *ProjectsLocationsProvidersGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13209,12 +13147,11 @@ func (c *ProjectsLocationsProvidersListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/providers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13332,8 +13269,7 @@ func (c *ProjectsLocationsProvidersSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsProvidersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13440,8 +13376,7 @@ func (c *ProjectsLocationsProvidersTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsProvidersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -13554,12 +13489,11 @@ func (c *ProjectsLocationsProvidersConnectorsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13681,12 +13615,11 @@ func (c *ProjectsLocationsProvidersConnectorsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13825,12 +13758,11 @@ func (c *ProjectsLocationsProvidersConnectorsVersionsFetchAuthSchemaCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:fetchAuthSchema") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13948,12 +13880,11 @@ func (c *ProjectsLocationsProvidersConnectorsVersionsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14083,12 +14014,11 @@ func (c *ProjectsLocationsProvidersConnectorsVersionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14214,12 +14144,11 @@ func (c *ProjectsLocationsProvidersConnectorsVersionsEventtypesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14335,12 +14264,11 @@ func (c *ProjectsLocationsProvidersConnectorsVersionsEventtypesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/eventtypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/connectors/v2/connectors-gen.go b/connectors/v2/connectors-gen.go index 083d25a5523..3f01e12051e 100644 --- a/connectors/v2/connectors-gen.go +++ b/connectors/v2/connectors-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1997,12 +1996,11 @@ func (c *ProjectsLocationsConnectionsCheckReadinessCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:checkReadiness") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2109,12 +2107,11 @@ func (c *ProjectsLocationsConnectionsCheckStatusCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:checkStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2208,8 +2205,7 @@ func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) Header() http.Header func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exchangeauthcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exchangeauthcoderequest) if err != nil { return nil, err } @@ -2314,8 +2310,7 @@ func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) Header() http.Header { func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executesqlqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executesqlqueryrequest) if err != nil { return nil, err } @@ -2418,8 +2413,7 @@ func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) Header() http.Heade func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.refreshaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.refreshaccesstokenrequest) if err != nil { return nil, err } @@ -2524,8 +2518,7 @@ func (c *ProjectsLocationsConnectionsActionsExecuteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsActionsExecuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executeactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executeactionrequest) if err != nil { return nil, err } @@ -2638,12 +2631,11 @@ func (c *ProjectsLocationsConnectionsActionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2777,12 +2769,11 @@ func (c *ProjectsLocationsConnectionsActionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/actions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2908,12 +2899,11 @@ func (c *ProjectsLocationsConnectionsEntityTypesGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3048,12 +3038,11 @@ func (c *ProjectsLocationsConnectionsEntityTypesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3172,8 +3161,7 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) Header() htt func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entity) if err != nil { return nil, err } @@ -3274,12 +3262,11 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) Header() htt func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3385,12 +3372,11 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithCondit func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+entityType}/entities:deleteEntitiesWithConditions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3495,12 +3481,11 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3643,12 +3628,11 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3768,8 +3752,7 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) Header() http func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entity) if err != nil { return nil, err } @@ -3885,8 +3868,7 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithCondit func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entity) if err != nil { return nil, err } diff --git a/contactcenteraiplatform/v1alpha1/contactcenteraiplatform-gen.go b/contactcenteraiplatform/v1alpha1/contactcenteraiplatform-gen.go index 72fb88ae106..cd7298dddee 100644 --- a/contactcenteraiplatform/v1alpha1/contactcenteraiplatform-gen.go +++ b/contactcenteraiplatform/v1alpha1/contactcenteraiplatform-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1124,12 +1123,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1255,12 +1253,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1386,12 +1383,11 @@ func (c *ProjectsLocationsQueryContactCenterQuotaCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}:queryContactCenterQuota") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1508,8 +1504,7 @@ func (c *ProjectsLocationsContactCentersCreateCall) Header() http.Header { func (c *ProjectsLocationsContactCentersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.contactcenter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.contactcenter) if err != nil { return nil, err } @@ -1623,12 +1618,11 @@ func (c *ProjectsLocationsContactCentersDeleteCall) Header() http.Header { func (c *ProjectsLocationsContactCentersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1730,12 +1724,11 @@ func (c *ProjectsLocationsContactCentersGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1865,12 +1858,11 @@ func (c *ProjectsLocationsContactCentersListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/contactCenters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2011,8 +2003,7 @@ func (c *ProjectsLocationsContactCentersPatchCall) Header() http.Header { func (c *ProjectsLocationsContactCentersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.contactcenter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.contactcenter) if err != nil { return nil, err } @@ -2120,8 +2111,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -2222,12 +2212,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2331,12 +2320,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2459,12 +2447,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/contactcenterinsights/v1/contactcenterinsights-gen.go b/contactcenterinsights/v1/contactcenterinsights-gen.go index 65215c740a0..6031cc2a6d5 100644 --- a/contactcenterinsights/v1/contactcenterinsights-gen.go +++ b/contactcenterinsights/v1/contactcenterinsights-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9498,8 +9497,7 @@ func (c *ProjectsLocationsBulkDownloadFeedbackLabelsCall) Header() http.Header { func (c *ProjectsLocationsBulkDownloadFeedbackLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1bulkdownloadfeedbacklabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1bulkdownloadfeedbacklabelsrequest) if err != nil { return nil, err } @@ -9600,8 +9598,7 @@ func (c *ProjectsLocationsBulkUploadFeedbackLabelsCall) Header() http.Header { func (c *ProjectsLocationsBulkUploadFeedbackLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1bulkuploadfeedbacklabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1bulkuploadfeedbacklabelsrequest) if err != nil { return nil, err } @@ -9712,12 +9709,11 @@ func (c *ProjectsLocationsGetEncryptionSpecCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9820,12 +9816,11 @@ func (c *ProjectsLocationsGetSettingsCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9957,12 +9952,11 @@ func (c *ProjectsLocationsListAllFeedbackLabelsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:listAllFeedbackLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10077,8 +10071,7 @@ func (c *ProjectsLocationsQueryMetricsCall) Header() http.Header { func (c *ProjectsLocationsQueryMetricsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1querymetricsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1querymetricsrequest) if err != nil { return nil, err } @@ -10187,8 +10180,7 @@ func (c *ProjectsLocationsUpdateSettingsCall) Header() http.Header { func (c *ProjectsLocationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1settings) if err != nil { return nil, err } @@ -10291,8 +10283,7 @@ func (c *ProjectsLocationsAnalysisRulesCreateCall) Header() http.Header { func (c *ProjectsLocationsAnalysisRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1analysisrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1analysisrule) if err != nil { return nil, err } @@ -10391,12 +10382,11 @@ func (c *ProjectsLocationsAnalysisRulesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAnalysisRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10499,12 +10489,11 @@ func (c *ProjectsLocationsAnalysisRulesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10626,12 +10615,11 @@ func (c *ProjectsLocationsAnalysisRulesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/analysisRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10754,8 +10742,7 @@ func (c *ProjectsLocationsAnalysisRulesPatchCall) Header() http.Header { func (c *ProjectsLocationsAnalysisRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1analysisrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1analysisrule) if err != nil { return nil, err } @@ -10857,8 +10844,7 @@ func (c *ProjectsLocationsAuthorizedViewSetsAuthorizedViewsQueryMetricsCall) Hea func (c *ProjectsLocationsAuthorizedViewSetsAuthorizedViewsQueryMetricsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1querymetricsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1querymetricsrequest) if err != nil { return nil, err } @@ -10977,12 +10963,11 @@ func (c *ProjectsLocationsAuthorizedViewSetsAuthorizedViewsConversationsCalculat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/conversations:calculateStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11075,8 +11060,7 @@ func (c *ProjectsLocationsConversationsBulkAnalyzeCall) Header() http.Header { func (c *ProjectsLocationsConversationsBulkAnalyzeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1bulkanalyzeconversationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1bulkanalyzeconversationsrequest) if err != nil { return nil, err } @@ -11178,8 +11162,7 @@ func (c *ProjectsLocationsConversationsBulkDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversationsBulkDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1bulkdeleteconversationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1bulkdeleteconversationsrequest) if err != nil { return nil, err } @@ -11298,12 +11281,11 @@ func (c *ProjectsLocationsConversationsCalculateStatsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/conversations:calculateStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11407,8 +11389,7 @@ func (c *ProjectsLocationsConversationsCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1conversation) if err != nil { return nil, err } @@ -11515,12 +11496,11 @@ func (c *ProjectsLocationsConversationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11640,12 +11620,11 @@ func (c *ProjectsLocationsConversationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11739,8 +11718,7 @@ func (c *ProjectsLocationsConversationsIngestCall) Header() http.Header { func (c *ProjectsLocationsConversationsIngestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1ingestconversationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1ingestconversationsrequest) if err != nil { return nil, err } @@ -11906,12 +11884,11 @@ func (c *ProjectsLocationsConversationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12038,8 +12015,7 @@ func (c *ProjectsLocationsConversationsPatchCall) Header() http.Header { func (c *ProjectsLocationsConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1conversation) if err != nil { return nil, err } @@ -12142,8 +12118,7 @@ func (c *ProjectsLocationsConversationsUploadCall) Header() http.Header { func (c *ProjectsLocationsConversationsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1uploadconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1uploadconversationrequest) if err != nil { return nil, err } @@ -12245,8 +12220,7 @@ func (c *ProjectsLocationsConversationsAnalysesCreateCall) Header() http.Header func (c *ProjectsLocationsConversationsAnalysesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1analysis) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1analysis) if err != nil { return nil, err } @@ -12345,12 +12319,11 @@ func (c *ProjectsLocationsConversationsAnalysesDeleteCall) Header() http.Header func (c *ProjectsLocationsConversationsAnalysesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12453,12 +12426,11 @@ func (c *ProjectsLocationsConversationsAnalysesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12587,12 +12559,11 @@ func (c *ProjectsLocationsConversationsAnalysesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/analyses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12716,8 +12687,7 @@ func (c *ProjectsLocationsConversationsFeedbackLabelsCreateCall) Header() http.H func (c *ProjectsLocationsConversationsFeedbackLabelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1feedbacklabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1feedbacklabel) if err != nil { return nil, err } @@ -12816,12 +12786,11 @@ func (c *ProjectsLocationsConversationsFeedbackLabelsDeleteCall) Header() http.H func (c *ProjectsLocationsConversationsFeedbackLabelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12924,12 +12893,11 @@ func (c *ProjectsLocationsConversationsFeedbackLabelsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13063,12 +13031,11 @@ func (c *ProjectsLocationsConversationsFeedbackLabelsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/feedbackLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13191,8 +13158,7 @@ func (c *ProjectsLocationsConversationsFeedbackLabelsPatchCall) Header() http.He func (c *ProjectsLocationsConversationsFeedbackLabelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1feedbacklabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1feedbacklabel) if err != nil { return nil, err } @@ -13298,8 +13264,7 @@ func (c *ProjectsLocationsEncryptionSpecInitializeCall) Header() http.Header { func (c *ProjectsLocationsEncryptionSpecInitializeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1initializeencryptionspecrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1initializeencryptionspecrequest) if err != nil { return nil, err } @@ -13400,8 +13365,7 @@ func (c *ProjectsLocationsInsightsdataExportCall) Header() http.Header { func (c *ProjectsLocationsInsightsdataExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1exportinsightsdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1exportinsightsdatarequest) if err != nil { return nil, err } @@ -13512,12 +13476,11 @@ func (c *ProjectsLocationsIssueModelsCalculateIssueModelStatsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+issueModel}:calculateIssueModelStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13610,8 +13573,7 @@ func (c *ProjectsLocationsIssueModelsCreateCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1issuemodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1issuemodel) if err != nil { return nil, err } @@ -13710,12 +13672,11 @@ func (c *ProjectsLocationsIssueModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13810,8 +13771,7 @@ func (c *ProjectsLocationsIssueModelsDeployCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1deployissuemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1deployissuemodelrequest) if err != nil { return nil, err } @@ -13912,8 +13872,7 @@ func (c *ProjectsLocationsIssueModelsExportCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1exportissuemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1exportissuemodelrequest) if err != nil { return nil, err } @@ -14024,12 +13983,11 @@ func (c *ProjectsLocationsIssueModelsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14122,8 +14080,7 @@ func (c *ProjectsLocationsIssueModelsImportCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1importissuemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1importissuemodelrequest) if err != nil { return nil, err } @@ -14234,12 +14191,11 @@ func (c *ProjectsLocationsIssueModelsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/issueModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14340,8 +14296,7 @@ func (c *ProjectsLocationsIssueModelsPatchCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1issuemodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1issuemodel) if err != nil { return nil, err } @@ -14443,8 +14398,7 @@ func (c *ProjectsLocationsIssueModelsUndeployCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1undeployissuemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1undeployissuemodelrequest) if err != nil { return nil, err } @@ -14543,12 +14497,11 @@ func (c *ProjectsLocationsIssueModelsIssuesDeleteCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsIssuesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14651,12 +14604,11 @@ func (c *ProjectsLocationsIssueModelsIssuesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14759,12 +14711,11 @@ func (c *ProjectsLocationsIssueModelsIssuesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/issues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14866,8 +14817,7 @@ func (c *ProjectsLocationsIssueModelsIssuesPatchCall) Header() http.Header { func (c *ProjectsLocationsIssueModelsIssuesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1issue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1issue) if err != nil { return nil, err } @@ -14974,12 +14924,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -15084,12 +15033,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15213,12 +15161,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15334,8 +15281,7 @@ func (c *ProjectsLocationsPhraseMatchersCreateCall) Header() http.Header { func (c *ProjectsLocationsPhraseMatchersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1phrasematcher) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1phrasematcher) if err != nil { return nil, err } @@ -15434,12 +15380,11 @@ func (c *ProjectsLocationsPhraseMatchersDeleteCall) Header() http.Header { func (c *ProjectsLocationsPhraseMatchersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15542,12 +15487,11 @@ func (c *ProjectsLocationsPhraseMatchersGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15677,12 +15621,11 @@ func (c *ProjectsLocationsPhraseMatchersListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/phraseMatchers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15804,8 +15747,7 @@ func (c *ProjectsLocationsPhraseMatchersPatchCall) Header() http.Header { func (c *ProjectsLocationsPhraseMatchersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1phrasematcher) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1phrasematcher) if err != nil { return nil, err } @@ -15916,8 +15858,7 @@ func (c *ProjectsLocationsQaScorecardsCreateCall) Header() http.Header { func (c *ProjectsLocationsQaScorecardsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1qascorecard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1qascorecard) if err != nil { return nil, err } @@ -16024,12 +15965,11 @@ func (c *ProjectsLocationsQaScorecardsDeleteCall) Header() http.Header { func (c *ProjectsLocationsQaScorecardsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16132,12 +16072,11 @@ func (c *ProjectsLocationsQaScorecardsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16259,12 +16198,11 @@ func (c *ProjectsLocationsQaScorecardsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/qaScorecards") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16388,8 +16326,7 @@ func (c *ProjectsLocationsQaScorecardsPatchCall) Header() http.Header { func (c *ProjectsLocationsQaScorecardsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1qascorecard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1qascorecard) if err != nil { return nil, err } @@ -16501,8 +16438,7 @@ func (c *ProjectsLocationsQaScorecardsRevisionsCreateCall) Header() http.Header func (c *ProjectsLocationsQaScorecardsRevisionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1qascorecardrevision) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1qascorecardrevision) if err != nil { return nil, err } @@ -16609,12 +16545,11 @@ func (c *ProjectsLocationsQaScorecardsRevisionsDeleteCall) Header() http.Header func (c *ProjectsLocationsQaScorecardsRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16707,8 +16642,7 @@ func (c *ProjectsLocationsQaScorecardsRevisionsDeployCall) Header() http.Header func (c *ProjectsLocationsQaScorecardsRevisionsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1deployqascorecardrevisionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1deployqascorecardrevisionrequest) if err != nil { return nil, err } @@ -16819,12 +16753,11 @@ func (c *ProjectsLocationsQaScorecardsRevisionsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16956,12 +16889,11 @@ func (c *ProjectsLocationsQaScorecardsRevisionsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17075,8 +17007,7 @@ func (c *ProjectsLocationsQaScorecardsRevisionsTuneQaScorecardRevisionCall) Head func (c *ProjectsLocationsQaScorecardsRevisionsTuneQaScorecardRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1tuneqascorecardrevisionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1tuneqascorecardrevisionrequest) if err != nil { return nil, err } @@ -17177,8 +17108,7 @@ func (c *ProjectsLocationsQaScorecardsRevisionsUndeployCall) Header() http.Heade func (c *ProjectsLocationsQaScorecardsRevisionsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1undeployqascorecardrevisionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1undeployqascorecardrevisionrequest) if err != nil { return nil, err } @@ -17289,8 +17219,7 @@ func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsCreateCall) Header() h func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1qaquestion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1qaquestion) if err != nil { return nil, err } @@ -17389,12 +17318,11 @@ func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsDeleteCall) Header() h func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17497,12 +17425,11 @@ func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17624,12 +17551,11 @@ func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/qaQuestions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17755,8 +17681,7 @@ func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsPatchCall) Header() ht func (c *ProjectsLocationsQaScorecardsRevisionsQaQuestionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1qaquestion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1qaquestion) if err != nil { return nil, err } @@ -17858,8 +17783,7 @@ func (c *ProjectsLocationsViewsCreateCall) Header() http.Header { func (c *ProjectsLocationsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1view) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1view) if err != nil { return nil, err } @@ -17958,12 +17882,11 @@ func (c *ProjectsLocationsViewsDeleteCall) Header() http.Header { func (c *ProjectsLocationsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18066,12 +17989,11 @@ func (c *ProjectsLocationsViewsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18191,12 +18113,11 @@ func (c *ProjectsLocationsViewsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18318,8 +18239,7 @@ func (c *ProjectsLocationsViewsPatchCall) Header() http.Header { func (c *ProjectsLocationsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontactcenterinsightsv1view) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontactcenterinsightsv1view) if err != nil { return nil, err } diff --git a/container/v1/container-gen.go b/container/v1/container-gen.go index e45ae581436..3163dfe25ee 100644 --- a/container/v1/container-gen.go +++ b/container/v1/container-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7705,12 +7704,11 @@ func (c *ProjectsAggregatedUsableSubnetworksListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/aggregated/usableSubnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7854,12 +7852,11 @@ func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/serverConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7963,12 +7960,11 @@ func (c *ProjectsLocationsClustersCheckAutopilotCompatibilityCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:checkAutopilotCompatibility") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8063,8 +8059,7 @@ func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header { func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completeiprotationrequest) if err != nil { return nil, err } @@ -8173,8 +8168,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createclusterrequest) if err != nil { return nil, err } @@ -8303,12 +8297,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8437,12 +8430,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8546,12 +8538,11 @@ func (c *ProjectsLocationsClustersGetJwksCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jwks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8675,12 +8666,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8774,8 +8764,7 @@ func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header { func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setaddonsconfigrequest) if err != nil { return nil, err } @@ -8877,8 +8866,7 @@ func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header { func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlegacyabacrequest) if err != nil { return nil, err } @@ -8982,8 +8970,7 @@ func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header { func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlocationsrequest) if err != nil { return nil, err } @@ -9084,8 +9071,7 @@ func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header { func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setloggingservicerequest) if err != nil { return nil, err } @@ -9187,8 +9173,7 @@ func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmaintenancepolicyrequest) if err != nil { return nil, err } @@ -9291,8 +9276,7 @@ func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header { func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmasterauthrequest) if err != nil { return nil, err } @@ -9393,8 +9377,7 @@ func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header { func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmonitoringservicerequest) if err != nil { return nil, err } @@ -9496,8 +9479,7 @@ func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header { func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnetworkpolicyrequest) if err != nil { return nil, err } @@ -9598,8 +9580,7 @@ func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header { func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlabelsrequest) if err != nil { return nil, err } @@ -9700,8 +9681,7 @@ func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header { func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startiprotationrequest) if err != nil { return nil, err } @@ -9802,8 +9782,7 @@ func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header { func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateclusterrequest) if err != nil { return nil, err } @@ -9904,8 +9883,7 @@ func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header { func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatemasterrequest) if err != nil { return nil, err } @@ -10008,8 +9986,7 @@ func (c *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) Header() http.He func (c *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completenodepoolupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completenodepoolupgraderequest) if err != nil { return nil, err } @@ -10111,8 +10088,7 @@ func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createnodepoolrequest) if err != nil { return nil, err } @@ -10245,12 +10221,11 @@ func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10387,12 +10362,11 @@ func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10522,12 +10496,11 @@ func (c *ProjectsLocationsClustersNodePoolsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10623,8 +10596,7 @@ func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbacknodepoolupgraderequest) if err != nil { return nil, err } @@ -10726,8 +10698,7 @@ func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Hea func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolautoscalingrequest) if err != nil { return nil, err } @@ -10829,8 +10800,7 @@ func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Head func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolmanagementrequest) if err != nil { return nil, err } @@ -10934,8 +10904,7 @@ func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolsizerequest) if err != nil { return nil, err } @@ -11037,8 +11006,7 @@ func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatenodepoolrequest) if err != nil { return nil, err } @@ -11151,12 +11119,11 @@ func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/.well-known/openid-configuration") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11250,8 +11217,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -11388,12 +11354,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11515,12 +11480,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11640,12 +11604,11 @@ func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/serverconfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11751,8 +11714,7 @@ func (c *ProjectsZonesClustersAddonsCall) Header() http.Header { func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setaddonsconfigrequest) if err != nil { return nil, err } @@ -11867,8 +11829,7 @@ func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header { func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completeiprotationrequest) if err != nil { return nil, err } @@ -11987,8 +11948,7 @@ func (c *ProjectsZonesClustersCreateCall) Header() http.Header { func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createclusterrequest) if err != nil { return nil, err } @@ -12112,12 +12072,11 @@ func (c *ProjectsZonesClustersDeleteCall) Header() http.Header { func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12242,12 +12201,11 @@ func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12355,8 +12313,7 @@ func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header { func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlegacyabacrequest) if err != nil { return nil, err } @@ -12486,12 +12443,11 @@ func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12601,8 +12557,7 @@ func (c *ProjectsZonesClustersLocationsCall) Header() http.Header { func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlocationsrequest) if err != nil { return nil, err } @@ -12717,8 +12672,7 @@ func (c *ProjectsZonesClustersLoggingCall) Header() http.Header { func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setloggingservicerequest) if err != nil { return nil, err } @@ -12833,8 +12787,7 @@ func (c *ProjectsZonesClustersMasterCall) Header() http.Header { func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatemasterrequest) if err != nil { return nil, err } @@ -12949,8 +12902,7 @@ func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header { func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmonitoringservicerequest) if err != nil { return nil, err } @@ -13065,8 +13017,7 @@ func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header { func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlabelsrequest) if err != nil { return nil, err } @@ -13177,8 +13128,7 @@ func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header { func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmaintenancepolicyrequest) if err != nil { return nil, err } @@ -13295,8 +13245,7 @@ func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header { func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmasterauthrequest) if err != nil { return nil, err } @@ -13411,8 +13360,7 @@ func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header { func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnetworkpolicyrequest) if err != nil { return nil, err } @@ -13527,8 +13475,7 @@ func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header { func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startiprotationrequest) if err != nil { return nil, err } @@ -13643,8 +13590,7 @@ func (c *ProjectsZonesClustersUpdateCall) Header() http.Header { func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateclusterrequest) if err != nil { return nil, err } @@ -13763,8 +13709,7 @@ func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolautoscalingrequest) if err != nil { return nil, err } @@ -13880,8 +13825,7 @@ func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createnodepoolrequest) if err != nil { return nil, err } @@ -14006,12 +13950,11 @@ func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14141,12 +14084,11 @@ func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14272,12 +14214,11 @@ func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14390,8 +14331,7 @@ func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbacknodepoolupgraderequest) if err != nil { return nil, err } @@ -14511,8 +14451,7 @@ func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolmanagementrequest) if err != nil { return nil, err } @@ -14634,8 +14573,7 @@ func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolsizerequest) if err != nil { return nil, err } @@ -14755,8 +14693,7 @@ func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatenodepoolrequest) if err != nil { return nil, err } @@ -14872,8 +14809,7 @@ func (c *ProjectsZonesOperationsCancelCall) Header() http.Header { func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -15006,12 +14942,11 @@ func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15132,12 +15067,11 @@ func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/container/v1beta1/container-gen.go b/container/v1beta1/container-gen.go index 8522077f2e8..2974c1f2551 100644 --- a/container/v1beta1/container-gen.go +++ b/container/v1beta1/container-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -8676,12 +8675,11 @@ func (c *ProjectsAggregatedUsableSubnetworksListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/aggregated/usableSubnetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8825,12 +8823,11 @@ func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/serverConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8933,12 +8930,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9043,12 +9039,11 @@ func (c *ProjectsLocationsClustersCheckAutopilotCompatibilityCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:checkAutopilotCompatibility") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9143,8 +9138,7 @@ func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header { func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completeiprotationrequest) if err != nil { return nil, err } @@ -9253,8 +9247,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createclusterrequest) if err != nil { return nil, err } @@ -9383,12 +9376,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9499,12 +9491,11 @@ func (c *ProjectsLocationsClustersFetchClusterUpgradeInfoCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchClusterUpgradeInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9634,12 +9625,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9743,12 +9733,11 @@ func (c *ProjectsLocationsClustersGetJwksCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/jwks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9873,12 +9862,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9972,8 +9960,7 @@ func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header { func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setaddonsconfigrequest) if err != nil { return nil, err } @@ -10075,8 +10062,7 @@ func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header { func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlegacyabacrequest) if err != nil { return nil, err } @@ -10180,8 +10166,7 @@ func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header { func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlocationsrequest) if err != nil { return nil, err } @@ -10282,8 +10267,7 @@ func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header { func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setloggingservicerequest) if err != nil { return nil, err } @@ -10385,8 +10369,7 @@ func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmaintenancepolicyrequest) if err != nil { return nil, err } @@ -10489,8 +10472,7 @@ func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header { func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmasterauthrequest) if err != nil { return nil, err } @@ -10591,8 +10573,7 @@ func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header { func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmonitoringservicerequest) if err != nil { return nil, err } @@ -10694,8 +10675,7 @@ func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header { func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnetworkpolicyrequest) if err != nil { return nil, err } @@ -10796,8 +10776,7 @@ func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header { func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlabelsrequest) if err != nil { return nil, err } @@ -10898,8 +10877,7 @@ func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header { func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startiprotationrequest) if err != nil { return nil, err } @@ -11000,8 +10978,7 @@ func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header { func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateclusterrequest) if err != nil { return nil, err } @@ -11102,8 +11079,7 @@ func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header { func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatemasterrequest) if err != nil { return nil, err } @@ -11206,8 +11182,7 @@ func (c *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) Header() http.He func (c *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completenodepoolupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completenodepoolupgraderequest) if err != nil { return nil, err } @@ -11309,8 +11284,7 @@ func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createnodepoolrequest) if err != nil { return nil, err } @@ -11444,12 +11418,11 @@ func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11561,12 +11534,11 @@ func (c *ProjectsLocationsClustersNodePoolsFetchNodePoolUpgradeInfoCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchNodePoolUpgradeInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11705,12 +11677,11 @@ func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11840,12 +11811,11 @@ func (c *ProjectsLocationsClustersNodePoolsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/nodePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11941,8 +11911,7 @@ func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbacknodepoolupgraderequest) if err != nil { return nil, err } @@ -12044,8 +12013,7 @@ func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Hea func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolautoscalingrequest) if err != nil { return nil, err } @@ -12147,8 +12115,7 @@ func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Head func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolmanagementrequest) if err != nil { return nil, err } @@ -12252,8 +12219,7 @@ func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolsizerequest) if err != nil { return nil, err } @@ -12355,8 +12321,7 @@ func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header { func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatenodepoolrequest) if err != nil { return nil, err } @@ -12469,12 +12434,11 @@ func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/.well-known/openid-configuration") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12568,8 +12532,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12706,12 +12669,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12834,12 +12796,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12959,12 +12920,11 @@ func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/serverconfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13070,8 +13030,7 @@ func (c *ProjectsZonesClustersAddonsCall) Header() http.Header { func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setaddonsconfigrequest) if err != nil { return nil, err } @@ -13186,8 +13145,7 @@ func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header { func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completeiprotationrequest) if err != nil { return nil, err } @@ -13306,8 +13264,7 @@ func (c *ProjectsZonesClustersCreateCall) Header() http.Header { func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createclusterrequest) if err != nil { return nil, err } @@ -13431,12 +13388,11 @@ func (c *ProjectsZonesClustersDeleteCall) Header() http.Header { func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13549,12 +13505,11 @@ func (c *ProjectsZonesClustersFetchClusterUpgradeInfoCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchClusterUpgradeInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13678,12 +13633,11 @@ func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13791,8 +13745,7 @@ func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header { func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlegacyabacrequest) if err != nil { return nil, err } @@ -13922,12 +13875,11 @@ func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14037,8 +13989,7 @@ func (c *ProjectsZonesClustersLocationsCall) Header() http.Header { func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlocationsrequest) if err != nil { return nil, err } @@ -14153,8 +14104,7 @@ func (c *ProjectsZonesClustersLoggingCall) Header() http.Header { func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setloggingservicerequest) if err != nil { return nil, err } @@ -14269,8 +14219,7 @@ func (c *ProjectsZonesClustersMasterCall) Header() http.Header { func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatemasterrequest) if err != nil { return nil, err } @@ -14385,8 +14334,7 @@ func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header { func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmonitoringservicerequest) if err != nil { return nil, err } @@ -14501,8 +14449,7 @@ func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header { func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setlabelsrequest) if err != nil { return nil, err } @@ -14613,8 +14560,7 @@ func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header { func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmaintenancepolicyrequest) if err != nil { return nil, err } @@ -14731,8 +14677,7 @@ func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header { func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmasterauthrequest) if err != nil { return nil, err } @@ -14847,8 +14792,7 @@ func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header { func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnetworkpolicyrequest) if err != nil { return nil, err } @@ -14963,8 +14907,7 @@ func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header { func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startiprotationrequest) if err != nil { return nil, err } @@ -15079,8 +15022,7 @@ func (c *ProjectsZonesClustersUpdateCall) Header() http.Header { func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateclusterrequest) if err != nil { return nil, err } @@ -15199,8 +15141,7 @@ func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolautoscalingrequest) if err != nil { return nil, err } @@ -15316,8 +15257,7 @@ func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createnodepoolrequest) if err != nil { return nil, err } @@ -15442,12 +15382,11 @@ func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15562,12 +15501,11 @@ func (c *ProjectsZonesClustersNodePoolsFetchNodePoolUpgradeInfoCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchNodePoolUpgradeInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15695,12 +15633,11 @@ func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15826,12 +15763,11 @@ func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15944,8 +15880,7 @@ func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbacknodepoolupgraderequest) if err != nil { return nil, err } @@ -16065,8 +16000,7 @@ func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolmanagementrequest) if err != nil { return nil, err } @@ -16188,8 +16122,7 @@ func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setnodepoolsizerequest) if err != nil { return nil, err } @@ -16309,8 +16242,7 @@ func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header { func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatenodepoolrequest) if err != nil { return nil, err } @@ -16426,8 +16358,7 @@ func (c *ProjectsZonesOperationsCancelCall) Header() http.Header { func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -16560,12 +16491,11 @@ func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16686,12 +16616,11 @@ func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/zones/{zone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/containeranalysis/v1/containeranalysis-gen.go b/containeranalysis/v1/containeranalysis-gen.go index c1c56eeabe2..1c28fbcbb50 100644 --- a/containeranalysis/v1/containeranalysis-gen.go +++ b/containeranalysis/v1/containeranalysis-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6376,8 +6375,7 @@ func (c *ProjectsLocationsNotesBatchCreateCall) Header() http.Header { func (c *ProjectsLocationsNotesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatenotesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatenotesrequest) if err != nil { return nil, err } @@ -6486,8 +6484,7 @@ func (c *ProjectsLocationsNotesCreateCall) Header() http.Header { func (c *ProjectsLocationsNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -6586,12 +6583,11 @@ func (c *ProjectsLocationsNotesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6694,12 +6690,11 @@ func (c *ProjectsLocationsNotesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6798,8 +6793,7 @@ func (c *ProjectsLocationsNotesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -6931,12 +6925,11 @@ func (c *ProjectsLocationsNotesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7057,8 +7050,7 @@ func (c *ProjectsLocationsNotesPatchCall) Header() http.Header { func (c *ProjectsLocationsNotesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -7165,8 +7157,7 @@ func (c *ProjectsLocationsNotesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7273,8 +7264,7 @@ func (c *ProjectsLocationsNotesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7408,12 +7398,11 @@ func (c *ProjectsLocationsNotesOccurrencesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7528,8 +7517,7 @@ func (c *ProjectsLocationsOccurrencesBatchCreateCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateoccurrencesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateoccurrencesrequest) if err != nil { return nil, err } @@ -7631,8 +7619,7 @@ func (c *ProjectsLocationsOccurrencesCreateCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -7733,12 +7720,11 @@ func (c *ProjectsLocationsOccurrencesDeleteCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7841,12 +7827,11 @@ func (c *ProjectsLocationsOccurrencesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7945,8 +7930,7 @@ func (c *ProjectsLocationsOccurrencesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -8059,12 +8043,11 @@ func (c *ProjectsLocationsOccurrencesGetNotesCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8174,12 +8157,11 @@ func (c *ProjectsLocationsOccurrencesGetVulnerabilitySummaryCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/occurrences:vulnerabilitySummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8304,12 +8286,11 @@ func (c *ProjectsLocationsOccurrencesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8430,8 +8411,7 @@ func (c *ProjectsLocationsOccurrencesPatchCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -8538,8 +8518,7 @@ func (c *ProjectsLocationsOccurrencesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8646,8 +8625,7 @@ func (c *ProjectsLocationsOccurrencesTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsOccurrencesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8749,8 +8727,7 @@ func (c *ProjectsLocationsResourcesExportSBOMCall) Header() http.Header { func (c *ProjectsLocationsResourcesExportSBOMCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportsbomrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportsbomrequest) if err != nil { return nil, err } @@ -8852,8 +8829,7 @@ func (c *ProjectsNotesBatchCreateCall) Header() http.Header { func (c *ProjectsNotesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatenotesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatenotesrequest) if err != nil { return nil, err } @@ -8962,8 +8938,7 @@ func (c *ProjectsNotesCreateCall) Header() http.Header { func (c *ProjectsNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -9062,12 +9037,11 @@ func (c *ProjectsNotesDeleteCall) Header() http.Header { func (c *ProjectsNotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9170,12 +9144,11 @@ func (c *ProjectsNotesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9274,8 +9247,7 @@ func (c *ProjectsNotesGetIamPolicyCall) Header() http.Header { func (c *ProjectsNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -9407,12 +9379,11 @@ func (c *ProjectsNotesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9533,8 +9504,7 @@ func (c *ProjectsNotesPatchCall) Header() http.Header { func (c *ProjectsNotesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -9641,8 +9611,7 @@ func (c *ProjectsNotesSetIamPolicyCall) Header() http.Header { func (c *ProjectsNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9749,8 +9718,7 @@ func (c *ProjectsNotesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9884,12 +9852,11 @@ func (c *ProjectsNotesOccurrencesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10004,8 +9971,7 @@ func (c *ProjectsOccurrencesBatchCreateCall) Header() http.Header { func (c *ProjectsOccurrencesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateoccurrencesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateoccurrencesrequest) if err != nil { return nil, err } @@ -10107,8 +10073,7 @@ func (c *ProjectsOccurrencesCreateCall) Header() http.Header { func (c *ProjectsOccurrencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -10209,12 +10174,11 @@ func (c *ProjectsOccurrencesDeleteCall) Header() http.Header { func (c *ProjectsOccurrencesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10317,12 +10281,11 @@ func (c *ProjectsOccurrencesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10421,8 +10384,7 @@ func (c *ProjectsOccurrencesGetIamPolicyCall) Header() http.Header { func (c *ProjectsOccurrencesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -10535,12 +10497,11 @@ func (c *ProjectsOccurrencesGetNotesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10650,12 +10611,11 @@ func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/occurrences:vulnerabilitySummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10780,12 +10740,11 @@ func (c *ProjectsOccurrencesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10906,8 +10865,7 @@ func (c *ProjectsOccurrencesPatchCall) Header() http.Header { func (c *ProjectsOccurrencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -11014,8 +10972,7 @@ func (c *ProjectsOccurrencesSetIamPolicyCall) Header() http.Header { func (c *ProjectsOccurrencesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11122,8 +11079,7 @@ func (c *ProjectsOccurrencesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsOccurrencesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11225,8 +11181,7 @@ func (c *ProjectsResourcesExportSBOMCall) Header() http.Header { func (c *ProjectsResourcesExportSBOMCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportsbomrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportsbomrequest) if err != nil { return nil, err } diff --git a/containeranalysis/v1alpha1/containeranalysis-gen.go b/containeranalysis/v1alpha1/containeranalysis-gen.go index 20a1d37a373..2ac3852584f 100644 --- a/containeranalysis/v1alpha1/containeranalysis-gen.go +++ b/containeranalysis/v1alpha1/containeranalysis-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.Providers = NewProvidersService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.Providers = NewProvidersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7042,8 +7041,7 @@ func (c *ProjectsNotesCreateCall) Header() http.Header { func (c *ProjectsNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -7142,12 +7140,11 @@ func (c *ProjectsNotesDeleteCall) Header() http.Header { func (c *ProjectsNotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7250,12 +7247,11 @@ func (c *ProjectsNotesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7358,8 +7354,7 @@ func (c *ProjectsNotesGetIamPolicyCall) Header() http.Header { func (c *ProjectsNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -7497,12 +7492,11 @@ func (c *ProjectsNotesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7623,8 +7617,7 @@ func (c *ProjectsNotesPatchCall) Header() http.Header { func (c *ProjectsNotesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -7736,8 +7729,7 @@ func (c *ProjectsNotesSetIamPolicyCall) Header() http.Header { func (c *ProjectsNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7848,8 +7840,7 @@ func (c *ProjectsNotesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7983,12 +7974,11 @@ func (c *ProjectsNotesOccurrencesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8111,8 +8101,7 @@ func (c *ProjectsOccurrencesCreateCall) Header() http.Header { func (c *ProjectsOccurrencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -8212,12 +8201,11 @@ func (c *ProjectsOccurrencesDeleteCall) Header() http.Header { func (c *ProjectsOccurrencesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8320,12 +8308,11 @@ func (c *ProjectsOccurrencesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8428,8 +8415,7 @@ func (c *ProjectsOccurrencesGetIamPolicyCall) Header() http.Header { func (c *ProjectsOccurrencesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -8540,12 +8526,11 @@ func (c *ProjectsOccurrencesGetNotesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8654,12 +8639,11 @@ func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/occurrences:vulnerabilitySummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8831,12 +8815,11 @@ func (c *ProjectsOccurrencesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8957,8 +8940,7 @@ func (c *ProjectsOccurrencesPatchCall) Header() http.Header { func (c *ProjectsOccurrencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -9070,8 +9052,7 @@ func (c *ProjectsOccurrencesSetIamPolicyCall) Header() http.Header { func (c *ProjectsOccurrencesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9182,8 +9163,7 @@ func (c *ProjectsOccurrencesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsOccurrencesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9284,8 +9264,7 @@ func (c *ProjectsOperationsCreateCall) Header() http.Header { func (c *ProjectsOperationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createoperationrequest) if err != nil { return nil, err } @@ -9388,8 +9367,7 @@ func (c *ProjectsOperationsPatchCall) Header() http.Header { func (c *ProjectsOperationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateoperationrequest) if err != nil { return nil, err } @@ -9500,12 +9478,11 @@ func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9627,12 +9604,11 @@ func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/scanConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9753,8 +9729,7 @@ func (c *ProjectsScanConfigsPatchCall) Header() http.Header { func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -9868,8 +9843,7 @@ func (c *ProvidersNotesCreateCall) Header() http.Header { func (c *ProvidersNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -9968,12 +9942,11 @@ func (c *ProvidersNotesDeleteCall) Header() http.Header { func (c *ProvidersNotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10076,12 +10049,11 @@ func (c *ProvidersNotesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10184,8 +10156,7 @@ func (c *ProvidersNotesGetIamPolicyCall) Header() http.Header { func (c *ProvidersNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -10323,12 +10294,11 @@ func (c *ProvidersNotesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10449,8 +10419,7 @@ func (c *ProvidersNotesPatchCall) Header() http.Header { func (c *ProvidersNotesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -10562,8 +10531,7 @@ func (c *ProvidersNotesSetIamPolicyCall) Header() http.Header { func (c *ProvidersNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10674,8 +10642,7 @@ func (c *ProvidersNotesTestIamPermissionsCall) Header() http.Header { func (c *ProvidersNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10809,12 +10776,11 @@ func (c *ProvidersNotesOccurrencesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/containeranalysis/v1beta1/containeranalysis-gen.go b/containeranalysis/v1beta1/containeranalysis-gen.go index 7a675bb1dd9..3f77bec20bd 100644 --- a/containeranalysis/v1beta1/containeranalysis-gen.go +++ b/containeranalysis/v1beta1/containeranalysis-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6558,8 +6557,7 @@ func (c *ProjectsLocationsNotesBatchCreateCall) Header() http.Header { func (c *ProjectsLocationsNotesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatenotesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatenotesrequest) if err != nil { return nil, err } @@ -6668,8 +6666,7 @@ func (c *ProjectsLocationsNotesCreateCall) Header() http.Header { func (c *ProjectsLocationsNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -6768,12 +6765,11 @@ func (c *ProjectsLocationsNotesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6876,12 +6872,11 @@ func (c *ProjectsLocationsNotesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6980,8 +6975,7 @@ func (c *ProjectsLocationsNotesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -7113,12 +7107,11 @@ func (c *ProjectsLocationsNotesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7239,8 +7232,7 @@ func (c *ProjectsLocationsNotesPatchCall) Header() http.Header { func (c *ProjectsLocationsNotesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -7347,8 +7339,7 @@ func (c *ProjectsLocationsNotesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7455,8 +7446,7 @@ func (c *ProjectsLocationsNotesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7590,12 +7580,11 @@ func (c *ProjectsLocationsNotesOccurrencesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7710,8 +7699,7 @@ func (c *ProjectsLocationsOccurrencesBatchCreateCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateoccurrencesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateoccurrencesrequest) if err != nil { return nil, err } @@ -7813,8 +7801,7 @@ func (c *ProjectsLocationsOccurrencesCreateCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -7915,12 +7902,11 @@ func (c *ProjectsLocationsOccurrencesDeleteCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8023,12 +8009,11 @@ func (c *ProjectsLocationsOccurrencesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8127,8 +8112,7 @@ func (c *ProjectsLocationsOccurrencesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -8241,12 +8225,11 @@ func (c *ProjectsLocationsOccurrencesGetNotesCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8356,12 +8339,11 @@ func (c *ProjectsLocationsOccurrencesGetVulnerabilitySummaryCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/occurrences:vulnerabilitySummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8486,12 +8468,11 @@ func (c *ProjectsLocationsOccurrencesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8612,8 +8593,7 @@ func (c *ProjectsLocationsOccurrencesPatchCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -8720,8 +8700,7 @@ func (c *ProjectsLocationsOccurrencesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsOccurrencesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8828,8 +8807,7 @@ func (c *ProjectsLocationsOccurrencesTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsOccurrencesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8932,8 +8910,7 @@ func (c *ProjectsLocationsResourcesExportSBOMCall) Header() http.Header { func (c *ProjectsLocationsResourcesExportSBOMCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportsbomrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportsbomrequest) if err != nil { return nil, err } @@ -9036,8 +9013,7 @@ func (c *ProjectsLocationsResourcesGeneratePackagesSummaryCall) Header() http.He func (c *ProjectsLocationsResourcesGeneratePackagesSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatepackagessummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatepackagessummaryrequest) if err != nil { return nil, err } @@ -9139,8 +9115,7 @@ func (c *ProjectsNotesBatchCreateCall) Header() http.Header { func (c *ProjectsNotesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatenotesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatenotesrequest) if err != nil { return nil, err } @@ -9249,8 +9224,7 @@ func (c *ProjectsNotesCreateCall) Header() http.Header { func (c *ProjectsNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -9349,12 +9323,11 @@ func (c *ProjectsNotesDeleteCall) Header() http.Header { func (c *ProjectsNotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9457,12 +9430,11 @@ func (c *ProjectsNotesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9561,8 +9533,7 @@ func (c *ProjectsNotesGetIamPolicyCall) Header() http.Header { func (c *ProjectsNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -9694,12 +9665,11 @@ func (c *ProjectsNotesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9820,8 +9790,7 @@ func (c *ProjectsNotesPatchCall) Header() http.Header { func (c *ProjectsNotesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -9928,8 +9897,7 @@ func (c *ProjectsNotesSetIamPolicyCall) Header() http.Header { func (c *ProjectsNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10036,8 +10004,7 @@ func (c *ProjectsNotesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10171,12 +10138,11 @@ func (c *ProjectsNotesOccurrencesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10291,8 +10257,7 @@ func (c *ProjectsOccurrencesBatchCreateCall) Header() http.Header { func (c *ProjectsOccurrencesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateoccurrencesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateoccurrencesrequest) if err != nil { return nil, err } @@ -10394,8 +10359,7 @@ func (c *ProjectsOccurrencesCreateCall) Header() http.Header { func (c *ProjectsOccurrencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -10496,12 +10460,11 @@ func (c *ProjectsOccurrencesDeleteCall) Header() http.Header { func (c *ProjectsOccurrencesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10604,12 +10567,11 @@ func (c *ProjectsOccurrencesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10708,8 +10670,7 @@ func (c *ProjectsOccurrencesGetIamPolicyCall) Header() http.Header { func (c *ProjectsOccurrencesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -10822,12 +10783,11 @@ func (c *ProjectsOccurrencesGetNotesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10937,12 +10897,11 @@ func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/occurrences:vulnerabilitySummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11067,12 +11026,11 @@ func (c *ProjectsOccurrencesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/occurrences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11193,8 +11151,7 @@ func (c *ProjectsOccurrencesPatchCall) Header() http.Header { func (c *ProjectsOccurrencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.occurrence) if err != nil { return nil, err } @@ -11301,8 +11258,7 @@ func (c *ProjectsOccurrencesSetIamPolicyCall) Header() http.Header { func (c *ProjectsOccurrencesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11409,8 +11365,7 @@ func (c *ProjectsOccurrencesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsOccurrencesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11513,8 +11468,7 @@ func (c *ProjectsResourcesExportSBOMCall) Header() http.Header { func (c *ProjectsResourcesExportSBOMCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportsbomrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportsbomrequest) if err != nil { return nil, err } @@ -11617,8 +11571,7 @@ func (c *ProjectsResourcesGeneratePackagesSummaryCall) Header() http.Header { func (c *ProjectsResourcesGeneratePackagesSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatepackagessummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatepackagessummaryrequest) if err != nil { return nil, err } diff --git a/content/v2.1/content-gen.go b/content/v2.1/content-gen.go index 76a8543d2d3..2896494ec1b 100644 --- a/content/v2.1/content-gen.go +++ b/content/v2.1/content-gen.go @@ -114,25 +114,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new APIService. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*APIService, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &APIService{client: client, BasePath: basePath} s.Accounts = NewAccountsService(s) s.Accountstatuses = NewAccountstatusesService(s) @@ -164,9 +145,27 @@ func New(client *http.Client) (*APIService, error) { s.Returnpolicyonline = NewReturnpolicyonlineService(s) s.Shippingsettings = NewShippingsettingsService(s) s.Shoppingadsprogram = NewShoppingadsprogramService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new APIService. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*APIService, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type APIService struct { client *http.Client BasePath string // API endpoint base URL @@ -12890,12 +12889,11 @@ func (c *AccountsAuthinfoCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/authinfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12999,12 +12997,11 @@ func (c *AccountsClaimwebsiteCall) Header() http.Header { func (c *AccountsClaimwebsiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}/claimwebsite") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13095,8 +13092,7 @@ func (c *AccountsCustombatchCall) Header() http.Header { func (c *AccountsCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountscustombatchrequest) if err != nil { return nil, err } @@ -13203,12 +13199,11 @@ func (c *AccountsDeleteCall) Header() http.Header { func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13306,12 +13301,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13405,8 +13399,7 @@ func (c *AccountsInsertCall) Header() http.Header { func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -13512,8 +13505,7 @@ func (c *AccountsLinkCall) Header() http.Header { func (c *AccountsLinkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountslinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountslinkrequest) if err != nil { return nil, err } @@ -13667,12 +13659,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13818,12 +13809,11 @@ func (c *AccountsListlinksCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}/listlinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13944,8 +13934,7 @@ func (c *AccountsRequestphoneverificationCall) Header() http.Header { func (c *AccountsRequestphoneverificationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.requestphoneverificationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.requestphoneverificationrequest) if err != nil { return nil, err } @@ -14053,8 +14042,7 @@ func (c *AccountsUpdateCall) Header() http.Header { func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -14159,8 +14147,7 @@ func (c *AccountsUpdatelabelsCall) Header() http.Header { func (c *AccountsUpdatelabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountsupdatelabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountsupdatelabelsrequest) if err != nil { return nil, err } @@ -14270,8 +14257,7 @@ func (c *AccountsVerifyphonenumberCall) Header() http.Header { func (c *AccountsVerifyphonenumberCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifyphonenumberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifyphonenumberrequest) if err != nil { return nil, err } @@ -14375,8 +14361,7 @@ func (c *AccountsCredentialsCreateCall) Header() http.Header { func (c *AccountsCredentialsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountcredentials) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountcredentials) if err != nil { return nil, err } @@ -14477,8 +14462,7 @@ func (c *AccountsLabelsCreateCall) Header() http.Header { func (c *AccountsLabelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountlabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountlabel) if err != nil { return nil, err } @@ -14580,12 +14564,11 @@ func (c *AccountsLabelsDeleteCall) Header() http.Header { func (c *AccountsLabelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/labels/{labelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14683,12 +14666,11 @@ func (c *AccountsLabelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/labels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14805,8 +14787,7 @@ func (c *AccountsLabelsPatchCall) Header() http.Header { func (c *AccountsLabelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountlabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountlabel) if err != nil { return nil, err } @@ -14908,8 +14889,7 @@ func (c *AccountsReturncarrierCreateCall) Header() http.Header { func (c *AccountsReturncarrierCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountreturncarrier) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountreturncarrier) if err != nil { return nil, err } @@ -15013,12 +14993,11 @@ func (c *AccountsReturncarrierDeleteCall) Header() http.Header { func (c *AccountsReturncarrierDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/returncarrier/{carrierAccountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15099,12 +15078,11 @@ func (c *AccountsReturncarrierListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/returncarrier") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15202,8 +15180,7 @@ func (c *AccountsReturncarrierPatchCall) Header() http.Header { func (c *AccountsReturncarrierPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountreturncarrier) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountreturncarrier) if err != nil { return nil, err } @@ -15302,8 +15279,7 @@ func (c *AccountstatusesCustombatchCall) Header() http.Header { func (c *AccountstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountstatusescustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountstatusescustombatchrequest) if err != nil { return nil, err } @@ -15425,12 +15401,11 @@ func (c *AccountstatusesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15564,12 +15539,11 @@ func (c *AccountstatusesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15680,8 +15654,7 @@ func (c *AccounttaxCustombatchCall) Header() http.Header { func (c *AccounttaxCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttaxcustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accounttaxcustombatchrequest) if err != nil { return nil, err } @@ -15795,12 +15768,11 @@ func (c *AccounttaxGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15919,12 +15891,11 @@ func (c *AccounttaxListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16045,8 +16016,7 @@ func (c *AccounttaxUpdateCall) Header() http.Header { func (c *AccounttaxUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accounttax) if err != nil { return nil, err } @@ -16151,8 +16121,7 @@ func (c *CollectionsCreateCall) Header() http.Header { func (c *CollectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.collection) if err != nil { return nil, err } @@ -16255,12 +16224,11 @@ func (c *CollectionsDeleteCall) Header() http.Header { func (c *CollectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/collections/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16344,12 +16312,11 @@ func (c *CollectionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/collections/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16471,12 +16438,11 @@ func (c *CollectionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/collections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16605,12 +16571,11 @@ func (c *CollectionstatusesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/collectionstatuses/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16731,12 +16696,11 @@ func (c *CollectionstatusesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/collectionstatuses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16850,8 +16814,7 @@ func (c *ConversionsourcesCreateCall) Header() http.Header { func (c *ConversionsourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionsource) if err != nil { return nil, err } @@ -16955,12 +16918,11 @@ func (c *ConversionsourcesDeleteCall) Header() http.Header { func (c *ConversionsourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources/{conversionSourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17043,12 +17005,11 @@ func (c *ConversionsourcesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources/{conversionSourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17175,12 +17136,11 @@ func (c *ConversionsourcesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17304,8 +17264,7 @@ func (c *ConversionsourcesPatchCall) Header() http.Header { func (c *ConversionsourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionsource) if err != nil { return nil, err } @@ -17410,8 +17369,7 @@ func (c *ConversionsourcesUndeleteCall) Header() http.Header { func (c *ConversionsourcesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteconversionsourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteconversionsourcerequest) if err != nil { return nil, err } @@ -17505,12 +17463,11 @@ func (c *CssesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{cssGroupId}/csses/{cssDomainId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17631,12 +17588,11 @@ func (c *CssesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{cssGroupId}/csses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17754,8 +17710,7 @@ func (c *CssesUpdatelabelsCall) Header() http.Header { func (c *CssesUpdatelabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.labelids) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.labelids) if err != nil { return nil, err } @@ -17853,8 +17808,7 @@ func (c *DatafeedsCustombatchCall) Header() http.Header { func (c *DatafeedsCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datafeedscustombatchrequest) if err != nil { return nil, err } @@ -17954,12 +17908,11 @@ func (c *DatafeedsDeleteCall) Header() http.Header { func (c *DatafeedsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18035,12 +17988,11 @@ func (c *DatafeedsFetchnowCall) Header() http.Header { func (c *DatafeedsFetchnowCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}/fetchNow") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -18148,12 +18100,11 @@ func (c *DatafeedsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18248,8 +18199,7 @@ func (c *DatafeedsInsertCall) Header() http.Header { func (c *DatafeedsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datafeed) if err != nil { return nil, err } @@ -18375,12 +18325,11 @@ func (c *DatafeedsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18499,8 +18448,7 @@ func (c *DatafeedsUpdateCall) Header() http.Header { func (c *DatafeedsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datafeed) if err != nil { return nil, err } @@ -18598,8 +18546,7 @@ func (c *DatafeedstatusesCustombatchCall) Header() http.Header { func (c *DatafeedstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedstatusescustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datafeedstatusescustombatchrequest) if err != nil { return nil, err } @@ -18741,12 +18688,11 @@ func (c *DatafeedstatusesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses/{datafeedId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18864,12 +18810,11 @@ func (c *DatafeedstatusesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18996,12 +18941,11 @@ func (c *FreelistingsprogramGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/freelistingsprogram") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19096,8 +19040,7 @@ func (c *FreelistingsprogramRequestreviewCall) Header() http.Header { func (c *FreelistingsprogramRequestreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.requestreviewfreelistingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.requestreviewfreelistingsrequest) if err != nil { return nil, err } @@ -19173,12 +19116,11 @@ func (c *FreelistingsprogramCheckoutsettingsDeleteCall) Header() http.Header { func (c *FreelistingsprogramCheckoutsettingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/freelistingsprogram/checkoutsettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19258,12 +19200,11 @@ func (c *FreelistingsprogramCheckoutsettingsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/freelistingsprogram/checkoutsettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19356,8 +19297,7 @@ func (c *FreelistingsprogramCheckoutsettingsInsertCall) Header() http.Header { func (c *FreelistingsprogramCheckoutsettingsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertcheckoutsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.insertcheckoutsettingsrequest) if err != nil { return nil, err } @@ -19455,8 +19395,7 @@ func (c *LiasettingsCustombatchCall) Header() http.Header { func (c *LiasettingsCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.liasettingscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.liasettingscustombatchrequest) if err != nil { return nil, err } @@ -19569,12 +19508,11 @@ func (c *LiasettingsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19684,12 +19622,11 @@ func (c *LiasettingsGetaccessiblegmbaccountsCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/accessiblegmbaccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19809,12 +19746,11 @@ func (c *LiasettingsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19935,12 +19871,11 @@ func (c *LiasettingsListposdataprovidersCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "liasettings/posdataproviders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20036,12 +19971,11 @@ func (c *LiasettingsRequestgmbaccessCall) Header() http.Header { func (c *LiasettingsRequestgmbaccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/requestgmbaccess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20143,12 +20077,11 @@ func (c *LiasettingsRequestinventoryverificationCall) Header() http.Header { func (c *LiasettingsRequestinventoryverificationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/requestinventoryverification/{country}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20256,12 +20189,11 @@ func (c *LiasettingsSetinventoryverificationcontactCall) Header() http.Header { func (c *LiasettingsSetinventoryverificationcontactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/setinventoryverificationcontact") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20388,12 +20320,11 @@ func (c *LiasettingsSetomnichannelexperienceCall) Header() http.Header { func (c *LiasettingsSetomnichannelexperienceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/setomnichannelexperience") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20507,12 +20438,11 @@ func (c *LiasettingsSetposdataproviderCall) Header() http.Header { func (c *LiasettingsSetposdataproviderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/setposdataprovider") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -20612,8 +20542,7 @@ func (c *LiasettingsUpdateCall) Header() http.Header { func (c *LiasettingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.liasettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.liasettings) if err != nil { return nil, err } @@ -20711,8 +20640,7 @@ func (c *LocalinventoryCustombatchCall) Header() http.Header { func (c *LocalinventoryCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.localinventorycustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.localinventorycustombatchrequest) if err != nil { return nil, err } @@ -20815,8 +20743,7 @@ func (c *LocalinventoryInsertCall) Header() http.Header { func (c *LocalinventoryInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.localinventory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.localinventory) if err != nil { return nil, err } @@ -20936,8 +20863,7 @@ func (c *MerchantsupportRenderaccountissuesCall) Header() http.Header { func (c *MerchantsupportRenderaccountissuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renderaccountissuesrequestpayload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renderaccountissuesrequestpayload) if err != nil { return nil, err } @@ -21062,8 +20988,7 @@ func (c *MerchantsupportRenderproductissuesCall) Header() http.Header { func (c *MerchantsupportRenderproductissuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renderproductissuesrequestpayload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renderproductissuesrequestpayload) if err != nil { return nil, err } @@ -21180,8 +21105,7 @@ func (c *MerchantsupportTriggeractionCall) Header() http.Header { func (c *MerchantsupportTriggeractionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.triggeractionpayload) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.triggeractionpayload) if err != nil { return nil, err } @@ -21282,8 +21206,7 @@ func (c *OrdertrackingsignalsCreateCall) Header() http.Header { func (c *OrdertrackingsignalsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordertrackingsignal) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ordertrackingsignal) if err != nil { return nil, err } @@ -21380,8 +21303,7 @@ func (c *PosCustombatchCall) Header() http.Header { func (c *PosCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.poscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.poscustombatchrequest) if err != nil { return nil, err } @@ -21483,12 +21405,11 @@ func (c *PosDeleteCall) Header() http.Header { func (c *PosDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store/{storeCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21575,12 +21496,11 @@ func (c *PosGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store/{storeCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21677,8 +21597,7 @@ func (c *PosInsertCall) Header() http.Header { func (c *PosInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.posstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.posstore) if err != nil { return nil, err } @@ -21782,8 +21701,7 @@ func (c *PosInventoryCall) Header() http.Header { func (c *PosInventoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.posinventoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.posinventoryrequest) if err != nil { return nil, err } @@ -21898,12 +21816,11 @@ func (c *PosListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22000,8 +21917,7 @@ func (c *PosSaleCall) Header() http.Header { func (c *PosSaleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.possalerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.possalerequest) if err != nil { return nil, err } @@ -22104,8 +22020,7 @@ func (c *ProductdeliverytimeCreateCall) Header() http.Header { func (c *ProductdeliverytimeCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productdeliverytime) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productdeliverytime) if err != nil { return nil, err } @@ -22209,12 +22124,11 @@ func (c *ProductdeliverytimeDeleteCall) Header() http.Header { func (c *ProductdeliverytimeDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productdeliverytime/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22299,12 +22213,11 @@ func (c *ProductdeliverytimeGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productdeliverytime/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22395,8 +22308,7 @@ func (c *ProductsCustombatchCall) Header() http.Header { func (c *ProductsCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productscustombatchrequest) if err != nil { return nil, err } @@ -22504,12 +22416,11 @@ func (c *ProductsDeleteCall) Header() http.Header { func (c *ProductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22593,12 +22504,11 @@ func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22702,8 +22612,7 @@ func (c *ProductsInsertCall) Header() http.Header { func (c *ProductsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.product) if err != nil { return nil, err } @@ -22831,12 +22740,11 @@ func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22967,8 +22875,7 @@ func (c *ProductsUpdateCall) Header() http.Header { func (c *ProductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.product) if err != nil { return nil, err } @@ -23065,8 +22972,7 @@ func (c *ProductstatusesCustombatchCall) Header() http.Header { func (c *ProductstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productstatusescustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productstatusescustombatchrequest) if err != nil { return nil, err } @@ -23186,12 +23092,11 @@ func (c *ProductstatusesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23318,12 +23223,11 @@ func (c *ProductstatusesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23442,8 +23346,7 @@ func (c *PromotionsCreateCall) Header() http.Header { func (c *PromotionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promotion) if err != nil { return nil, err } @@ -23556,12 +23459,11 @@ func (c *PromotionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/promotions/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23697,12 +23599,11 @@ func (c *PromotionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/promotions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23827,12 +23728,11 @@ func (c *PubsubnotificationsettingsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pubsubnotificationsettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23926,8 +23826,7 @@ func (c *PubsubnotificationsettingsUpdateCall) Header() http.Header { func (c *PubsubnotificationsettingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pubsubnotificationsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pubsubnotificationsettings) if err != nil { return nil, err } @@ -24056,12 +23955,11 @@ func (c *QuotasListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/quotas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24206,12 +24104,11 @@ func (c *RecommendationsGenerateCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/recommendations/generate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24305,8 +24202,7 @@ func (c *RecommendationsReportInteractionCall) Header() http.Header { func (c *RecommendationsReportInteractionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportinteractionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportinteractionrequest) if err != nil { return nil, err } @@ -24380,8 +24276,7 @@ func (c *RegionalinventoryCustombatchCall) Header() http.Header { func (c *RegionalinventoryCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionalinventorycustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionalinventorycustombatchrequest) if err != nil { return nil, err } @@ -24486,8 +24381,7 @@ func (c *RegionalinventoryInsertCall) Header() http.Header { func (c *RegionalinventoryInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionalinventory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionalinventory) if err != nil { return nil, err } @@ -24596,8 +24490,7 @@ func (c *RegionsCreateCall) Header() http.Header { func (c *RegionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.region) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.region) if err != nil { return nil, err } @@ -24698,12 +24591,11 @@ func (c *RegionsDeleteCall) Header() http.Header { func (c *RegionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/regions/{regionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24787,12 +24679,11 @@ func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/regions/{regionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24913,12 +24804,11 @@ func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/regions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25043,8 +24933,7 @@ func (c *RegionsPatchCall) Header() http.Header { func (c *RegionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.region) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.region) if err != nil { return nil, err } @@ -25147,8 +25036,7 @@ func (c *ReportsSearchCall) Header() http.Header { func (c *ReportsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchrequest) if err != nil { return nil, err } @@ -25266,8 +25154,7 @@ func (c *ReturnaddressCustombatchCall) Header() http.Header { func (c *ReturnaddressCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnaddresscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnaddresscustombatchrequest) if err != nil { return nil, err } @@ -25367,12 +25254,11 @@ func (c *ReturnaddressDeleteCall) Header() http.Header { func (c *ReturnaddressDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnaddress/{returnAddressId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25455,12 +25341,11 @@ func (c *ReturnaddressGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnaddress/{returnAddressId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25553,8 +25438,7 @@ func (c *ReturnaddressInsertCall) Header() http.Header { func (c *ReturnaddressInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnaddress) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnaddress) if err != nil { return nil, err } @@ -25686,12 +25570,11 @@ func (c *ReturnaddressListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnaddress") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25802,8 +25685,7 @@ func (c *ReturnpolicyCustombatchCall) Header() http.Header { func (c *ReturnpolicyCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnpolicycustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnpolicycustombatchrequest) if err != nil { return nil, err } @@ -25903,12 +25785,11 @@ func (c *ReturnpolicyDeleteCall) Header() http.Header { func (c *ReturnpolicyDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnpolicy/{returnPolicyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25991,12 +25872,11 @@ func (c *ReturnpolicyGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnpolicy/{returnPolicyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26089,8 +25969,7 @@ func (c *ReturnpolicyInsertCall) Header() http.Header { func (c *ReturnpolicyInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnpolicy) if err != nil { return nil, err } @@ -26200,12 +26079,11 @@ func (c *ReturnpolicyListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnpolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26299,8 +26177,7 @@ func (c *ReturnpolicyonlineCreateCall) Header() http.Header { func (c *ReturnpolicyonlineCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnpolicyonline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnpolicyonline) if err != nil { return nil, err } @@ -26403,12 +26280,11 @@ func (c *ReturnpolicyonlineDeleteCall) Header() http.Header { func (c *ReturnpolicyonlineDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnpolicyonline/{returnPolicyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26492,12 +26368,11 @@ func (c *ReturnpolicyonlineGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnpolicyonline/{returnPolicyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26602,12 +26477,11 @@ func (c *ReturnpolicyonlineListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/returnpolicyonline") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26704,8 +26578,7 @@ func (c *ReturnpolicyonlinePatchCall) Header() http.Header { func (c *ReturnpolicyonlinePatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnpolicyonline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.returnpolicyonline) if err != nil { return nil, err } @@ -26804,8 +26677,7 @@ func (c *ShippingsettingsCustombatchCall) Header() http.Header { func (c *ShippingsettingsCustombatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettingscustombatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shippingsettingscustombatchrequest) if err != nil { return nil, err } @@ -26919,12 +26791,11 @@ func (c *ShippingsettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shippingsettings/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27030,12 +26901,11 @@ func (c *ShippingsettingsGetsupportedcarriersCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/supportedCarriers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27139,12 +27009,11 @@ func (c *ShippingsettingsGetsupportedholidaysCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/supportedHolidays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27249,12 +27118,11 @@ func (c *ShippingsettingsGetsupportedpickupservicesCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/supportedPickupServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27373,12 +27241,11 @@ func (c *ShippingsettingsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shippingsettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27499,8 +27366,7 @@ func (c *ShippingsettingsUpdateCall) Header() http.Header { func (c *ShippingsettingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shippingsettings) if err != nil { return nil, err } @@ -27615,12 +27481,11 @@ func (c *ShoppingadsprogramGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shoppingadsprogram") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27715,8 +27580,7 @@ func (c *ShoppingadsprogramRequestreviewCall) Header() http.Header { func (c *ShoppingadsprogramRequestreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.requestreviewshoppingadsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.requestreviewshoppingadsrequest) if err != nil { return nil, err } diff --git a/contentwarehouse/v1/contentwarehouse-gen.go b/contentwarehouse/v1/contentwarehouse-gen.go index 937b7040f3b..caf2e7584c0 100644 --- a/contentwarehouse/v1/contentwarehouse-gen.go +++ b/contentwarehouse/v1/contentwarehouse-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6812,8 +6811,7 @@ func (c *ProjectsFetchAclCall) Header() http.Header { func (c *ProjectsFetchAclCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1fetchaclrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1fetchaclrequest) if err != nil { return nil, err } @@ -6920,8 +6918,7 @@ func (c *ProjectsSetAclCall) Header() http.Header { func (c *ProjectsSetAclCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1setaclrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1setaclrequest) if err != nil { return nil, err } @@ -7033,12 +7030,11 @@ func (c *ProjectsLocationsGetStatusCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}:getStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7133,8 +7129,7 @@ func (c *ProjectsLocationsInitializeCall) Header() http.Header { func (c *ProjectsLocationsInitializeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1initializeprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1initializeprojectrequest) if err != nil { return nil, err } @@ -7236,8 +7231,7 @@ func (c *ProjectsLocationsRunPipelineCall) Header() http.Header { func (c *ProjectsLocationsRunPipelineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1runpipelinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1runpipelinerequest) if err != nil { return nil, err } @@ -7338,8 +7332,7 @@ func (c *ProjectsLocationsDocumentSchemasCreateCall) Header() http.Header { func (c *ProjectsLocationsDocumentSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1documentschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1documentschema) if err != nil { return nil, err } @@ -7440,12 +7433,11 @@ func (c *ProjectsLocationsDocumentSchemasDeleteCall) Header() http.Header { func (c *ProjectsLocationsDocumentSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7549,12 +7541,11 @@ func (c *ProjectsLocationsDocumentSchemasGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7676,12 +7667,11 @@ func (c *ProjectsLocationsDocumentSchemasListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/documentSchemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7802,8 +7792,7 @@ func (c *ProjectsLocationsDocumentSchemasPatchCall) Header() http.Header { func (c *ProjectsLocationsDocumentSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1updatedocumentschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1updatedocumentschemarequest) if err != nil { return nil, err } @@ -7905,8 +7894,7 @@ func (c *ProjectsLocationsDocumentsCreateCall) Header() http.Header { func (c *ProjectsLocationsDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1createdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1createdocumentrequest) if err != nil { return nil, err } @@ -8011,8 +7999,7 @@ func (c *ProjectsLocationsDocumentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1deletedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1deletedocumentrequest) if err != nil { return nil, err } @@ -8120,8 +8107,7 @@ func (c *ProjectsLocationsDocumentsFetchAclCall) Header() http.Header { func (c *ProjectsLocationsDocumentsFetchAclCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1fetchaclrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1fetchaclrequest) if err != nil { return nil, err } @@ -8225,8 +8211,7 @@ func (c *ProjectsLocationsDocumentsGetCall) Header() http.Header { func (c *ProjectsLocationsDocumentsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1getdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1getdocumentrequest) if err != nil { return nil, err } @@ -8330,8 +8315,7 @@ func (c *ProjectsLocationsDocumentsLinkedSourcesCall) Header() http.Header { func (c *ProjectsLocationsDocumentsLinkedSourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1listlinkedsourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1listlinkedsourcesrequest) if err != nil { return nil, err } @@ -8458,8 +8442,7 @@ func (c *ProjectsLocationsDocumentsLinkedTargetsCall) Header() http.Header { func (c *ProjectsLocationsDocumentsLinkedTargetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1listlinkedtargetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1listlinkedtargetsrequest) if err != nil { return nil, err } @@ -8563,8 +8546,7 @@ func (c *ProjectsLocationsDocumentsLockCall) Header() http.Header { func (c *ProjectsLocationsDocumentsLockCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1lockdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1lockdocumentrequest) if err != nil { return nil, err } @@ -8669,8 +8651,7 @@ func (c *ProjectsLocationsDocumentsPatchCall) Header() http.Header { func (c *ProjectsLocationsDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1updatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1updatedocumentrequest) if err != nil { return nil, err } @@ -8774,8 +8755,7 @@ func (c *ProjectsLocationsDocumentsSearchCall) Header() http.Header { func (c *ProjectsLocationsDocumentsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1searchdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1searchdocumentsrequest) if err != nil { return nil, err } @@ -8903,8 +8883,7 @@ func (c *ProjectsLocationsDocumentsSetAclCall) Header() http.Header { func (c *ProjectsLocationsDocumentsSetAclCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1setaclrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1setaclrequest) if err != nil { return nil, err } @@ -9008,8 +8987,7 @@ func (c *ProjectsLocationsDocumentsDocumentLinksCreateCall) Header() http.Header func (c *ProjectsLocationsDocumentsDocumentLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1createdocumentlinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1createdocumentlinkrequest) if err != nil { return nil, err } @@ -9112,8 +9090,7 @@ func (c *ProjectsLocationsDocumentsDocumentLinksDeleteCall) Header() http.Header func (c *ProjectsLocationsDocumentsDocumentLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1deletedocumentlinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1deletedocumentlinkrequest) if err != nil { return nil, err } @@ -9218,8 +9195,7 @@ func (c *ProjectsLocationsDocumentsReferenceIdDeleteCall) Header() http.Header { func (c *ProjectsLocationsDocumentsReferenceIdDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1deletedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1deletedocumentrequest) if err != nil { return nil, err } @@ -9323,8 +9299,7 @@ func (c *ProjectsLocationsDocumentsReferenceIdGetCall) Header() http.Header { func (c *ProjectsLocationsDocumentsReferenceIdGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1getdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1getdocumentrequest) if err != nil { return nil, err } @@ -9429,8 +9404,7 @@ func (c *ProjectsLocationsDocumentsReferenceIdPatchCall) Header() http.Header { func (c *ProjectsLocationsDocumentsReferenceIdPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1updatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1updatedocumentrequest) if err != nil { return nil, err } @@ -9543,12 +9517,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9642,8 +9615,7 @@ func (c *ProjectsLocationsRuleSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsRuleSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1ruleset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1ruleset) if err != nil { return nil, err } @@ -9743,12 +9715,11 @@ func (c *ProjectsLocationsRuleSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRuleSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9852,12 +9823,11 @@ func (c *ProjectsLocationsRuleSetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9979,12 +9949,11 @@ func (c *ProjectsLocationsRuleSetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/ruleSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10100,8 +10069,7 @@ func (c *ProjectsLocationsRuleSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsRuleSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1updaterulesetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1updaterulesetrequest) if err != nil { return nil, err } @@ -10204,8 +10172,7 @@ func (c *ProjectsLocationsSynonymSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsSynonymSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1synonymset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1synonymset) if err != nil { return nil, err } @@ -10306,12 +10273,11 @@ func (c *ProjectsLocationsSynonymSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSynonymSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10416,12 +10382,11 @@ func (c *ProjectsLocationsSynonymSetsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10543,12 +10508,11 @@ func (c *ProjectsLocationsSynonymSetsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/synonymSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10664,8 +10628,7 @@ func (c *ProjectsLocationsSynonymSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsSynonymSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudcontentwarehousev1synonymset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudcontentwarehousev1synonymset) if err != nil { return nil, err } diff --git a/css/v1/css-gen.go b/css/v1/css-gen.go index 8ff7ddf363e..2b673558ce3 100644 --- a/css/v1/css-gen.go +++ b/css/v1/css-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1110,12 +1109,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1251,12 +1249,11 @@ func (c *AccountsListChildAccountsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:listChildAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1370,8 +1367,7 @@ func (c *AccountsUpdateLabelsCall) Header() http.Header { func (c *AccountsUpdateLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateaccountlabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateaccountlabelsrequest) if err != nil { return nil, err } @@ -1480,12 +1476,11 @@ func (c *AccountsCssProductInputsDeleteCall) Header() http.Header { func (c *AccountsCssProductInputsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1592,8 +1587,7 @@ func (c *AccountsCssProductInputsInsertCall) Header() http.Header { func (c *AccountsCssProductInputsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cssproductinput) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cssproductinput) if err != nil { return nil, err } @@ -1706,12 +1700,11 @@ func (c *AccountsCssProductsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1836,12 +1829,11 @@ func (c *AccountsCssProductsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cssProducts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1955,8 +1947,7 @@ func (c *AccountsLabelsCreateCall) Header() http.Header { func (c *AccountsLabelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountlabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountlabel) if err != nil { return nil, err } @@ -2056,12 +2047,11 @@ func (c *AccountsLabelsDeleteCall) Header() http.Header { func (c *AccountsLabelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2181,12 +2171,11 @@ func (c *AccountsLabelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/labels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2301,8 +2290,7 @@ func (c *AccountsLabelsPatchCall) Header() http.Header { func (c *AccountsLabelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountlabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountlabel) if err != nil { return nil, err } diff --git a/customsearch/v1/customsearch-gen.go b/customsearch/v1/customsearch-gen.go index ab1c23ce769..a19625be130 100644 --- a/customsearch/v1/customsearch-gen.go +++ b/customsearch/v1/customsearch-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Cse = NewCseService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Cse = NewCseService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1483,12 +1482,11 @@ func (c *CseListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "customsearch/v1") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1956,12 +1954,11 @@ func (c *CseSiterestrictListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "customsearch/v1/siterestrict") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/datacatalog/v1/datacatalog-gen.go b/datacatalog/v1/datacatalog-gen.go index ea93a6fa04a..e25f8d1df61 100644 --- a/datacatalog/v1/datacatalog-gen.go +++ b/datacatalog/v1/datacatalog-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Catalog = NewCatalogService(s) + s.Entries = NewEntriesService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Catalog = NewCatalogService(s) - s.Entries = NewEntriesService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4188,8 +4187,7 @@ func (c *CatalogSearchCall) Header() http.Header { func (c *CatalogSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1searchcatalogrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1searchcatalogrequest) if err != nil { return nil, err } @@ -4376,12 +4374,11 @@ func (c *EntriesLookupCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entries:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4483,12 +4480,11 @@ func (c *OrganizationsLocationsRetrieveConfigCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:retrieveConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4595,12 +4591,11 @@ func (c *OrganizationsLocationsRetrieveEffectiveConfigCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:retrieveEffectiveConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4694,8 +4689,7 @@ func (c *OrganizationsLocationsSetConfigCall) Header() http.Header { func (c *OrganizationsLocationsSetConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1setconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1setconfigrequest) if err != nil { return nil, err } @@ -4810,12 +4804,11 @@ func (c *ProjectsLocationsRetrieveEffectiveConfigCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:retrieveEffectiveConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4909,8 +4902,7 @@ func (c *ProjectsLocationsSetConfigCall) Header() http.Header { func (c *ProjectsLocationsSetConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1setconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1setconfigrequest) if err != nil { return nil, err } @@ -5037,8 +5029,7 @@ func (c *ProjectsLocationsEntryGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1entrygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1entrygroup) if err != nil { return nil, err } @@ -5147,12 +5138,11 @@ func (c *ProjectsLocationsEntryGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5261,12 +5251,11 @@ func (c *ProjectsLocationsEntryGroupsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5369,8 +5358,7 @@ func (c *ProjectsLocationsEntryGroupsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5496,12 +5484,11 @@ func (c *ProjectsLocationsEntryGroupsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entryGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5629,8 +5616,7 @@ func (c *ProjectsLocationsEntryGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1entrygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1entrygroup) if err != nil { return nil, err } @@ -5740,8 +5726,7 @@ func (c *ProjectsLocationsEntryGroupsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5850,8 +5835,7 @@ func (c *ProjectsLocationsEntryGroupsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsEntryGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5969,8 +5953,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1entry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1entry) if err != nil { return nil, err } @@ -6073,12 +6056,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6180,12 +6162,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6288,8 +6269,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesGetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsEntryGroupsEntriesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -6397,8 +6377,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesImportCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1importentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1importentriesrequest) if err != nil { return nil, err } @@ -6535,12 +6514,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6657,8 +6635,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesModifyEntryContactsCall) Header() ht func (c *ProjectsLocationsEntryGroupsEntriesModifyEntryContactsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1modifyentrycontactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1modifyentrycontactsrequest) if err != nil { return nil, err } @@ -6762,8 +6739,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesModifyEntryOverviewCall) Header() ht func (c *ProjectsLocationsEntryGroupsEntriesModifyEntryOverviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1modifyentryoverviewrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1modifyentryoverviewrequest) if err != nil { return nil, err } @@ -6884,8 +6860,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1entry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1entry) if err != nil { return nil, err } @@ -6987,8 +6962,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesStarCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesStarCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1starentryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1starentryrequest) if err != nil { return nil, err } @@ -7098,8 +7072,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsEntryGroupsEntriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7201,8 +7174,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesUnstarCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesUnstarCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1unstarentryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1unstarentryrequest) if err != nil { return nil, err } @@ -7313,8 +7285,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsCreateCall) Header() http.Header func (c *ProjectsLocationsEntryGroupsEntriesTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tag) if err != nil { return nil, err } @@ -7413,12 +7384,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsDeleteCall) Header() http.Header func (c *ProjectsLocationsEntryGroupsEntriesTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7537,12 +7507,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7668,8 +7637,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsPatchCall) Header() http.Header func (c *ProjectsLocationsEntryGroupsEntriesTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tag) if err != nil { return nil, err } @@ -7775,8 +7743,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsReconcileCall) Header() http.Hea func (c *ProjectsLocationsEntryGroupsEntriesTagsReconcileCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1reconciletagsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1reconciletagsrequest) if err != nil { return nil, err } @@ -7886,8 +7853,7 @@ func (c *ProjectsLocationsEntryGroupsTagsCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tag) if err != nil { return nil, err } @@ -7986,12 +7952,11 @@ func (c *ProjectsLocationsEntryGroupsTagsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8110,12 +8075,11 @@ func (c *ProjectsLocationsEntryGroupsTagsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8241,8 +8205,7 @@ func (c *ProjectsLocationsEntryGroupsTagsPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tag) if err != nil { return nil, err } @@ -8349,12 +8312,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8447,12 +8409,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8556,12 +8517,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8684,12 +8644,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8816,8 +8775,7 @@ func (c *ProjectsLocationsTagTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tagtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tagtemplate) if err != nil { return nil, err } @@ -8926,12 +8884,11 @@ func (c *ProjectsLocationsTagTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9033,12 +8990,11 @@ func (c *ProjectsLocationsTagTemplatesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9141,8 +9097,7 @@ func (c *ProjectsLocationsTagTemplatesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -9261,8 +9216,7 @@ func (c *ProjectsLocationsTagTemplatesPatchCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tagtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tagtemplate) if err != nil { return nil, err } @@ -9372,8 +9326,7 @@ func (c *ProjectsLocationsTagTemplatesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9482,8 +9435,7 @@ func (c *ProjectsLocationsTagTemplatesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsTagTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9599,8 +9551,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsCreateCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tagtemplatefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tagtemplatefield) if err != nil { return nil, err } @@ -9711,12 +9662,11 @@ func (c *ProjectsLocationsTagTemplatesFieldsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9827,8 +9777,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsPatchCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1tagtemplatefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1tagtemplatefield) if err != nil { return nil, err } @@ -9932,8 +9881,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsRenameCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1renametagtemplatefieldrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1renametagtemplatefieldrequest) if err != nil { return nil, err } @@ -10035,8 +9983,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsEnumValuesRenameCall) Header() http. func (c *ProjectsLocationsTagTemplatesFieldsEnumValuesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1renametagtemplatefieldenumvaluerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1renametagtemplatefieldenumvaluerequest) if err != nil { return nil, err } @@ -10138,8 +10085,7 @@ func (c *ProjectsLocationsTaxonomiesCreateCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1taxonomy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1taxonomy) if err != nil { return nil, err } @@ -10241,12 +10187,11 @@ func (c *ProjectsLocationsTaxonomiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10367,12 +10312,11 @@ func (c *ProjectsLocationsTaxonomiesExportCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/taxonomies:export") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10475,12 +10419,11 @@ func (c *ProjectsLocationsTaxonomiesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10575,8 +10518,7 @@ func (c *ProjectsLocationsTaxonomiesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -10681,8 +10623,7 @@ func (c *ProjectsLocationsTaxonomiesImportCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1importtaxonomiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1importtaxonomiesrequest) if err != nil { return nil, err } @@ -10817,12 +10758,11 @@ func (c *ProjectsLocationsTaxonomiesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/taxonomies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10947,8 +10887,7 @@ func (c *ProjectsLocationsTaxonomiesPatchCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1taxonomy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1taxonomy) if err != nil { return nil, err } @@ -11055,8 +10994,7 @@ func (c *ProjectsLocationsTaxonomiesReplaceCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1replacetaxonomyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1replacetaxonomyrequest) if err != nil { return nil, err } @@ -11159,8 +11097,7 @@ func (c *ProjectsLocationsTaxonomiesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11264,8 +11201,7 @@ func (c *ProjectsLocationsTaxonomiesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsTaxonomiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11366,8 +11302,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsCreateCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPolicyTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1policytag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1policytag) if err != nil { return nil, err } @@ -11470,12 +11405,11 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPolicyTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11577,12 +11511,11 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11677,8 +11610,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsGetIamPolicyCall) Header() http.He func (c *ProjectsLocationsTaxonomiesPolicyTagsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -11804,12 +11736,11 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policyTags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11935,8 +11866,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsPatchCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPolicyTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1policytag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1policytag) if err != nil { return nil, err } @@ -12039,8 +11969,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsTaxonomiesPolicyTagsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12144,8 +12073,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsTestIamPermissionsCall) Header() h func (c *ProjectsLocationsTaxonomiesPolicyTagsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/datacatalog/v1beta1/datacatalog-gen.go b/datacatalog/v1beta1/datacatalog-gen.go index 463a900736e..d9ece66192b 100644 --- a/datacatalog/v1beta1/datacatalog-gen.go +++ b/datacatalog/v1beta1/datacatalog-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Catalog = NewCatalogService(s) + s.Entries = NewEntriesService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Catalog = NewCatalogService(s) - s.Entries = NewEntriesService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4301,8 +4300,7 @@ func (c *CatalogSearchCall) Header() http.Header { func (c *CatalogSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1searchcatalogrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1searchcatalogrequest) if err != nil { return nil, err } @@ -4453,12 +4451,11 @@ func (c *EntriesLookupCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/entries:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4565,8 +4562,7 @@ func (c *ProjectsLocationsEntryGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1entrygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1entrygroup) if err != nil { return nil, err } @@ -4677,12 +4673,11 @@ func (c *ProjectsLocationsEntryGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4792,12 +4787,11 @@ func (c *ProjectsLocationsEntryGroupsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4901,8 +4895,7 @@ func (c *ProjectsLocationsEntryGroupsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5029,12 +5022,11 @@ func (c *ProjectsLocationsEntryGroupsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/entryGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5165,8 +5157,7 @@ func (c *ProjectsLocationsEntryGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1entrygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1entrygroup) if err != nil { return nil, err } @@ -5276,8 +5267,7 @@ func (c *ProjectsLocationsEntryGroupsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5386,8 +5376,7 @@ func (c *ProjectsLocationsEntryGroupsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsEntryGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5503,8 +5492,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1entry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1entry) if err != nil { return nil, err } @@ -5610,12 +5598,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5719,12 +5706,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5828,8 +5814,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesGetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsEntryGroupsEntriesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5965,12 +5950,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6107,8 +6091,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1entry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1entry) if err != nil { return nil, err } @@ -6218,8 +6201,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsEntryGroupsEntriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6329,8 +6311,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsCreateCall) Header() http.Header func (c *ProjectsLocationsEntryGroupsEntriesTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tag) if err != nil { return nil, err } @@ -6431,12 +6412,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsDeleteCall) Header() http.Header func (c *ProjectsLocationsEntryGroupsEntriesTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6557,12 +6537,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6691,8 +6670,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesTagsPatchCall) Header() http.Header func (c *ProjectsLocationsEntryGroupsEntriesTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tag) if err != nil { return nil, err } @@ -6802,8 +6780,7 @@ func (c *ProjectsLocationsEntryGroupsTagsCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tag) if err != nil { return nil, err } @@ -6904,12 +6881,11 @@ func (c *ProjectsLocationsEntryGroupsTagsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7030,12 +7006,11 @@ func (c *ProjectsLocationsEntryGroupsTagsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7164,8 +7139,7 @@ func (c *ProjectsLocationsEntryGroupsTagsPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tag) if err != nil { return nil, err } @@ -7279,8 +7253,7 @@ func (c *ProjectsLocationsTagTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tagtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tagtemplate) if err != nil { return nil, err } @@ -7392,12 +7365,11 @@ func (c *ProjectsLocationsTagTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7500,12 +7472,11 @@ func (c *ProjectsLocationsTagTemplatesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7609,8 +7580,7 @@ func (c *ProjectsLocationsTagTemplatesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -7730,8 +7700,7 @@ func (c *ProjectsLocationsTagTemplatesPatchCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tagtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tagtemplate) if err != nil { return nil, err } @@ -7841,8 +7810,7 @@ func (c *ProjectsLocationsTagTemplatesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7951,8 +7919,7 @@ func (c *ProjectsLocationsTagTemplatesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsTagTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8069,8 +8036,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsCreateCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tagtemplatefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tagtemplatefield) if err != nil { return nil, err } @@ -8183,12 +8149,11 @@ func (c *ProjectsLocationsTagTemplatesFieldsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8302,8 +8267,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsPatchCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1tagtemplatefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1tagtemplatefield) if err != nil { return nil, err } @@ -8410,8 +8374,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsRenameCall) Header() http.Header { func (c *ProjectsLocationsTagTemplatesFieldsRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1renametagtemplatefieldrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1renametagtemplatefieldrequest) if err != nil { return nil, err } @@ -8516,8 +8479,7 @@ func (c *ProjectsLocationsTagTemplatesFieldsEnumValuesRenameCall) Header() http. func (c *ProjectsLocationsTagTemplatesFieldsEnumValuesRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1renametagtemplatefieldenumvaluerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1renametagtemplatefieldenumvaluerequest) if err != nil { return nil, err } @@ -8618,8 +8580,7 @@ func (c *ProjectsLocationsTaxonomiesCreateCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1taxonomy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1taxonomy) if err != nil { return nil, err } @@ -8720,12 +8681,11 @@ func (c *ProjectsLocationsTaxonomiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8844,12 +8804,11 @@ func (c *ProjectsLocationsTaxonomiesExportCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/taxonomies:export") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8952,12 +8911,11 @@ func (c *ProjectsLocationsTaxonomiesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9052,8 +9010,7 @@ func (c *ProjectsLocationsTaxonomiesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -9156,8 +9113,7 @@ func (c *ProjectsLocationsTaxonomiesImportCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1importtaxonomiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1importtaxonomiesrequest) if err != nil { return nil, err } @@ -9291,12 +9247,11 @@ func (c *ProjectsLocationsTaxonomiesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/taxonomies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9420,8 +9375,7 @@ func (c *ProjectsLocationsTaxonomiesPatchCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1taxonomy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1taxonomy) if err != nil { return nil, err } @@ -9524,8 +9478,7 @@ func (c *ProjectsLocationsTaxonomiesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9629,8 +9582,7 @@ func (c *ProjectsLocationsTaxonomiesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsTaxonomiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9731,8 +9683,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsCreateCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPolicyTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1policytag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1policytag) if err != nil { return nil, err } @@ -9833,12 +9784,11 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPolicyTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9940,12 +9890,11 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10040,8 +9989,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsGetIamPolicyCall) Header() http.He func (c *ProjectsLocationsTaxonomiesPolicyTagsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -10166,12 +10114,11 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/policyTags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10299,8 +10246,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsPatchCall) Header() http.Header { func (c *ProjectsLocationsTaxonomiesPolicyTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatacatalogv1beta1policytag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatacatalogv1beta1policytag) if err != nil { return nil, err } @@ -10403,8 +10349,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsTaxonomiesPolicyTagsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10508,8 +10453,7 @@ func (c *ProjectsLocationsTaxonomiesPolicyTagsTestIamPermissionsCall) Header() h func (c *ProjectsLocationsTaxonomiesPolicyTagsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/dataflow/v1b3/dataflow-gen.go b/dataflow/v1b3/dataflow-gen.go index 06c17c08dfe..01a61ac1980 100644 --- a/dataflow/v1b3/dataflow-gen.go +++ b/dataflow/v1b3/dataflow-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7416,12 +7415,11 @@ func (c *ProjectsDeleteSnapshotsCall) Header() http.Header { func (c *ProjectsDeleteSnapshotsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7514,8 +7512,7 @@ func (c *ProjectsWorkerMessagesCall) Header() http.Header { func (c *ProjectsWorkerMessagesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendworkermessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendworkermessagesrequest) if err != nil { return nil, err } @@ -7714,12 +7711,11 @@ func (c *ProjectsJobsAggregatedCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs:aggregated") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7885,8 +7881,7 @@ func (c *ProjectsJobsCreateCall) Header() http.Header { func (c *ProjectsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -8044,12 +8039,11 @@ func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8176,12 +8170,11 @@ func (c *ProjectsJobsGetMetricsCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}/metrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8378,12 +8371,11 @@ func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8500,8 +8492,7 @@ func (c *ProjectsJobsSnapshotCall) Header() http.Header { func (c *ProjectsJobsSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshotjobrequest) if err != nil { return nil, err } @@ -8630,8 +8621,7 @@ func (c *ProjectsJobsUpdateCall) Header() http.Header { func (c *ProjectsJobsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -8735,8 +8725,7 @@ func (c *ProjectsJobsDebugGetConfigCall) Header() http.Header { func (c *ProjectsJobsDebugGetConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getdebugconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getdebugconfigrequest) if err != nil { return nil, err } @@ -8841,8 +8830,7 @@ func (c *ProjectsJobsDebugSendCaptureCall) Header() http.Header { func (c *ProjectsJobsDebugSendCaptureCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.senddebugcapturerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.senddebugcapturerequest) if err != nil { return nil, err } @@ -9046,12 +9034,11 @@ func (c *ProjectsJobsMessagesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9169,8 +9156,7 @@ func (c *ProjectsJobsWorkItemsLeaseCall) Header() http.Header { func (c *ProjectsJobsWorkItemsLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaseworkitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.leaseworkitemrequest) if err != nil { return nil, err } @@ -9275,8 +9261,7 @@ func (c *ProjectsJobsWorkItemsReportStatusCall) Header() http.Header { func (c *ProjectsJobsWorkItemsReportStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportworkitemstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportworkitemstatusrequest) if err != nil { return nil, err } @@ -9383,8 +9368,7 @@ func (c *ProjectsLocationsWorkerMessagesCall) Header() http.Header { func (c *ProjectsLocationsWorkerMessagesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendworkermessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendworkermessagesrequest) if err != nil { return nil, err } @@ -9491,8 +9475,7 @@ func (c *ProjectsLocationsFlexTemplatesLaunchCall) Header() http.Header { func (c *ProjectsLocationsFlexTemplatesLaunchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.launchflextemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.launchflextemplaterequest) if err != nil { return nil, err } @@ -9643,8 +9626,7 @@ func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -9800,12 +9782,11 @@ func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9936,12 +9917,11 @@ func (c *ProjectsLocationsJobsGetExecutionDetailsCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/executionDetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10088,12 +10068,11 @@ func (c *ProjectsLocationsJobsGetMetricsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10288,12 +10267,11 @@ func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10414,8 +10392,7 @@ func (c *ProjectsLocationsJobsSnapshotCall) Header() http.Header { func (c *ProjectsLocationsJobsSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshotjobrequest) if err != nil { return nil, err } @@ -10542,8 +10519,7 @@ func (c *ProjectsLocationsJobsUpdateCall) Header() http.Header { func (c *ProjectsLocationsJobsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -10653,8 +10629,7 @@ func (c *ProjectsLocationsJobsDebugGetConfigCall) Header() http.Header { func (c *ProjectsLocationsJobsDebugGetConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getdebugconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getdebugconfigrequest) if err != nil { return nil, err } @@ -10765,8 +10740,7 @@ func (c *ProjectsLocationsJobsDebugSendCaptureCall) Header() http.Header { func (c *ProjectsLocationsJobsDebugSendCaptureCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.senddebugcapturerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.senddebugcapturerequest) if err != nil { return nil, err } @@ -10968,12 +10942,11 @@ func (c *ProjectsLocationsJobsMessagesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11105,12 +11078,11 @@ func (c *ProjectsLocationsJobsSnapshotsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11259,12 +11231,11 @@ func (c *ProjectsLocationsJobsStagesGetExecutionDetailsCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/stages/{stageId}/executionDetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11389,8 +11360,7 @@ func (c *ProjectsLocationsJobsWorkItemsLeaseCall) Header() http.Header { func (c *ProjectsLocationsJobsWorkItemsLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaseworkitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.leaseworkitemrequest) if err != nil { return nil, err } @@ -11501,8 +11471,7 @@ func (c *ProjectsLocationsJobsWorkItemsReportStatusCall) Header() http.Header { func (c *ProjectsLocationsJobsWorkItemsReportStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportworkitemstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportworkitemstatusrequest) if err != nil { return nil, err } @@ -11610,12 +11579,11 @@ func (c *ProjectsLocationsSnapshotsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/snapshots/{snapshotId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11727,12 +11695,11 @@ func (c *ProjectsLocationsSnapshotsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/snapshots/{snapshotId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11846,12 +11813,11 @@ func (c *ProjectsLocationsSnapshotsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11956,8 +11922,7 @@ func (c *ProjectsLocationsTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createjobfromtemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createjobfromtemplaterequest) if err != nil { return nil, err } @@ -12099,12 +12064,11 @@ func (c *ProjectsLocationsTemplatesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/locations/{location}/templates:get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12239,8 +12203,7 @@ func (c *ProjectsLocationsTemplatesLaunchCall) Header() http.Header { func (c *ProjectsLocationsTemplatesLaunchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.launchtemplateparameters) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.launchtemplateparameters) if err != nil { return nil, err } @@ -12363,12 +12326,11 @@ func (c *ProjectsSnapshotsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/snapshots/{snapshotId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12485,12 +12447,11 @@ func (c *ProjectsSnapshotsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12589,8 +12550,7 @@ func (c *ProjectsTemplatesCreateCall) Header() http.Header { func (c *ProjectsTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createjobfromtemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createjobfromtemplaterequest) if err != nil { return nil, err } @@ -12734,12 +12694,11 @@ func (c *ProjectsTemplatesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/templates:get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12876,8 +12835,7 @@ func (c *ProjectsTemplatesLaunchCall) Header() http.Header { func (c *ProjectsTemplatesLaunchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.launchtemplateparameters) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.launchtemplateparameters) if err != nil { return nil, err } diff --git a/dataform/v1beta1/dataform-gen.go b/dataform/v1beta1/dataform-gen.go index f1f57cef64b..4a5c430f71c 100644 --- a/dataform/v1beta1/dataform-gen.go +++ b/dataform/v1beta1/dataform-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3052,12 +3051,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3159,12 +3157,11 @@ func (c *ProjectsLocationsGetConfigCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3290,12 +3287,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3420,8 +3416,7 @@ func (c *ProjectsLocationsUpdateConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.config) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.config) if err != nil { return nil, err } @@ -3522,8 +3517,7 @@ func (c *ProjectsLocationsRepositoriesCommitCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrepositorychangesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitrepositorychangesrequest) if err != nil { return nil, err } @@ -3634,12 +3628,11 @@ func (c *ProjectsLocationsRepositoriesComputeAccessTokenStatusCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:computeAccessTokenStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3741,8 +3734,7 @@ func (c *ProjectsLocationsRepositoriesCreateCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -3848,12 +3840,11 @@ func (c *ProjectsLocationsRepositoriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3974,12 +3965,11 @@ func (c *ProjectsLocationsRepositoriesFetchHistoryCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchHistory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4103,12 +4093,11 @@ func (c *ProjectsLocationsRepositoriesFetchRemoteBranchesCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchRemoteBranches") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4211,12 +4200,11 @@ func (c *ProjectsLocationsRepositoriesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4338,12 +4326,11 @@ func (c *ProjectsLocationsRepositoriesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4478,12 +4465,11 @@ func (c *ProjectsLocationsRepositoriesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/repositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4608,8 +4594,7 @@ func (c *ProjectsLocationsRepositoriesPatchCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repository) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repository) if err != nil { return nil, err } @@ -4753,12 +4738,11 @@ func (c *ProjectsLocationsRepositoriesQueryDirectoryContentsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:queryDirectoryContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4897,12 +4881,11 @@ func (c *ProjectsLocationsRepositoriesReadFileCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:readFile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4999,8 +4982,7 @@ func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5107,8 +5089,7 @@ func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsRepositoriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5210,8 +5191,7 @@ func (c *ProjectsLocationsRepositoriesCompilationResultsCreateCall) Header() htt func (c *ProjectsLocationsRepositoriesCompilationResultsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compilationresult) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compilationresult) if err != nil { return nil, err } @@ -5322,12 +5302,11 @@ func (c *ProjectsLocationsRepositoriesCompilationResultsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5464,12 +5443,11 @@ func (c *ProjectsLocationsRepositoriesCompilationResultsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/compilationResults") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5619,12 +5597,11 @@ func (c *ProjectsLocationsRepositoriesCompilationResultsQueryCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5747,8 +5724,7 @@ func (c *ProjectsLocationsRepositoriesReleaseConfigsCreateCall) Header() http.He func (c *ProjectsLocationsRepositoriesReleaseConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.releaseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.releaseconfig) if err != nil { return nil, err } @@ -5846,12 +5822,11 @@ func (c *ProjectsLocationsRepositoriesReleaseConfigsDeleteCall) Header() http.He func (c *ProjectsLocationsRepositoriesReleaseConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5953,12 +5928,11 @@ func (c *ProjectsLocationsRepositoriesReleaseConfigsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6079,12 +6053,11 @@ func (c *ProjectsLocationsRepositoriesReleaseConfigsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releaseConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6209,8 +6182,7 @@ func (c *ProjectsLocationsRepositoriesReleaseConfigsPatchCall) Header() http.Hea func (c *ProjectsLocationsRepositoriesReleaseConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.releaseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.releaseconfig) if err != nil { return nil, err } @@ -6319,8 +6291,7 @@ func (c *ProjectsLocationsRepositoriesWorkflowConfigsCreateCall) Header() http.H func (c *ProjectsLocationsRepositoriesWorkflowConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowconfig) if err != nil { return nil, err } @@ -6418,12 +6389,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowConfigsDeleteCall) Header() http.H func (c *ProjectsLocationsRepositoriesWorkflowConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6525,12 +6495,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowConfigsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6651,12 +6620,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowConfigsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workflowConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6782,8 +6750,7 @@ func (c *ProjectsLocationsRepositoriesWorkflowConfigsPatchCall) Header() http.He func (c *ProjectsLocationsRepositoriesWorkflowConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowconfig) if err != nil { return nil, err } @@ -6883,8 +6850,7 @@ func (c *ProjectsLocationsRepositoriesWorkflowInvocationsCancelCall) Header() ht func (c *ProjectsLocationsRepositoriesWorkflowInvocationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelworkflowinvocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelworkflowinvocationrequest) if err != nil { return nil, err } @@ -6985,8 +6951,7 @@ func (c *ProjectsLocationsRepositoriesWorkflowInvocationsCreateCall) Header() ht func (c *ProjectsLocationsRepositoriesWorkflowInvocationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowinvocation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowinvocation) if err != nil { return nil, err } @@ -7085,12 +7050,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowInvocationsDeleteCall) Header() ht func (c *ProjectsLocationsRepositoriesWorkflowInvocationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7192,12 +7156,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowInvocationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7333,12 +7296,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowInvocationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workflowInvocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7480,12 +7442,11 @@ func (c *ProjectsLocationsRepositoriesWorkflowInvocationsQueryCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7599,8 +7560,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesCommitCall) Header() http.Header func (c *ProjectsLocationsRepositoriesWorkspacesCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitworkspacechangesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitworkspacechangesrequest) if err != nil { return nil, err } @@ -7709,8 +7669,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesCreateCall) Header() http.Header func (c *ProjectsLocationsRepositoriesWorkspacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workspace) if err != nil { return nil, err } @@ -7808,12 +7767,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesDeleteCall) Header() http.Header func (c *ProjectsLocationsRepositoriesWorkspacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7922,12 +7880,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesFetchFileDiffCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+workspace}:fetchFileDiff") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8030,12 +7987,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesFetchFileGitStatusesCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchFileGitStatuses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8146,12 +8102,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesFetchGitAheadBehindCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchGitAheadBehind") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8254,12 +8209,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8381,12 +8335,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8478,8 +8431,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesInstallNpmPackagesCall) Header() func (c *ProjectsLocationsRepositoriesWorkspacesInstallNpmPackagesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.installnpmpackagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.installnpmpackagesrequest) if err != nil { return nil, err } @@ -8623,12 +8575,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workspaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8742,8 +8693,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesMakeDirectoryCall) Header() http func (c *ProjectsLocationsRepositoriesWorkspacesMakeDirectoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.makedirectoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.makedirectoryrequest) if err != nil { return nil, err } @@ -8845,8 +8795,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesMoveDirectoryCall) Header() http func (c *ProjectsLocationsRepositoriesWorkspacesMoveDirectoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movedirectoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movedirectoryrequest) if err != nil { return nil, err } @@ -8947,8 +8896,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesMoveFileCall) Header() http.Head func (c *ProjectsLocationsRepositoriesWorkspacesMoveFileCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movefilerequest) if err != nil { return nil, err } @@ -9049,8 +8997,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesPullCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesWorkspacesPullCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullgitcommitsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pullgitcommitsrequest) if err != nil { return nil, err } @@ -9150,8 +9097,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesPushCall) Header() http.Header { func (c *ProjectsLocationsRepositoriesWorkspacesPushCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushgitcommitsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pushgitcommitsrequest) if err != nil { return nil, err } @@ -9287,12 +9233,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesQueryDirectoryContentsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+workspace}:queryDirectoryContents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9431,12 +9376,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesReadFileCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+workspace}:readFile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9530,8 +9474,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesRemoveDirectoryCall) Header() ht func (c *ProjectsLocationsRepositoriesWorkspacesRemoveDirectoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removedirectoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removedirectoryrequest) if err != nil { return nil, err } @@ -9631,8 +9574,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesRemoveFileCall) Header() http.He func (c *ProjectsLocationsRepositoriesWorkspacesRemoveFileCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removefilerequest) if err != nil { return nil, err } @@ -9732,8 +9674,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesResetCall) Header() http.Header func (c *ProjectsLocationsRepositoriesWorkspacesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetworkspacechangesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetworkspacechangesrequest) if err != nil { return nil, err } @@ -9869,12 +9810,11 @@ func (c *ProjectsLocationsRepositoriesWorkspacesSearchFilesCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+workspace}:searchFiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9992,8 +9932,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesSetIamPolicyCall) Header() http. func (c *ProjectsLocationsRepositoriesWorkspacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10100,8 +10039,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesTestIamPermissionsCall) Header() func (c *ProjectsLocationsRepositoriesWorkspacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10202,8 +10140,7 @@ func (c *ProjectsLocationsRepositoriesWorkspacesWriteFileCall) Header() http.Hea func (c *ProjectsLocationsRepositoriesWorkspacesWriteFileCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writefilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writefilerequest) if err != nil { return nil, err } diff --git a/datafusion/v1/datafusion-gen.go b/datafusion/v1/datafusion-gen.go index 1bb4fa770cd..2947156d2ed 100644 --- a/datafusion/v1/datafusion-gen.go +++ b/datafusion/v1/datafusion-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1529,12 +1528,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1660,12 +1658,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1790,8 +1787,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -1890,12 +1886,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1998,12 +1993,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2125,12 +2119,11 @@ func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2262,12 +2255,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2392,8 +2384,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2495,8 +2486,7 @@ func (c *ProjectsLocationsInstancesRestartCall) Header() http.Header { func (c *ProjectsLocationsInstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest) if err != nil { return nil, err } @@ -2600,8 +2590,7 @@ func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2708,8 +2697,7 @@ func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2817,8 +2805,7 @@ func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dnspeering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dnspeering) if err != nil { return nil, err } @@ -2918,12 +2905,11 @@ func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3044,12 +3030,11 @@ func (c *ProjectsLocationsInstancesDnsPeeringsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsPeerings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3171,8 +3156,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3273,12 +3257,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3382,12 +3365,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3510,12 +3492,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3664,12 +3645,11 @@ func (c *ProjectsLocationsVersionsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/datafusion/v1beta1/datafusion-gen.go b/datafusion/v1beta1/datafusion-gen.go index 94e2550a1cc..8894b87a575 100644 --- a/datafusion/v1beta1/datafusion-gen.go +++ b/datafusion/v1beta1/datafusion-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1627,12 +1626,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1758,12 +1756,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1878,8 +1875,7 @@ func (c *ProjectsLocationsRemoveIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRemoveIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeiampolicyrequest) if err != nil { return nil, err } @@ -1991,8 +1987,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2091,12 +2086,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2199,12 +2193,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2326,12 +2319,11 @@ func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2463,12 +2455,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2594,8 +2585,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2697,8 +2687,7 @@ func (c *ProjectsLocationsInstancesRestartCall) Header() http.Header { func (c *ProjectsLocationsInstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest) if err != nil { return nil, err } @@ -2802,8 +2791,7 @@ func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2910,8 +2898,7 @@ func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3016,8 +3003,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstancerequest) if err != nil { return nil, err } @@ -3124,8 +3110,7 @@ func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dnspeering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dnspeering) if err != nil { return nil, err } @@ -3225,12 +3210,11 @@ func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3351,12 +3335,11 @@ func (c *ProjectsLocationsInstancesDnsPeeringsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dnsPeerings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3500,12 +3483,11 @@ func (c *ProjectsLocationsInstancesNamespacesGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3639,12 +3621,11 @@ func (c *ProjectsLocationsInstancesNamespacesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/namespaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3762,8 +3743,7 @@ func (c *ProjectsLocationsInstancesNamespacesSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsInstancesNamespacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3870,8 +3850,7 @@ func (c *ProjectsLocationsInstancesNamespacesTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsInstancesNamespacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3980,8 +3959,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4082,12 +4060,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4191,12 +4168,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4319,12 +4295,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4473,12 +4448,11 @@ func (c *ProjectsLocationsVersionsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/datalabeling/v1beta1/datalabeling-gen.go b/datalabeling/v1beta1/datalabeling-gen.go index 9a40940bcd3..6e18d120be9 100644 --- a/datalabeling/v1beta1/datalabeling-gen.go +++ b/datalabeling/v1beta1/datalabeling-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6309,8 +6308,7 @@ func (c *ProjectsAnnotationSpecSetsCreateCall) Header() http.Header { func (c *ProjectsAnnotationSpecSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1createannotationspecsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1createannotationspecsetrequest) if err != nil { return nil, err } @@ -6410,12 +6408,11 @@ func (c *ProjectsAnnotationSpecSetsDeleteCall) Header() http.Header { func (c *ProjectsAnnotationSpecSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6519,12 +6516,11 @@ func (c *ProjectsAnnotationSpecSetsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6652,12 +6648,11 @@ func (c *ProjectsAnnotationSpecSetsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/annotationSpecSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6771,8 +6766,7 @@ func (c *ProjectsDatasetsCreateCall) Header() http.Header { func (c *ProjectsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1createdatasetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1createdatasetrequest) if err != nil { return nil, err } @@ -6872,12 +6866,11 @@ func (c *ProjectsDatasetsDeleteCall) Header() http.Header { func (c *ProjectsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6971,8 +6964,7 @@ func (c *ProjectsDatasetsExportDataCall) Header() http.Header { func (c *ProjectsDatasetsExportDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1exportdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1exportdatarequest) if err != nil { return nil, err } @@ -7084,12 +7076,11 @@ func (c *ProjectsDatasetsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7187,8 +7178,7 @@ func (c *ProjectsDatasetsImportDataCall) Header() http.Header { func (c *ProjectsDatasetsImportDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1importdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1importdatarequest) if err != nil { return nil, err } @@ -7322,12 +7312,11 @@ func (c *ProjectsDatasetsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7441,12 +7430,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsDeleteCall) Header() http.Header { func (c *ProjectsDatasetsAnnotatedDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7551,12 +7539,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7684,12 +7671,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/annotatedDatasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7815,12 +7801,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsDataItemsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7948,12 +7933,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsDataItemsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8087,12 +8071,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsExamplesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8220,12 +8203,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsExamplesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/examples") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8339,12 +8321,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsDeleteCall) Header() ht func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8449,12 +8430,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8575,12 +8555,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/feedbackThreads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8696,8 +8675,7 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesCreateC func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1feedbackmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1feedbackmessage) if err != nil { return nil, err } @@ -8799,12 +8777,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesDeleteC func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8910,12 +8887,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9036,12 +9012,11 @@ func (c *ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/feedbackMessages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9167,12 +9142,11 @@ func (c *ProjectsDatasetsDataItemsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9300,12 +9274,11 @@ func (c *ProjectsDatasetsDataItemsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9431,12 +9404,11 @@ func (c *ProjectsDatasetsEvaluationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9533,8 +9505,7 @@ func (c *ProjectsDatasetsEvaluationsExampleComparisonsSearchCall) Header() http. func (c *ProjectsDatasetsEvaluationsExampleComparisonsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1searchexamplecomparisonsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1searchexamplecomparisonsrequest) if err != nil { return nil, err } @@ -9658,8 +9629,7 @@ func (c *ProjectsDatasetsImageLabelCall) Header() http.Header { func (c *ProjectsDatasetsImageLabelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1labelimagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1labelimagerequest) if err != nil { return nil, err } @@ -9762,8 +9732,7 @@ func (c *ProjectsDatasetsTextLabelCall) Header() http.Header { func (c *ProjectsDatasetsTextLabelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1labeltextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1labeltextrequest) if err != nil { return nil, err } @@ -9866,8 +9835,7 @@ func (c *ProjectsDatasetsVideoLabelCall) Header() http.Header { func (c *ProjectsDatasetsVideoLabelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1labelvideorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1labelvideorequest) if err != nil { return nil, err } @@ -9968,8 +9936,7 @@ func (c *ProjectsEvaluationJobsCreateCall) Header() http.Header { func (c *ProjectsEvaluationJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1createevaluationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1createevaluationjobrequest) if err != nil { return nil, err } @@ -10069,12 +10036,11 @@ func (c *ProjectsEvaluationJobsDeleteCall) Header() http.Header { func (c *ProjectsEvaluationJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10178,12 +10144,11 @@ func (c *ProjectsEvaluationJobsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10315,12 +10280,11 @@ func (c *ProjectsEvaluationJobsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/evaluationJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10451,8 +10415,7 @@ func (c *ProjectsEvaluationJobsPatchCall) Header() http.Header { func (c *ProjectsEvaluationJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1evaluationjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1evaluationjob) if err != nil { return nil, err } @@ -10555,8 +10518,7 @@ func (c *ProjectsEvaluationJobsPauseCall) Header() http.Header { func (c *ProjectsEvaluationJobsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1pauseevaluationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1pauseevaluationjobrequest) if err != nil { return nil, err } @@ -10659,8 +10621,7 @@ func (c *ProjectsEvaluationJobsResumeCall) Header() http.Header { func (c *ProjectsEvaluationJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1resumeevaluationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1resumeevaluationjobrequest) if err != nil { return nil, err } @@ -10810,12 +10771,11 @@ func (c *ProjectsEvaluationsSearchCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/evaluations:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10929,8 +10889,7 @@ func (c *ProjectsInstructionsCreateCall) Header() http.Header { func (c *ProjectsInstructionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatalabelingv1beta1createinstructionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatalabelingv1beta1createinstructionrequest) if err != nil { return nil, err } @@ -11030,12 +10989,11 @@ func (c *ProjectsInstructionsDeleteCall) Header() http.Header { func (c *ProjectsInstructionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11139,12 +11097,11 @@ func (c *ProjectsInstructionsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11270,12 +11227,11 @@ func (c *ProjectsInstructionsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instructions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11409,12 +11365,11 @@ func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11508,12 +11463,11 @@ func (c *ProjectsOperationsDeleteCall) Header() http.Header { func (c *ProjectsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11618,12 +11572,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11747,12 +11700,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/datamigration/v1/datamigration-gen.go b/datamigration/v1/datamigration-gen.go index d603a2a8153..aa878c26ced 100644 --- a/datamigration/v1/datamigration-gen.go +++ b/datamigration/v1/datamigration-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5606,12 +5605,11 @@ func (c *ProjectsLocationsFetchStaticIpsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:fetchStaticIps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5735,12 +5733,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5866,12 +5863,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6018,8 +6014,7 @@ func (c *ProjectsLocationsConnectionProfilesCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -6137,12 +6132,11 @@ func (c *ProjectsLocationsConnectionProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6244,12 +6238,11 @@ func (c *ProjectsLocationsConnectionProfilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6372,12 +6365,11 @@ func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6519,12 +6511,11 @@ func (c *ProjectsLocationsConnectionProfilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectionProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6674,8 +6665,7 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -6779,8 +6769,7 @@ func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6887,8 +6876,7 @@ func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6992,8 +6980,7 @@ func (c *ProjectsLocationsConversionWorkspacesApplyCall) Header() http.Header { func (c *ProjectsLocationsConversionWorkspacesApplyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applyconversionworkspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applyconversionworkspacerequest) if err != nil { return nil, err } @@ -7093,8 +7080,7 @@ func (c *ProjectsLocationsConversionWorkspacesCommitCall) Header() http.Header { func (c *ProjectsLocationsConversionWorkspacesCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitconversionworkspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitconversionworkspacerequest) if err != nil { return nil, err } @@ -7196,8 +7182,7 @@ func (c *ProjectsLocationsConversionWorkspacesConvertCall) Header() http.Header func (c *ProjectsLocationsConversionWorkspacesConvertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertconversionworkspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.convertconversionworkspacerequest) if err != nil { return nil, err } @@ -7314,8 +7299,7 @@ func (c *ProjectsLocationsConversionWorkspacesCreateCall) Header() http.Header { func (c *ProjectsLocationsConversionWorkspacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionworkspace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionworkspace) if err != nil { return nil, err } @@ -7430,12 +7414,11 @@ func (c *ProjectsLocationsConversionWorkspacesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversionWorkspacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7548,12 +7531,11 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeConversionWorkspaceRevisio if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+conversionWorkspace}:describeConversionWorkspaceRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7746,12 +7728,11 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+conversionWorkspace}:describeDatabaseEntities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7875,12 +7856,11 @@ func (c *ProjectsLocationsConversionWorkspacesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8003,12 +7983,11 @@ func (c *ProjectsLocationsConversionWorkspacesGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8142,12 +8121,11 @@ func (c *ProjectsLocationsConversionWorkspacesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/conversionWorkspaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8281,8 +8259,7 @@ func (c *ProjectsLocationsConversionWorkspacesPatchCall) Header() http.Header { func (c *ProjectsLocationsConversionWorkspacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionworkspace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionworkspace) if err != nil { return nil, err } @@ -8382,8 +8359,7 @@ func (c *ProjectsLocationsConversionWorkspacesRollbackCall) Header() http.Header func (c *ProjectsLocationsConversionWorkspacesRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackconversionworkspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackconversionworkspacerequest) if err != nil { return nil, err } @@ -8524,12 +8500,11 @@ func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+conversionWorkspace}:searchBackgroundJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8626,8 +8601,7 @@ func (c *ProjectsLocationsConversionWorkspacesSeedCall) Header() http.Header { func (c *ProjectsLocationsConversionWorkspacesSeedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.seedconversionworkspacerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.seedconversionworkspacerequest) if err != nil { return nil, err } @@ -8731,8 +8705,7 @@ func (c *ProjectsLocationsConversionWorkspacesSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsConversionWorkspacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8839,8 +8812,7 @@ func (c *ProjectsLocationsConversionWorkspacesTestIamPermissionsCall) Header() h func (c *ProjectsLocationsConversionWorkspacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8958,8 +8930,7 @@ func (c *ProjectsLocationsConversionWorkspacesMappingRulesCreateCall) Header() h func (c *ProjectsLocationsConversionWorkspacesMappingRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mappingrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mappingrule) if err != nil { return nil, err } @@ -9067,12 +9038,11 @@ func (c *ProjectsLocationsConversionWorkspacesMappingRulesDeleteCall) Header() h func (c *ProjectsLocationsConversionWorkspacesMappingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9179,12 +9149,11 @@ func (c *ProjectsLocationsConversionWorkspacesMappingRulesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9280,8 +9249,7 @@ func (c *ProjectsLocationsConversionWorkspacesMappingRulesImportCall) Header() h func (c *ProjectsLocationsConversionWorkspacesMappingRulesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importmappingrulesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importmappingrulesrequest) if err != nil { return nil, err } @@ -9411,12 +9379,11 @@ func (c *ProjectsLocationsConversionWorkspacesMappingRulesListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/mappingRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9547,8 +9514,7 @@ func (c *ProjectsLocationsMigrationJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrationjob) if err != nil { return nil, err } @@ -9664,12 +9630,11 @@ func (c *ProjectsLocationsMigrationJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9764,8 +9729,7 @@ func (c *ProjectsLocationsMigrationJobsDemoteDestinationCall) Header() http.Head func (c *ProjectsLocationsMigrationJobsDemoteDestinationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.demotedestinationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.demotedestinationrequest) if err != nil { return nil, err } @@ -9879,12 +9843,11 @@ func (c *ProjectsLocationsMigrationJobsFetchSourceObjectsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:fetchSourceObjects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9978,8 +9941,7 @@ func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) Header() http.Head func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatesshscriptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatesshscriptrequest) if err != nil { return nil, err } @@ -10081,8 +10043,7 @@ func (c *ProjectsLocationsMigrationJobsGenerateTcpProxyScriptCall) Header() http func (c *ProjectsLocationsMigrationJobsGenerateTcpProxyScriptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatetcpproxyscriptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatetcpproxyscriptrequest) if err != nil { return nil, err } @@ -10192,12 +10153,11 @@ func (c *ProjectsLocationsMigrationJobsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10319,12 +10279,11 @@ func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10467,12 +10426,11 @@ func (c *ProjectsLocationsMigrationJobsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/migrationJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10605,8 +10563,7 @@ func (c *ProjectsLocationsMigrationJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrationjob) if err != nil { return nil, err } @@ -10707,8 +10664,7 @@ func (c *ProjectsLocationsMigrationJobsPromoteCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsPromoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotemigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promotemigrationjobrequest) if err != nil { return nil, err } @@ -10810,8 +10766,7 @@ func (c *ProjectsLocationsMigrationJobsRestartCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartmigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartmigrationjobrequest) if err != nil { return nil, err } @@ -10912,8 +10867,7 @@ func (c *ProjectsLocationsMigrationJobsResumeCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumemigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumemigrationjobrequest) if err != nil { return nil, err } @@ -11017,8 +10971,7 @@ func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11118,8 +11071,7 @@ func (c *ProjectsLocationsMigrationJobsStartCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationjobrequest) if err != nil { return nil, err } @@ -11219,8 +11171,7 @@ func (c *ProjectsLocationsMigrationJobsStopCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopmigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopmigrationjobrequest) if err != nil { return nil, err } @@ -11327,8 +11278,7 @@ func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11430,8 +11380,7 @@ func (c *ProjectsLocationsMigrationJobsVerifyCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifymigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifymigrationjobrequest) if err != nil { return nil, err } @@ -11541,12 +11490,11 @@ func (c *ProjectsLocationsMigrationJobsObjectsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11669,12 +11617,11 @@ func (c *ProjectsLocationsMigrationJobsObjectsGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11794,12 +11741,11 @@ func (c *ProjectsLocationsMigrationJobsObjectsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/objects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11914,8 +11860,7 @@ func (c *ProjectsLocationsMigrationJobsObjectsLookupCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsObjectsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookupmigrationjobobjectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookupmigrationjobobjectrequest) if err != nil { return nil, err } @@ -12020,8 +11965,7 @@ func (c *ProjectsLocationsMigrationJobsObjectsSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsMigrationJobsObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12128,8 +12072,7 @@ func (c *ProjectsLocationsMigrationJobsObjectsTestIamPermissionsCall) Header() h func (c *ProjectsLocationsMigrationJobsObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12238,8 +12181,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12340,12 +12282,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12449,12 +12390,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12577,12 +12517,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12720,8 +12659,7 @@ func (c *ProjectsLocationsPrivateConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privateconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privateconnection) if err != nil { return nil, err } @@ -12829,12 +12767,11 @@ func (c *ProjectsLocationsPrivateConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12936,12 +12873,11 @@ func (c *ProjectsLocationsPrivateConnectionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13064,12 +13000,11 @@ func (c *ProjectsLocationsPrivateConnectionsGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13209,12 +13144,11 @@ func (c *ProjectsLocationsPrivateConnectionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/privateConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13332,8 +13266,7 @@ func (c *ProjectsLocationsPrivateConnectionsSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsPrivateConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13440,8 +13373,7 @@ func (c *ProjectsLocationsPrivateConnectionsTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsPrivateConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/datamigration/v1beta1/datamigration-gen.go b/datamigration/v1beta1/datamigration-gen.go index d82f9ac92a8..b5614c14c3b 100644 --- a/datamigration/v1beta1/datamigration-gen.go +++ b/datamigration/v1beta1/datamigration-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1693,12 +1692,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1824,12 +1822,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1961,8 +1958,7 @@ func (c *ProjectsLocationsConnectionProfilesCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -2081,12 +2077,11 @@ func (c *ProjectsLocationsConnectionProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2188,12 +2183,11 @@ func (c *ProjectsLocationsConnectionProfilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2316,12 +2310,11 @@ func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2463,12 +2456,11 @@ func (c *ProjectsLocationsConnectionProfilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectionProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2603,8 +2595,7 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -2708,8 +2699,7 @@ func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2816,8 +2806,7 @@ func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2936,8 +2925,7 @@ func (c *ProjectsLocationsMigrationJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrationjob) if err != nil { return nil, err } @@ -3054,12 +3042,11 @@ func (c *ProjectsLocationsMigrationJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3153,8 +3140,7 @@ func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) Header() http.Head func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatesshscriptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatesshscriptrequest) if err != nil { return nil, err } @@ -3264,12 +3250,11 @@ func (c *ProjectsLocationsMigrationJobsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3391,12 +3376,11 @@ func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3539,12 +3523,11 @@ func (c *ProjectsLocationsMigrationJobsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/migrationJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3678,8 +3661,7 @@ func (c *ProjectsLocationsMigrationJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrationjob) if err != nil { return nil, err } @@ -3780,8 +3762,7 @@ func (c *ProjectsLocationsMigrationJobsPromoteCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsPromoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotemigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promotemigrationjobrequest) if err != nil { return nil, err } @@ -3883,8 +3864,7 @@ func (c *ProjectsLocationsMigrationJobsRestartCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartmigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartmigrationjobrequest) if err != nil { return nil, err } @@ -3985,8 +3965,7 @@ func (c *ProjectsLocationsMigrationJobsResumeCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumemigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumemigrationjobrequest) if err != nil { return nil, err } @@ -4090,8 +4069,7 @@ func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4191,8 +4169,7 @@ func (c *ProjectsLocationsMigrationJobsStartCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationjobrequest) if err != nil { return nil, err } @@ -4292,8 +4269,7 @@ func (c *ProjectsLocationsMigrationJobsStopCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopmigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopmigrationjobrequest) if err != nil { return nil, err } @@ -4400,8 +4376,7 @@ func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4503,8 +4478,7 @@ func (c *ProjectsLocationsMigrationJobsVerifyCall) Header() http.Header { func (c *ProjectsLocationsMigrationJobsVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifymigrationjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifymigrationjobrequest) if err != nil { return nil, err } @@ -4612,8 +4586,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4714,12 +4687,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4823,12 +4795,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4951,12 +4922,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/datapipelines/v1/datapipelines-gen.go b/datapipelines/v1/datapipelines-gen.go index bb7486c24a0..d0bf3e6d9fc 100644 --- a/datapipelines/v1/datapipelines-gen.go +++ b/datapipelines/v1/datapipelines-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -980,8 +979,7 @@ func (c *ProjectsLocationsPipelinesCreateCall) Header() http.Header { func (c *ProjectsLocationsPipelinesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1pipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatapipelinesv1pipeline) if err != nil { return nil, err } @@ -1082,12 +1080,11 @@ func (c *ProjectsLocationsPipelinesDeleteCall) Header() http.Header { func (c *ProjectsLocationsPipelinesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1193,12 +1190,11 @@ func (c *ProjectsLocationsPipelinesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1334,12 +1330,11 @@ func (c *ProjectsLocationsPipelinesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pipelines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1476,8 +1471,7 @@ func (c *ProjectsLocationsPipelinesPatchCall) Header() http.Header { func (c *ProjectsLocationsPipelinesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1pipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatapipelinesv1pipeline) if err != nil { return nil, err } @@ -1583,8 +1577,7 @@ func (c *ProjectsLocationsPipelinesRunCall) Header() http.Header { func (c *ProjectsLocationsPipelinesRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1runpipelinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatapipelinesv1runpipelinerequest) if err != nil { return nil, err } @@ -1688,8 +1681,7 @@ func (c *ProjectsLocationsPipelinesStopCall) Header() http.Header { func (c *ProjectsLocationsPipelinesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1stoppipelinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddatapipelinesv1stoppipelinerequest) if err != nil { return nil, err } @@ -1820,12 +1812,11 @@ func (c *ProjectsLocationsPipelinesJobsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/dataplex/v1/dataplex-gen.go b/dataplex/v1/dataplex-gen.go index 2d84971e7cf..48b7de1c551 100644 --- a/dataplex/v1/dataplex-gen.go +++ b/dataplex/v1/dataplex-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -8318,12 +8317,11 @@ func (c *OrganizationsLocationsEncryptionConfigsGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8420,8 +8418,7 @@ func (c *OrganizationsLocationsEncryptionConfigsSetIamPolicyCall) Header() http. func (c *OrganizationsLocationsEncryptionConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -8529,8 +8526,7 @@ func (c *OrganizationsLocationsEncryptionConfigsTestIamPermissionsCall) Header() func (c *OrganizationsLocationsEncryptionConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -8639,8 +8635,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -8741,12 +8736,11 @@ func (c *OrganizationsLocationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8850,12 +8844,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8980,12 +8973,11 @@ func (c *OrganizationsLocationsOperationsListOperationsCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9109,12 +9101,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9241,12 +9232,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9422,12 +9412,11 @@ func (c *ProjectsLocationsLookupEntryCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:lookupEntry") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9560,12 +9549,11 @@ func (c *ProjectsLocationsSearchEntriesCall) Header() http.Header { func (c *ProjectsLocationsSearchEntriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchEntries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9696,8 +9684,7 @@ func (c *ProjectsLocationsAspectTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsAspectTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1aspecttype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1aspecttype) if err != nil { return nil, err } @@ -9806,12 +9793,11 @@ func (c *ProjectsLocationsAspectTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAspectTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9916,12 +9902,11 @@ func (c *ProjectsLocationsAspectTypesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10044,12 +10029,11 @@ func (c *ProjectsLocationsAspectTypesGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10188,12 +10172,11 @@ func (c *ProjectsLocationsAspectTypesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/aspectTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10324,8 +10307,7 @@ func (c *ProjectsLocationsAspectTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsAspectTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1aspecttype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1aspecttype) if err != nil { return nil, err } @@ -10430,8 +10412,7 @@ func (c *ProjectsLocationsAspectTypesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAspectTypesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -10539,8 +10520,7 @@ func (c *ProjectsLocationsAspectTypesTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsAspectTypesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -10659,8 +10639,7 @@ func (c *ProjectsLocationsDataAttributeBindingsCreateCall) Header() http.Header func (c *ProjectsLocationsDataAttributeBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1dataattributebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1dataattributebinding) if err != nil { return nil, err } @@ -10772,12 +10751,11 @@ func (c *ProjectsLocationsDataAttributeBindingsDeleteCall) Header() http.Header func (c *ProjectsLocationsDataAttributeBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10882,12 +10860,11 @@ func (c *ProjectsLocationsDataAttributeBindingsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11010,12 +10987,11 @@ func (c *ProjectsLocationsDataAttributeBindingsGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11153,12 +11129,11 @@ func (c *ProjectsLocationsDataAttributeBindingsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataAttributeBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11291,8 +11266,7 @@ func (c *ProjectsLocationsDataAttributeBindingsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataAttributeBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1dataattributebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1dataattributebinding) if err != nil { return nil, err } @@ -11397,8 +11371,7 @@ func (c *ProjectsLocationsDataAttributeBindingsSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDataAttributeBindingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -11506,8 +11479,7 @@ func (c *ProjectsLocationsDataAttributeBindingsTestIamPermissionsCall) Header() func (c *ProjectsLocationsDataAttributeBindingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -11626,8 +11598,7 @@ func (c *ProjectsLocationsDataScansCreateCall) Header() http.Header { func (c *ProjectsLocationsDataScansCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1datascan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1datascan) if err != nil { return nil, err } @@ -11737,12 +11708,11 @@ func (c *ProjectsLocationsDataScansDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataScansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11840,8 +11810,7 @@ func (c *ProjectsLocationsDataScansGenerateDataQualityRulesCall) Header() http.H func (c *ProjectsLocationsDataScansGenerateDataQualityRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1generatedataqualityrulesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1generatedataqualityrulesrequest) if err != nil { return nil, err } @@ -11968,12 +11937,11 @@ func (c *ProjectsLocationsDataScansGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12096,12 +12064,11 @@ func (c *ProjectsLocationsDataScansGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12237,12 +12204,11 @@ func (c *ProjectsLocationsDataScansListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataScans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12374,8 +12340,7 @@ func (c *ProjectsLocationsDataScansPatchCall) Header() http.Header { func (c *ProjectsLocationsDataScansPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1datascan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1datascan) if err != nil { return nil, err } @@ -12479,8 +12444,7 @@ func (c *ProjectsLocationsDataScansRunCall) Header() http.Header { func (c *ProjectsLocationsDataScansRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1rundatascanrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1rundatascanrequest) if err != nil { return nil, err } @@ -12585,8 +12549,7 @@ func (c *ProjectsLocationsDataScansSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataScansSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -12694,8 +12657,7 @@ func (c *ProjectsLocationsDataScansTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsDataScansTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -12801,8 +12763,7 @@ func (c *ProjectsLocationsDataScansJobsGenerateDataQualityRulesCall) Header() ht func (c *ProjectsLocationsDataScansJobsGenerateDataQualityRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1generatedataqualityrulesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1generatedataqualityrulesrequest) if err != nil { return nil, err } @@ -12929,12 +12890,11 @@ func (c *ProjectsLocationsDataScansJobsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13072,12 +13032,11 @@ func (c *ProjectsLocationsDataScansJobsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13209,8 +13168,7 @@ func (c *ProjectsLocationsDataTaxonomiesCreateCall) Header() http.Header { func (c *ProjectsLocationsDataTaxonomiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1datataxonomy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1datataxonomy) if err != nil { return nil, err } @@ -13320,12 +13278,11 @@ func (c *ProjectsLocationsDataTaxonomiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataTaxonomiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13430,12 +13387,11 @@ func (c *ProjectsLocationsDataTaxonomiesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13558,12 +13514,11 @@ func (c *ProjectsLocationsDataTaxonomiesGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13699,12 +13654,11 @@ func (c *ProjectsLocationsDataTaxonomiesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataTaxonomies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13835,8 +13789,7 @@ func (c *ProjectsLocationsDataTaxonomiesPatchCall) Header() http.Header { func (c *ProjectsLocationsDataTaxonomiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1datataxonomy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1datataxonomy) if err != nil { return nil, err } @@ -13941,8 +13894,7 @@ func (c *ProjectsLocationsDataTaxonomiesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDataTaxonomiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -14050,8 +14002,7 @@ func (c *ProjectsLocationsDataTaxonomiesTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsDataTaxonomiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -14171,8 +14122,7 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesCreateCall) Header() http.Head func (c *ProjectsLocationsDataTaxonomiesAttributesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1dataattribute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1dataattribute) if err != nil { return nil, err } @@ -14281,12 +14231,11 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesDeleteCall) Header() http.Head func (c *ProjectsLocationsDataTaxonomiesAttributesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14391,12 +14340,11 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14519,12 +14467,11 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesGetIamPolicyCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14660,12 +14607,11 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14796,8 +14742,7 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesPatchCall) Header() http.Heade func (c *ProjectsLocationsDataTaxonomiesAttributesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1dataattribute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1dataattribute) if err != nil { return nil, err } @@ -14902,8 +14847,7 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesSetIamPolicyCall) Header() htt func (c *ProjectsLocationsDataTaxonomiesAttributesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -15011,8 +14955,7 @@ func (c *ProjectsLocationsDataTaxonomiesAttributesTestIamPermissionsCall) Header func (c *ProjectsLocationsDataTaxonomiesAttributesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -15130,8 +15073,7 @@ func (c *ProjectsLocationsEntryGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entrygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entrygroup) if err != nil { return nil, err } @@ -15240,12 +15182,11 @@ func (c *ProjectsLocationsEntryGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15350,12 +15291,11 @@ func (c *ProjectsLocationsEntryGroupsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15478,12 +15418,11 @@ func (c *ProjectsLocationsEntryGroupsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15619,12 +15558,11 @@ func (c *ProjectsLocationsEntryGroupsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entryGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15756,8 +15694,7 @@ func (c *ProjectsLocationsEntryGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entrygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entrygroup) if err != nil { return nil, err } @@ -15862,8 +15799,7 @@ func (c *ProjectsLocationsEntryGroupsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -15971,8 +15907,7 @@ func (c *ProjectsLocationsEntryGroupsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsEntryGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -16092,8 +16027,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entry) if err != nil { return nil, err } @@ -16194,12 +16128,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16345,12 +16278,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16487,12 +16419,11 @@ func (c *ProjectsLocationsEntryGroupsEntriesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16648,8 +16579,7 @@ func (c *ProjectsLocationsEntryGroupsEntriesPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryGroupsEntriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entry) if err != nil { return nil, err } @@ -16780,12 +16710,11 @@ func (c *ProjectsLocationsEntryLinkTypesGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16882,8 +16811,7 @@ func (c *ProjectsLocationsEntryLinkTypesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryLinkTypesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -16991,8 +16919,7 @@ func (c *ProjectsLocationsEntryLinkTypesTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsEntryLinkTypesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -17110,8 +17037,7 @@ func (c *ProjectsLocationsEntryTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsEntryTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entrytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entrytype) if err != nil { return nil, err } @@ -17220,12 +17146,11 @@ func (c *ProjectsLocationsEntryTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsEntryTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17330,12 +17255,11 @@ func (c *ProjectsLocationsEntryTypesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17458,12 +17382,11 @@ func (c *ProjectsLocationsEntryTypesGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17602,12 +17525,11 @@ func (c *ProjectsLocationsEntryTypesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entryTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17739,8 +17661,7 @@ func (c *ProjectsLocationsEntryTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsEntryTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entrytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entrytype) if err != nil { return nil, err } @@ -17845,8 +17766,7 @@ func (c *ProjectsLocationsEntryTypesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEntryTypesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -17954,8 +17874,7 @@ func (c *ProjectsLocationsEntryTypesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsEntryTypesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -18086,12 +18005,11 @@ func (c *ProjectsLocationsGlossariesGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18188,8 +18106,7 @@ func (c *ProjectsLocationsGlossariesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlossariesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -18297,8 +18214,7 @@ func (c *ProjectsLocationsGlossariesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsGlossariesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -18429,12 +18345,11 @@ func (c *ProjectsLocationsGlossariesCategoriesGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18531,8 +18446,7 @@ func (c *ProjectsLocationsGlossariesCategoriesSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsGlossariesCategoriesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -18640,8 +18554,7 @@ func (c *ProjectsLocationsGlossariesCategoriesTestIamPermissionsCall) Header() h func (c *ProjectsLocationsGlossariesCategoriesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -18772,12 +18685,11 @@ func (c *ProjectsLocationsGlossariesTermsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18874,8 +18786,7 @@ func (c *ProjectsLocationsGlossariesTermsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsGlossariesTermsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -18983,8 +18894,7 @@ func (c *ProjectsLocationsGlossariesTermsTestIamPermissionsCall) Header() http.H func (c *ProjectsLocationsGlossariesTermsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -19115,12 +19025,11 @@ func (c *ProjectsLocationsGovernanceRulesGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19217,8 +19126,7 @@ func (c *ProjectsLocationsGovernanceRulesSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsGovernanceRulesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -19326,8 +19234,7 @@ func (c *ProjectsLocationsGovernanceRulesTestIamPermissionsCall) Header() http.H func (c *ProjectsLocationsGovernanceRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -19448,8 +19355,7 @@ func (c *ProjectsLocationsLakesCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1lake) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1lake) if err != nil { return nil, err } @@ -19550,12 +19456,11 @@ func (c *ProjectsLocationsLakesDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19659,12 +19564,11 @@ func (c *ProjectsLocationsLakesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19787,12 +19691,11 @@ func (c *ProjectsLocationsLakesGetIamPolicyCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19928,12 +19831,11 @@ func (c *ProjectsLocationsLakesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lakes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20062,8 +19964,7 @@ func (c *ProjectsLocationsLakesPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1lake) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1lake) if err != nil { return nil, err } @@ -20168,8 +20069,7 @@ func (c *ProjectsLocationsLakesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsLakesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -20277,8 +20177,7 @@ func (c *ProjectsLocationsLakesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsLakesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -20408,12 +20307,11 @@ func (c *ProjectsLocationsLakesActionsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/actions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20535,8 +20433,7 @@ func (c *ProjectsLocationsLakesContentCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesContentCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1content) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1content) if err != nil { return nil, err } @@ -20637,12 +20534,11 @@ func (c *ProjectsLocationsLakesContentDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesContentDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20762,12 +20658,11 @@ func (c *ProjectsLocationsLakesContentGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20893,12 +20788,11 @@ func (c *ProjectsLocationsLakesContentGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21029,12 +20923,11 @@ func (c *ProjectsLocationsLakesContentListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/content") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21164,8 +21057,7 @@ func (c *ProjectsLocationsLakesContentPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesContentPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1content) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1content) if err != nil { return nil, err } @@ -21270,8 +21162,7 @@ func (c *ProjectsLocationsLakesContentSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsLakesContentSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -21380,8 +21271,7 @@ func (c *ProjectsLocationsLakesContentTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsLakesContentTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -21490,8 +21380,7 @@ func (c *ProjectsLocationsLakesContentitemsCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesContentitemsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1content) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1content) if err != nil { return nil, err } @@ -21592,12 +21481,11 @@ func (c *ProjectsLocationsLakesContentitemsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesContentitemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21717,12 +21605,11 @@ func (c *ProjectsLocationsLakesContentitemsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21848,12 +21735,11 @@ func (c *ProjectsLocationsLakesContentitemsGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21984,12 +21870,11 @@ func (c *ProjectsLocationsLakesContentitemsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contentitems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22119,8 +22004,7 @@ func (c *ProjectsLocationsLakesContentitemsPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesContentitemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1content) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1content) if err != nil { return nil, err } @@ -22225,8 +22109,7 @@ func (c *ProjectsLocationsLakesContentitemsSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsLakesContentitemsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -22335,8 +22218,7 @@ func (c *ProjectsLocationsLakesContentitemsTestIamPermissionsCall) Header() http func (c *ProjectsLocationsLakesContentitemsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -22454,8 +22336,7 @@ func (c *ProjectsLocationsLakesEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1environment) if err != nil { return nil, err } @@ -22557,12 +22438,11 @@ func (c *ProjectsLocationsLakesEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22667,12 +22547,11 @@ func (c *ProjectsLocationsLakesEnvironmentsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22795,12 +22674,11 @@ func (c *ProjectsLocationsLakesEnvironmentsGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22935,12 +22813,11 @@ func (c *ProjectsLocationsLakesEnvironmentsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23071,8 +22948,7 @@ func (c *ProjectsLocationsLakesEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1environment) if err != nil { return nil, err } @@ -23177,8 +23053,7 @@ func (c *ProjectsLocationsLakesEnvironmentsSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsLakesEnvironmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -23286,8 +23161,7 @@ func (c *ProjectsLocationsLakesEnvironmentsTestIamPermissionsCall) Header() http func (c *ProjectsLocationsLakesEnvironmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -23430,12 +23304,11 @@ func (c *ProjectsLocationsLakesEnvironmentsSessionsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23563,8 +23436,7 @@ func (c *ProjectsLocationsLakesTasksCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesTasksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1task) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1task) if err != nil { return nil, err } @@ -23665,12 +23537,11 @@ func (c *ProjectsLocationsLakesTasksDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesTasksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23775,12 +23646,11 @@ func (c *ProjectsLocationsLakesTasksGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23903,12 +23773,11 @@ func (c *ProjectsLocationsLakesTasksGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24043,12 +23912,11 @@ func (c *ProjectsLocationsLakesTasksListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24178,8 +24046,7 @@ func (c *ProjectsLocationsLakesTasksPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesTasksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1task) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1task) if err != nil { return nil, err } @@ -24282,8 +24149,7 @@ func (c *ProjectsLocationsLakesTasksRunCall) Header() http.Header { func (c *ProjectsLocationsLakesTasksRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1runtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1runtaskrequest) if err != nil { return nil, err } @@ -24388,8 +24254,7 @@ func (c *ProjectsLocationsLakesTasksSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsLakesTasksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -24497,8 +24362,7 @@ func (c *ProjectsLocationsLakesTasksTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsLakesTasksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -24601,8 +24465,7 @@ func (c *ProjectsLocationsLakesTasksJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsLakesTasksJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1canceljobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1canceljobrequest) if err != nil { return nil, err } @@ -24714,12 +24577,11 @@ func (c *ProjectsLocationsLakesTasksJobsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24842,12 +24704,11 @@ func (c *ProjectsLocationsLakesTasksJobsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24981,8 +24842,7 @@ func (c *ProjectsLocationsLakesZonesCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1zone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1zone) if err != nil { return nil, err } @@ -25084,12 +24944,11 @@ func (c *ProjectsLocationsLakesZonesDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25194,12 +25053,11 @@ func (c *ProjectsLocationsLakesZonesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25322,12 +25180,11 @@ func (c *ProjectsLocationsLakesZonesGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25462,12 +25319,11 @@ func (c *ProjectsLocationsLakesZonesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25597,8 +25453,7 @@ func (c *ProjectsLocationsLakesZonesPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1zone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1zone) if err != nil { return nil, err } @@ -25703,8 +25558,7 @@ func (c *ProjectsLocationsLakesZonesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -25812,8 +25666,7 @@ func (c *ProjectsLocationsLakesZonesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsLakesZonesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -25944,12 +25797,11 @@ func (c *ProjectsLocationsLakesZonesActionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/actions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26083,8 +25935,7 @@ func (c *ProjectsLocationsLakesZonesAssetsCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesAssetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1asset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1asset) if err != nil { return nil, err } @@ -26186,12 +26037,11 @@ func (c *ProjectsLocationsLakesZonesAssetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesAssetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26296,12 +26146,11 @@ func (c *ProjectsLocationsLakesZonesAssetsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26424,12 +26273,11 @@ func (c *ProjectsLocationsLakesZonesAssetsGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26565,12 +26413,11 @@ func (c *ProjectsLocationsLakesZonesAssetsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26700,8 +26547,7 @@ func (c *ProjectsLocationsLakesZonesAssetsPatchCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesAssetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1asset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1asset) if err != nil { return nil, err } @@ -26806,8 +26652,7 @@ func (c *ProjectsLocationsLakesZonesAssetsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsLakesZonesAssetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -26915,8 +26760,7 @@ func (c *ProjectsLocationsLakesZonesAssetsTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsLakesZonesAssetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -27047,12 +26891,11 @@ func (c *ProjectsLocationsLakesZonesAssetsActionsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/actions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27175,8 +27018,7 @@ func (c *ProjectsLocationsLakesZonesEntitiesCreateCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesEntitiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entity) if err != nil { return nil, err } @@ -27284,12 +27126,11 @@ func (c *ProjectsLocationsLakesZonesEntitiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesEntitiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27409,12 +27250,11 @@ func (c *ProjectsLocationsLakesZonesEntitiesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27564,12 +27404,11 @@ func (c *ProjectsLocationsLakesZonesEntitiesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/entities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27692,8 +27531,7 @@ func (c *ProjectsLocationsLakesZonesEntitiesUpdateCall) Header() http.Header { func (c *ProjectsLocationsLakesZonesEntitiesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1entity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1entity) if err != nil { return nil, err } @@ -27803,8 +27641,7 @@ func (c *ProjectsLocationsLakesZonesEntitiesPartitionsCreateCall) Header() http. func (c *ProjectsLocationsLakesZonesEntitiesPartitionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1partition) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1partition) if err != nil { return nil, err } @@ -27914,12 +27751,11 @@ func (c *ProjectsLocationsLakesZonesEntitiesPartitionsDeleteCall) Header() http. func (c *ProjectsLocationsLakesZonesEntitiesPartitionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28025,12 +27861,11 @@ func (c *ProjectsLocationsLakesZonesEntitiesPartitionsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28168,12 +28003,11 @@ func (c *ProjectsLocationsLakesZonesEntitiesPartitionsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/partitions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28292,8 +28126,7 @@ func (c *ProjectsLocationsMetadataJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsMetadataJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1cancelmetadatajobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1cancelmetadatajobrequest) if err != nil { return nil, err } @@ -28411,8 +28244,7 @@ func (c *ProjectsLocationsMetadataJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsMetadataJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddataplexv1metadatajob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddataplexv1metadatajob) if err != nil { return nil, err } @@ -28525,12 +28357,11 @@ func (c *ProjectsLocationsMetadataJobsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28669,12 +28500,11 @@ func (c *ProjectsLocationsMetadataJobsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/metadataJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28796,8 +28626,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -28898,12 +28727,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29007,12 +28835,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29136,12 +28963,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/dataportability/v1/dataportability-gen.go b/dataportability/v1/dataportability-gen.go index 46b45dd8d12..886a5b5b660 100644 --- a/dataportability/v1/dataportability-gen.go +++ b/dataportability/v1/dataportability-gen.go @@ -386,7 +386,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.ArchiveJobs = NewArchiveJobsService(s) + s.Authorization = NewAuthorizationService(s) + s.PortabilityArchive = NewPortabilityArchiveService(s) if err != nil { return nil, err } @@ -405,11 +408,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.ArchiveJobs = NewArchiveJobsService(s) - s.Authorization = NewAuthorizationService(s) - s.PortabilityArchive = NewPortabilityArchiveService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -649,12 +648,11 @@ func (c *ArchiveJobsGetPortabilityArchiveStateCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -749,8 +747,7 @@ func (c *ArchiveJobsRetryCall) Header() http.Header { func (c *ArchiveJobsRetryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.retryportabilityarchiverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.retryportabilityarchiverequest) if err != nil { return nil, err } @@ -851,8 +848,7 @@ func (c *AuthorizationResetCall) Header() http.Header { func (c *AuthorizationResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetauthorizationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetauthorizationrequest) if err != nil { return nil, err } @@ -945,8 +941,7 @@ func (c *PortabilityArchiveInitiateCall) Header() http.Header { func (c *PortabilityArchiveInitiateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiateportabilityarchiverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initiateportabilityarchiverequest) if err != nil { return nil, err } diff --git a/dataportability/v1beta/dataportability-gen.go b/dataportability/v1beta/dataportability-gen.go index d421de3fa54..a05755f932e 100644 --- a/dataportability/v1beta/dataportability-gen.go +++ b/dataportability/v1beta/dataportability-gen.go @@ -386,7 +386,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.ArchiveJobs = NewArchiveJobsService(s) + s.Authorization = NewAuthorizationService(s) + s.PortabilityArchive = NewPortabilityArchiveService(s) if err != nil { return nil, err } @@ -405,11 +408,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.ArchiveJobs = NewArchiveJobsService(s) - s.Authorization = NewAuthorizationService(s) - s.PortabilityArchive = NewPortabilityArchiveService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -649,12 +648,11 @@ func (c *ArchiveJobsGetPortabilityArchiveStateCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -749,8 +747,7 @@ func (c *ArchiveJobsRetryCall) Header() http.Header { func (c *ArchiveJobsRetryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.retryportabilityarchiverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.retryportabilityarchiverequest) if err != nil { return nil, err } @@ -851,8 +848,7 @@ func (c *AuthorizationResetCall) Header() http.Header { func (c *AuthorizationResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetauthorizationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetauthorizationrequest) if err != nil { return nil, err } @@ -945,8 +941,7 @@ func (c *PortabilityArchiveInitiateCall) Header() http.Header { func (c *PortabilityArchiveInitiateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiateportabilityarchiverequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initiateportabilityarchiverequest) if err != nil { return nil, err } diff --git a/dataproc/v1/dataproc-gen.go b/dataproc/v1/dataproc-gen.go index edf1b2abef7..6fa54d14478 100644 --- a/dataproc/v1/dataproc-gen.go +++ b/dataproc/v1/dataproc-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9336,8 +9335,7 @@ func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscalingpolicy) if err != nil { return nil, err } @@ -9444,12 +9442,11 @@ func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9558,12 +9555,11 @@ func (c *ProjectsLocationsAutoscalingPoliciesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9659,8 +9655,7 @@ func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -9791,12 +9786,11 @@ func (c *ProjectsLocationsAutoscalingPoliciesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/autoscalingPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9914,8 +9908,7 @@ func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10022,8 +10015,7 @@ func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10132,8 +10124,7 @@ func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Header() http.Header { func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscalingpolicy) if err != nil { return nil, err } @@ -10235,8 +10226,7 @@ func (c *ProjectsLocationsBatchesAnalyzeCall) Header() http.Header { func (c *ProjectsLocationsBatchesAnalyzeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzebatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzebatchrequest) if err != nil { return nil, err } @@ -10358,8 +10348,7 @@ func (c *ProjectsLocationsBatchesCreateCall) Header() http.Header { func (c *ProjectsLocationsBatchesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batch) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batch) if err != nil { return nil, err } @@ -10460,12 +10449,11 @@ func (c *ProjectsLocationsBatchesDeleteCall) Header() http.Header { func (c *ProjectsLocationsBatchesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10568,12 +10556,11 @@ func (c *ProjectsLocationsBatchesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10716,12 +10703,11 @@ func (c *ProjectsLocationsBatchesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/batches") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10855,12 +10841,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10972,12 +10957,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessEnvironmentInfoCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessEnvironmentInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11096,12 +11080,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessJobCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessJob") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11222,12 +11205,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessSqlPlanCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessSqlPlan") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11361,12 +11343,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessSqlQueryCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessSqlQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11502,12 +11483,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessStageAttemptCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessStageAttempt") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11626,12 +11606,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsAccessStageRddGraphCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessStageRddGraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11793,12 +11772,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sparkApplications:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11961,12 +11939,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchExecutorStageSummaryCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchExecutorStageSummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12129,12 +12106,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchExecutorsCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchExecutors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12298,12 +12274,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchJobsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12467,12 +12442,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchSqlQueriesCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchSqlQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12658,12 +12632,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchStageAttemptTasksCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchStageAttemptTasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12831,12 +12804,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchStageAttemptsCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchStageAttempts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13012,12 +12984,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSearchStagesCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchStages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13151,12 +13122,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSummarizeExecutorsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeExecutors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13268,12 +13238,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSummarizeJobsCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13399,12 +13368,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSummarizeStageAttemptTasksCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeStageAttemptTasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13516,12 +13484,11 @@ func (c *ProjectsLocationsBatchesSparkApplicationsSummarizeStagesCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeStages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13617,8 +13584,7 @@ func (c *ProjectsLocationsBatchesSparkApplicationsWriteCall) Header() http.Heade func (c *ProjectsLocationsBatchesSparkApplicationsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writesparkapplicationcontextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writesparkapplicationcontextrequest) if err != nil { return nil, err } @@ -13725,12 +13691,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13823,12 +13788,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13932,12 +13896,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14060,12 +14023,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14179,8 +14141,7 @@ func (c *ProjectsLocationsSessionTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsSessionTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sessiontemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sessiontemplate) if err != nil { return nil, err } @@ -14279,12 +14240,11 @@ func (c *ProjectsLocationsSessionTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSessionTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14386,12 +14346,11 @@ func (c *ProjectsLocationsSessionTemplatesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14518,12 +14477,11 @@ func (c *ProjectsLocationsSessionTemplatesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sessionTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14637,8 +14595,7 @@ func (c *ProjectsLocationsSessionTemplatesPatchCall) Header() http.Header { func (c *ProjectsLocationsSessionTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sessiontemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sessiontemplate) if err != nil { return nil, err } @@ -14760,8 +14717,7 @@ func (c *ProjectsLocationsSessionsCreateCall) Header() http.Header { func (c *ProjectsLocationsSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.session) if err != nil { return nil, err } @@ -14873,12 +14829,11 @@ func (c *ProjectsLocationsSessionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14980,12 +14935,11 @@ func (c *ProjectsLocationsSessionsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15120,12 +15074,11 @@ func (c *ProjectsLocationsSessionsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15239,8 +15192,7 @@ func (c *ProjectsLocationsSessionsTerminateCall) Header() http.Header { func (c *ProjectsLocationsSessionsTerminateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.terminatesessionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.terminatesessionrequest) if err != nil { return nil, err } @@ -15360,12 +15312,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15477,12 +15428,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessEnvironmentInfoCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessEnvironmentInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15601,12 +15551,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessJobCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessJob") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15727,12 +15676,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessSqlPlanCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessSqlPlan") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15868,12 +15816,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessSqlQueryCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessSqlQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16009,12 +15956,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessStageAttemptCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessStageAttempt") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16133,12 +16079,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsAccessStageRddGraphCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accessStageRddGraph") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16300,12 +16245,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sparkApplications:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16468,12 +16412,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchExecutorStageSummaryCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchExecutorStageSummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16636,12 +16579,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchExecutorsCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchExecutors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16805,12 +16747,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchJobsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16974,12 +16915,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchSqlQueriesCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchSqlQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17165,12 +17105,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchStageAttemptTasksCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchStageAttemptTasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17340,12 +17279,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchStageAttemptsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchStageAttempts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17521,12 +17459,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSearchStagesCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:searchStages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17660,12 +17597,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSummarizeExecutorsCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeExecutors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17777,12 +17713,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSummarizeJobsCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17908,12 +17843,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSummarizeStageAttemptTasksCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeStageAttemptTasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18025,12 +17959,11 @@ func (c *ProjectsLocationsSessionsSparkApplicationsSummarizeStagesCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:summarizeStages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18126,8 +18059,7 @@ func (c *ProjectsLocationsSessionsSparkApplicationsWriteCall) Header() http.Head func (c *ProjectsLocationsSessionsSparkApplicationsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writesessionsparkapplicationcontextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writesessionsparkapplicationcontextrequest) if err != nil { return nil, err } @@ -18234,8 +18166,7 @@ func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowtemplate) if err != nil { return nil, err } @@ -18350,12 +18281,11 @@ func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18473,12 +18403,11 @@ func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18574,8 +18503,7 @@ func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -18691,8 +18619,7 @@ func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantiateworkflowtemplaterequest) if err != nil { return nil, err } @@ -18822,8 +18749,7 @@ func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowtemplate) if err != nil { return nil, err } @@ -18953,12 +18879,11 @@ func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19076,8 +19001,7 @@ func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -19184,8 +19108,7 @@ func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -19294,8 +19217,7 @@ func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header { func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowtemplate) if err != nil { return nil, err } @@ -19402,8 +19324,7 @@ func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Header() http.Header { func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscalingpolicy) if err != nil { return nil, err } @@ -19510,12 +19431,11 @@ func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Header() http.Header { func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19624,12 +19544,11 @@ func (c *ProjectsRegionsAutoscalingPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19725,8 +19644,7 @@ func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Header() http.Heade func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -19857,12 +19775,11 @@ func (c *ProjectsRegionsAutoscalingPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/autoscalingPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19980,8 +19897,7 @@ func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Header() http.Heade func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -20088,8 +20004,7 @@ func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Header() http func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -20198,8 +20113,7 @@ func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Header() http.Header { func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoscalingpolicy) if err != nil { return nil, err } @@ -20340,8 +20254,7 @@ func (c *ProjectsRegionsClustersCreateCall) Header() http.Header { func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -20484,12 +20397,11 @@ func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header { func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20595,8 +20507,7 @@ func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header { func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diagnoseclusterrequest) if err != nil { return nil, err } @@ -20715,12 +20626,11 @@ func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20817,8 +20727,7 @@ func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header { func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -20927,8 +20836,7 @@ func (c *ProjectsRegionsClustersInjectCredentialsCall) Header() http.Header { func (c *ProjectsRegionsClustersInjectCredentialsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectcredentialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.injectcredentialsrequest) if err != nil { return nil, err } @@ -21075,12 +20983,11 @@ func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21253,8 +21160,7 @@ func (c *ProjectsRegionsClustersPatchCall) Header() http.Header { func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -21363,8 +21269,7 @@ func (c *ProjectsRegionsClustersRepairCall) Header() http.Header { func (c *ProjectsRegionsClustersRepairCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repairclusterrequest) if err != nil { return nil, err } @@ -21470,8 +21375,7 @@ func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header { func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -21578,8 +21482,7 @@ func (c *ProjectsRegionsClustersStartCall) Header() http.Header { func (c *ProjectsRegionsClustersStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startclusterrequest) if err != nil { return nil, err } @@ -21688,8 +21591,7 @@ func (c *ProjectsRegionsClustersStopCall) Header() http.Header { func (c *ProjectsRegionsClustersStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopclusterrequest) if err != nil { return nil, err } @@ -21798,8 +21700,7 @@ func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header { func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -21933,8 +21834,7 @@ func (c *ProjectsRegionsClustersNodeGroupsCreateCall) Header() http.Header { func (c *ProjectsRegionsClustersNodeGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.nodegroup) if err != nil { return nil, err } @@ -22046,12 +21946,11 @@ func (c *ProjectsRegionsClustersNodeGroupsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22145,8 +22044,7 @@ func (c *ProjectsRegionsClustersNodeGroupsRepairCall) Header() http.Header { func (c *ProjectsRegionsClustersNodeGroupsRepairCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairnodegrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repairnodegrouprequest) if err != nil { return nil, err } @@ -22250,8 +22148,7 @@ func (c *ProjectsRegionsClustersNodeGroupsResizeCall) Header() http.Header { func (c *ProjectsRegionsClustersNodeGroupsResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resizenodegrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resizenodegrouprequest) if err != nil { return nil, err } @@ -22362,8 +22259,7 @@ func (c *ProjectsRegionsJobsCancelCall) Header() http.Header { func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceljobrequest) if err != nil { return nil, err } @@ -22471,12 +22367,11 @@ func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header { func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22587,12 +22482,11 @@ func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22689,8 +22583,7 @@ func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header { func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -22856,12 +22749,11 @@ func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22993,8 +22885,7 @@ func (c *ProjectsRegionsJobsPatchCall) Header() http.Header { func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -23100,8 +22991,7 @@ func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -23205,8 +23095,7 @@ func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header { func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.submitjobrequest) if err != nil { return nil, err } @@ -23311,8 +23200,7 @@ func (c *ProjectsRegionsJobsSubmitAsOperationCall) Header() http.Header { func (c *ProjectsRegionsJobsSubmitAsOperationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.submitjobrequest) if err != nil { return nil, err } @@ -23420,8 +23308,7 @@ func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -23528,12 +23415,11 @@ func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header { func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -23626,12 +23512,11 @@ func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header { func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23735,12 +23620,11 @@ func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23835,8 +23719,7 @@ func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header { func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -23967,12 +23850,11 @@ func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24090,8 +23972,7 @@ func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -24198,8 +24079,7 @@ func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -24306,8 +24186,7 @@ func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header { func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowtemplate) if err != nil { return nil, err } @@ -24422,12 +24301,11 @@ func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header { func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24545,12 +24423,11 @@ func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24646,8 +24523,7 @@ func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -24763,8 +24639,7 @@ func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header { func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instantiateworkflowtemplaterequest) if err != nil { return nil, err } @@ -24894,8 +24769,7 @@ func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.He func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowtemplate) if err != nil { return nil, err } @@ -25025,12 +24899,11 @@ func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25148,8 +25021,7 @@ func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -25256,8 +25128,7 @@ func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.H func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -25366,8 +25237,7 @@ func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header { func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflowtemplate) if err != nil { return nil, err } diff --git a/datastore/v1/datastore-gen.go b/datastore/v1/datastore-gen.go index 0f3a7c2a457..add25e40ed4 100644 --- a/datastore/v1/datastore-gen.go +++ b/datastore/v1/datastore-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3116,8 +3115,7 @@ func (c *ProjectsAllocateIdsCall) Header() http.Header { func (c *ProjectsAllocateIdsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.allocateidsrequest) if err != nil { return nil, err } @@ -3218,8 +3216,7 @@ func (c *ProjectsBeginTransactionCall) Header() http.Header { func (c *ProjectsBeginTransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.begintransactionrequest) if err != nil { return nil, err } @@ -3321,8 +3318,7 @@ func (c *ProjectsCommitCall) Header() http.Header { func (c *ProjectsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitrequest) if err != nil { return nil, err } @@ -3428,8 +3424,7 @@ func (c *ProjectsExportCall) Header() http.Header { func (c *ProjectsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1exportentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledatastoreadminv1exportentitiesrequest) if err != nil { return nil, err } @@ -3534,8 +3529,7 @@ func (c *ProjectsImportCall) Header() http.Header { func (c *ProjectsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1importentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledatastoreadminv1importentitiesrequest) if err != nil { return nil, err } @@ -3636,8 +3630,7 @@ func (c *ProjectsLookupCall) Header() http.Header { func (c *ProjectsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookuprequest) if err != nil { return nil, err } @@ -3738,8 +3731,7 @@ func (c *ProjectsReserveIdsCall) Header() http.Header { func (c *ProjectsReserveIdsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reserveidsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reserveidsrequest) if err != nil { return nil, err } @@ -3840,8 +3832,7 @@ func (c *ProjectsRollbackCall) Header() http.Header { func (c *ProjectsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackrequest) if err != nil { return nil, err } @@ -3942,8 +3933,7 @@ func (c *ProjectsRunAggregationQueryCall) Header() http.Header { func (c *ProjectsRunAggregationQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runaggregationqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runaggregationqueryrequest) if err != nil { return nil, err } @@ -4044,8 +4034,7 @@ func (c *ProjectsRunQueryCall) Header() http.Header { func (c *ProjectsRunQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runqueryrequest) if err != nil { return nil, err } @@ -4153,8 +4142,7 @@ func (c *ProjectsIndexesCreateCall) Header() http.Header { func (c *ProjectsIndexesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledatastoreadminv1index) if err != nil { return nil, err } @@ -4262,12 +4250,11 @@ func (c *ProjectsIndexesDeleteCall) Header() http.Header { func (c *ProjectsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/indexes/{indexId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4374,12 +4361,11 @@ func (c *ProjectsIndexesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/indexes/{indexId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4505,12 +4491,11 @@ func (c *ProjectsIndexesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4630,12 +4615,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4728,12 +4712,11 @@ func (c *ProjectsOperationsDeleteCall) Header() http.Header { func (c *ProjectsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4837,12 +4820,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4966,12 +4948,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/datastore/v1beta1/datastore-gen.go b/datastore/v1beta1/datastore-gen.go index e1aff3d7b05..9d3f19821da 100644 --- a/datastore/v1beta1/datastore-gen.go +++ b/datastore/v1beta1/datastore-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1017,8 +1016,7 @@ func (c *ProjectsExportCall) Header() http.Header { func (c *ProjectsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1beta1exportentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledatastoreadminv1beta1exportentitiesrequest) if err != nil { return nil, err } @@ -1123,8 +1121,7 @@ func (c *ProjectsImportCall) Header() http.Header { func (c *ProjectsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1beta1importentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googledatastoreadminv1beta1importentitiesrequest) if err != nil { return nil, err } diff --git a/datastore/v1beta3/datastore-gen.go b/datastore/v1beta3/datastore-gen.go index 5bd1a0f0917..ff8b8b6c7e3 100644 --- a/datastore/v1beta3/datastore-gen.go +++ b/datastore/v1beta3/datastore-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2722,8 +2721,7 @@ func (c *ProjectsAllocateIdsCall) Header() http.Header { func (c *ProjectsAllocateIdsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.allocateidsrequest) if err != nil { return nil, err } @@ -2824,8 +2822,7 @@ func (c *ProjectsBeginTransactionCall) Header() http.Header { func (c *ProjectsBeginTransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.begintransactionrequest) if err != nil { return nil, err } @@ -2927,8 +2924,7 @@ func (c *ProjectsCommitCall) Header() http.Header { func (c *ProjectsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitrequest) if err != nil { return nil, err } @@ -3028,8 +3024,7 @@ func (c *ProjectsLookupCall) Header() http.Header { func (c *ProjectsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookuprequest) if err != nil { return nil, err } @@ -3130,8 +3125,7 @@ func (c *ProjectsReserveIdsCall) Header() http.Header { func (c *ProjectsReserveIdsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reserveidsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reserveidsrequest) if err != nil { return nil, err } @@ -3232,8 +3226,7 @@ func (c *ProjectsRollbackCall) Header() http.Header { func (c *ProjectsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackrequest) if err != nil { return nil, err } @@ -3334,8 +3327,7 @@ func (c *ProjectsRunAggregationQueryCall) Header() http.Header { func (c *ProjectsRunAggregationQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runaggregationqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runaggregationqueryrequest) if err != nil { return nil, err } @@ -3436,8 +3428,7 @@ func (c *ProjectsRunQueryCall) Header() http.Header { func (c *ProjectsRunQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runqueryrequest) if err != nil { return nil, err } diff --git a/datastream/v1/datastream-gen.go b/datastream/v1/datastream-gen.go index ba7569ffb16..0a9d56b1fd1 100644 --- a/datastream/v1/datastream-gen.go +++ b/datastream/v1/datastream-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2866,12 +2865,11 @@ func (c *ProjectsLocationsFetchStaticIpsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:fetchStaticIps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2995,12 +2993,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3126,12 +3123,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3283,8 +3279,7 @@ func (c *ProjectsLocationsConnectionProfilesCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -3398,12 +3393,11 @@ func (c *ProjectsLocationsConnectionProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3499,8 +3493,7 @@ func (c *ProjectsLocationsConnectionProfilesDiscoverCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesDiscoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.discoverconnectionprofilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.discoverconnectionprofilerequest) if err != nil { return nil, err } @@ -3611,12 +3604,11 @@ func (c *ProjectsLocationsConnectionProfilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3751,12 +3743,11 @@ func (c *ProjectsLocationsConnectionProfilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectionProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3911,8 +3902,7 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -4020,8 +4010,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4122,12 +4111,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4231,12 +4219,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4359,12 +4346,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4508,8 +4494,7 @@ func (c *ProjectsLocationsPrivateConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privateconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privateconnection) if err != nil { return nil, err } @@ -4630,12 +4615,11 @@ func (c *ProjectsLocationsPrivateConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4738,12 +4722,11 @@ func (c *ProjectsLocationsPrivateConnectionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4879,12 +4862,11 @@ func (c *ProjectsLocationsPrivateConnectionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/privateConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5022,8 +5004,7 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesCreateCall) Header() http.Head func (c *ProjectsLocationsPrivateConnectionsRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.route) if err != nil { return nil, err } @@ -5137,12 +5118,11 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesDeleteCall) Header() http.Head func (c *ProjectsLocationsPrivateConnectionsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5244,12 +5224,11 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5383,12 +5362,11 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5539,8 +5517,7 @@ func (c *ProjectsLocationsStreamsCreateCall) Header() http.Header { func (c *ProjectsLocationsStreamsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stream) if err != nil { return nil, err } @@ -5654,12 +5631,11 @@ func (c *ProjectsLocationsStreamsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStreamsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5761,12 +5737,11 @@ func (c *ProjectsLocationsStreamsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5898,12 +5873,11 @@ func (c *ProjectsLocationsStreamsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/streams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6057,8 +6031,7 @@ func (c *ProjectsLocationsStreamsPatchCall) Header() http.Header { func (c *ProjectsLocationsStreamsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stream) if err != nil { return nil, err } @@ -6160,8 +6133,7 @@ func (c *ProjectsLocationsStreamsRunCall) Header() http.Header { func (c *ProjectsLocationsStreamsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runstreamrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runstreamrequest) if err != nil { return nil, err } @@ -6271,12 +6243,11 @@ func (c *ProjectsLocationsStreamsObjectsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6395,12 +6366,11 @@ func (c *ProjectsLocationsStreamsObjectsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/objects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6515,8 +6485,7 @@ func (c *ProjectsLocationsStreamsObjectsLookupCall) Header() http.Header { func (c *ProjectsLocationsStreamsObjectsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookupstreamobjectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookupstreamobjectrequest) if err != nil { return nil, err } @@ -6618,8 +6587,7 @@ func (c *ProjectsLocationsStreamsObjectsStartBackfillJobCall) Header() http.Head func (c *ProjectsLocationsStreamsObjectsStartBackfillJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startbackfilljobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startbackfilljobrequest) if err != nil { return nil, err } @@ -6722,8 +6690,7 @@ func (c *ProjectsLocationsStreamsObjectsStopBackfillJobCall) Header() http.Heade func (c *ProjectsLocationsStreamsObjectsStopBackfillJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopbackfilljobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopbackfilljobrequest) if err != nil { return nil, err } diff --git a/datastream/v1alpha1/datastream-gen.go b/datastream/v1alpha1/datastream-gen.go index ae0a84f21c6..d3d8c910452 100644 --- a/datastream/v1alpha1/datastream-gen.go +++ b/datastream/v1alpha1/datastream-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1979,12 +1978,11 @@ func (c *ProjectsLocationsFetchStaticIpsCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:fetchStaticIps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2108,12 +2106,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2239,12 +2236,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2382,8 +2378,7 @@ func (c *ProjectsLocationsConnectionProfilesCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -2497,12 +2492,11 @@ func (c *ProjectsLocationsConnectionProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2598,8 +2592,7 @@ func (c *ProjectsLocationsConnectionProfilesDiscoverCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesDiscoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.discoverconnectionprofilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.discoverconnectionprofilerequest) if err != nil { return nil, err } @@ -2710,12 +2703,11 @@ func (c *ProjectsLocationsConnectionProfilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2850,12 +2842,11 @@ func (c *ProjectsLocationsConnectionProfilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/connectionProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3003,8 +2994,7 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectionprofile) if err != nil { return nil, err } @@ -3112,8 +3102,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3214,12 +3203,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3323,12 +3311,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3451,12 +3438,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3593,8 +3579,7 @@ func (c *ProjectsLocationsPrivateConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privateconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privateconnection) if err != nil { return nil, err } @@ -3715,12 +3700,11 @@ func (c *ProjectsLocationsPrivateConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3823,12 +3807,11 @@ func (c *ProjectsLocationsPrivateConnectionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3964,12 +3947,11 @@ func (c *ProjectsLocationsPrivateConnectionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/privateConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4107,8 +4089,7 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesCreateCall) Header() http.Head func (c *ProjectsLocationsPrivateConnectionsRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.route) if err != nil { return nil, err } @@ -4222,12 +4203,11 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesDeleteCall) Header() http.Head func (c *ProjectsLocationsPrivateConnectionsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4329,12 +4309,11 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4468,12 +4447,11 @@ func (c *ProjectsLocationsPrivateConnectionsRoutesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4624,8 +4602,7 @@ func (c *ProjectsLocationsStreamsCreateCall) Header() http.Header { func (c *ProjectsLocationsStreamsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stream) if err != nil { return nil, err } @@ -4739,12 +4716,11 @@ func (c *ProjectsLocationsStreamsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStreamsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4836,8 +4812,7 @@ func (c *ProjectsLocationsStreamsFetchErrorsCall) Header() http.Header { func (c *ProjectsLocationsStreamsFetchErrorsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetcherrorsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetcherrorsrequest) if err != nil { return nil, err } @@ -4947,12 +4922,11 @@ func (c *ProjectsLocationsStreamsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5084,12 +5058,11 @@ func (c *ProjectsLocationsStreamsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/streams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5243,8 +5216,7 @@ func (c *ProjectsLocationsStreamsPatchCall) Header() http.Header { func (c *ProjectsLocationsStreamsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stream) if err != nil { return nil, err } @@ -5354,12 +5326,11 @@ func (c *ProjectsLocationsStreamsObjectsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5478,12 +5449,11 @@ func (c *ProjectsLocationsStreamsObjectsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/objects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5596,12 +5566,11 @@ func (c *ProjectsLocationsStreamsObjectsStartBackfillJobCall) Header() http.Head func (c *ProjectsLocationsStreamsObjectsStartBackfillJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+object}:startBackfillJob") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5693,12 +5662,11 @@ func (c *ProjectsLocationsStreamsObjectsStopBackfillJobCall) Header() http.Heade func (c *ProjectsLocationsStreamsObjectsStopBackfillJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+object}:stopBackfillJob") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/deploymentmanager/v0.alpha/deploymentmanager-gen.go b/deploymentmanager/v0.alpha/deploymentmanager-gen.go index 82e730fcb65..29e3a8c29cc 100644 --- a/deploymentmanager/v0.alpha/deploymentmanager-gen.go +++ b/deploymentmanager/v0.alpha/deploymentmanager-gen.go @@ -135,7 +135,14 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.CompositeTypes = NewCompositeTypesService(s) + s.Deployments = NewDeploymentsService(s) + s.Manifests = NewManifestsService(s) + s.Operations = NewOperationsService(s) + s.Resources = NewResourcesService(s) + s.TypeProviders = NewTypeProvidersService(s) + s.Types = NewTypesService(s) if err != nil { return nil, err } @@ -154,15 +161,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.CompositeTypes = NewCompositeTypesService(s) - s.Deployments = NewDeploymentsService(s) - s.Manifests = NewManifestsService(s) - s.Operations = NewOperationsService(s) - s.Resources = NewResourcesService(s) - s.TypeProviders = NewTypeProvidersService(s) - s.Types = NewTypesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3201,12 +3200,11 @@ func (c *CompositeTypesDeleteCall) Header() http.Header { func (c *CompositeTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3319,12 +3317,11 @@ func (c *CompositeTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3424,8 +3421,7 @@ func (c *CompositeTypesInsertCall) Header() http.Header { func (c *CompositeTypesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compositetype) if err != nil { return nil, err } @@ -3603,12 +3599,11 @@ func (c *CompositeTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/compositeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3732,8 +3727,7 @@ func (c *CompositeTypesPatchCall) Header() http.Header { func (c *CompositeTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compositetype) if err != nil { return nil, err } @@ -3844,8 +3838,7 @@ func (c *CompositeTypesUpdateCall) Header() http.Header { func (c *CompositeTypesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compositetype) if err != nil { return nil, err } @@ -3950,8 +3943,7 @@ func (c *DeploymentsCancelPreviewCall) Header() http.Header { func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentscancelpreviewrequest) if err != nil { return nil, err } @@ -4072,12 +4064,11 @@ func (c *DeploymentsDeleteCall) Header() http.Header { func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4190,12 +4181,11 @@ func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4316,12 +4306,11 @@ func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4448,8 +4437,7 @@ func (c *DeploymentsInsertCall) Header() http.Header { func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment) if err != nil { return nil, err } @@ -4627,12 +4615,11 @@ func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4797,8 +4784,7 @@ func (c *DeploymentsPatchCall) Header() http.Header { func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment2) if err != nil { return nil, err } @@ -4903,8 +4889,7 @@ func (c *DeploymentsSetIamPolicyCall) Header() http.Header { func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -5009,8 +4994,7 @@ func (c *DeploymentsStopCall) Header() http.Header { func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentsstoprequest) if err != nil { return nil, err } @@ -5122,8 +5106,7 @@ func (c *DeploymentsTestIamPermissionsCall) Header() http.Header { func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -5276,8 +5259,7 @@ func (c *DeploymentsUpdateCall) Header() http.Header { func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment2) if err != nil { return nil, err } @@ -5401,12 +5383,11 @@ func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/manifests/{manifest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5581,12 +5562,11 @@ func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/manifests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5721,12 +5701,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5897,12 +5876,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6039,12 +6017,11 @@ func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/resources/{resource}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6219,12 +6196,11 @@ func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/resources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6347,12 +6323,11 @@ func (c *TypeProvidersDeleteCall) Header() http.Header { func (c *TypeProvidersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6465,12 +6440,11 @@ func (c *TypeProvidersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6586,12 +6560,11 @@ func (c *TypeProvidersGetTypeCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}/types/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6692,8 +6665,7 @@ func (c *TypeProvidersInsertCall) Header() http.Header { func (c *TypeProvidersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.typeprovider) if err != nil { return nil, err } @@ -6871,12 +6843,11 @@ func (c *TypeProvidersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/typeProviders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7071,12 +7042,11 @@ func (c *TypeProvidersListTypesCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}/types") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7201,8 +7171,7 @@ func (c *TypeProvidersPatchCall) Header() http.Header { func (c *TypeProvidersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.typeprovider) if err != nil { return nil, err } @@ -7313,8 +7282,7 @@ func (c *TypeProvidersUpdateCall) Header() http.Header { func (c *TypeProvidersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.typeprovider) if err != nil { return nil, err } @@ -7435,12 +7403,11 @@ func (c *TypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/types/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7611,12 +7578,11 @@ func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/alpha/projects/{project}/global/types") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/deploymentmanager/v2/deploymentmanager-gen.go b/deploymentmanager/v2/deploymentmanager-gen.go index 739de9b6f10..ef096f6a7be 100644 --- a/deploymentmanager/v2/deploymentmanager-gen.go +++ b/deploymentmanager/v2/deploymentmanager-gen.go @@ -135,7 +135,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Deployments = NewDeploymentsService(s) + s.Manifests = NewManifestsService(s) + s.Operations = NewOperationsService(s) + s.Resources = NewResourcesService(s) + s.Types = NewTypesService(s) if err != nil { return nil, err } @@ -154,13 +159,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Deployments = NewDeploymentsService(s) - s.Manifests = NewManifestsService(s) - s.Operations = NewOperationsService(s) - s.Resources = NewResourcesService(s) - s.Types = NewTypesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2352,8 +2351,7 @@ func (c *DeploymentsCancelPreviewCall) Header() http.Header { func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentscancelpreviewrequest) if err != nil { return nil, err } @@ -2474,12 +2472,11 @@ func (c *DeploymentsDeleteCall) Header() http.Header { func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2592,12 +2589,11 @@ func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2718,12 +2714,11 @@ func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2849,8 +2844,7 @@ func (c *DeploymentsInsertCall) Header() http.Header { func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment) if err != nil { return nil, err } @@ -3028,12 +3022,11 @@ func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3197,8 +3190,7 @@ func (c *DeploymentsPatchCall) Header() http.Header { func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment2) if err != nil { return nil, err } @@ -3303,8 +3295,7 @@ func (c *DeploymentsSetIamPolicyCall) Header() http.Header { func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -3409,8 +3400,7 @@ func (c *DeploymentsStopCall) Header() http.Header { func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentsstoprequest) if err != nil { return nil, err } @@ -3522,8 +3512,7 @@ func (c *DeploymentsTestIamPermissionsCall) Header() http.Header { func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -3675,8 +3664,7 @@ func (c *DeploymentsUpdateCall) Header() http.Header { func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment2) if err != nil { return nil, err } @@ -3800,12 +3788,11 @@ func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3980,12 +3967,11 @@ func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4120,12 +4106,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4296,12 +4281,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4438,12 +4422,11 @@ func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4618,12 +4601,11 @@ func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4816,12 +4798,11 @@ func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/types") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/deploymentmanager/v2beta/deploymentmanager-gen.go b/deploymentmanager/v2beta/deploymentmanager-gen.go index ee84596c547..484ed58c9ca 100644 --- a/deploymentmanager/v2beta/deploymentmanager-gen.go +++ b/deploymentmanager/v2beta/deploymentmanager-gen.go @@ -135,7 +135,14 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.CompositeTypes = NewCompositeTypesService(s) + s.Deployments = NewDeploymentsService(s) + s.Manifests = NewManifestsService(s) + s.Operations = NewOperationsService(s) + s.Resources = NewResourcesService(s) + s.TypeProviders = NewTypeProvidersService(s) + s.Types = NewTypesService(s) if err != nil { return nil, err } @@ -154,15 +161,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.CompositeTypes = NewCompositeTypesService(s) - s.Deployments = NewDeploymentsService(s) - s.Manifests = NewManifestsService(s) - s.Operations = NewOperationsService(s) - s.Resources = NewResourcesService(s) - s.TypeProviders = NewTypeProvidersService(s) - s.Types = NewTypesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3102,12 +3101,11 @@ func (c *CompositeTypesDeleteCall) Header() http.Header { func (c *CompositeTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3220,12 +3218,11 @@ func (c *CompositeTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3325,8 +3322,7 @@ func (c *CompositeTypesInsertCall) Header() http.Header { func (c *CompositeTypesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compositetype) if err != nil { return nil, err } @@ -3504,12 +3500,11 @@ func (c *CompositeTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/compositeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3633,8 +3628,7 @@ func (c *CompositeTypesPatchCall) Header() http.Header { func (c *CompositeTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compositetype) if err != nil { return nil, err } @@ -3745,8 +3739,7 @@ func (c *CompositeTypesUpdateCall) Header() http.Header { func (c *CompositeTypesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.compositetype) if err != nil { return nil, err } @@ -3851,8 +3844,7 @@ func (c *DeploymentsCancelPreviewCall) Header() http.Header { func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentscancelpreviewrequest) if err != nil { return nil, err } @@ -3973,12 +3965,11 @@ func (c *DeploymentsDeleteCall) Header() http.Header { func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4091,12 +4082,11 @@ func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4217,12 +4207,11 @@ func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4349,8 +4338,7 @@ func (c *DeploymentsInsertCall) Header() http.Header { func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment) if err != nil { return nil, err } @@ -4528,12 +4516,11 @@ func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4698,8 +4685,7 @@ func (c *DeploymentsPatchCall) Header() http.Header { func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment2) if err != nil { return nil, err } @@ -4804,8 +4790,7 @@ func (c *DeploymentsSetIamPolicyCall) Header() http.Header { func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.globalsetpolicyrequest) if err != nil { return nil, err } @@ -4910,8 +4895,7 @@ func (c *DeploymentsStopCall) Header() http.Header { func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentsstoprequest) if err != nil { return nil, err } @@ -5023,8 +5007,7 @@ func (c *DeploymentsTestIamPermissionsCall) Header() http.Header { func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testpermissionsrequest) if err != nil { return nil, err } @@ -5177,8 +5160,7 @@ func (c *DeploymentsUpdateCall) Header() http.Header { func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deployment2) if err != nil { return nil, err } @@ -5302,12 +5284,11 @@ func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/manifests/{manifest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5482,12 +5463,11 @@ func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/manifests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5622,12 +5602,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5798,12 +5777,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5940,12 +5918,11 @@ func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/resources/{resource}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6120,12 +6097,11 @@ func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/resources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6248,12 +6224,11 @@ func (c *TypeProvidersDeleteCall) Header() http.Header { func (c *TypeProvidersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6366,12 +6341,11 @@ func (c *TypeProvidersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6487,12 +6461,11 @@ func (c *TypeProvidersGetTypeCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}/types/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6593,8 +6566,7 @@ func (c *TypeProvidersInsertCall) Header() http.Header { func (c *TypeProvidersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.typeprovider) if err != nil { return nil, err } @@ -6772,12 +6744,11 @@ func (c *TypeProvidersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/typeProviders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6972,12 +6943,11 @@ func (c *TypeProvidersListTypesCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}/types") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7102,8 +7072,7 @@ func (c *TypeProvidersPatchCall) Header() http.Header { func (c *TypeProvidersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.typeprovider) if err != nil { return nil, err } @@ -7214,8 +7183,7 @@ func (c *TypeProvidersUpdateCall) Header() http.Header { func (c *TypeProvidersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.typeprovider) if err != nil { return nil, err } @@ -7394,12 +7362,11 @@ func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2beta/projects/{project}/global/types") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/developerconnect/v1/developerconnect-gen.go b/developerconnect/v1/developerconnect-gen.go index d5a5a76eace..3dd7e01a26e 100644 --- a/developerconnect/v1/developerconnect-gen.go +++ b/developerconnect/v1/developerconnect-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1307,12 +1306,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1438,12 +1436,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1588,8 +1585,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -1718,12 +1714,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1829,12 +1824,11 @@ func (c *ProjectsLocationsConnectionsFetchGitHubInstallationsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+connection}:fetchGitHubInstallations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1952,12 +1946,11 @@ func (c *ProjectsLocationsConnectionsFetchLinkableGitRepositoriesCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+connection}:fetchLinkableGitRepositories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2081,12 +2074,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2216,12 +2208,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2380,8 +2371,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -2483,8 +2473,7 @@ func (c *ProjectsLocationsConnectionsProcessGitHubEnterpriseWebhookCall) Header( func (c *ProjectsLocationsConnectionsProcessGitHubEnterpriseWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.processgithubenterprisewebhookrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.processgithubenterprisewebhookrequest) if err != nil { return nil, err } @@ -2620,8 +2609,7 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksCreateCall) Header() http func (c *ProjectsLocationsConnectionsGitRepositoryLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gitrepositorylink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gitrepositorylink) if err != nil { return nil, err } @@ -2751,12 +2739,11 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksDeleteCall) Header() http func (c *ProjectsLocationsConnectionsGitRepositoryLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2885,12 +2872,11 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksFetchGitRefsCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+gitRepositoryLink}:fetchGitRefs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3005,8 +2991,7 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksFetchReadTokenCall) Heade func (c *ProjectsLocationsConnectionsGitRepositoryLinksFetchReadTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchreadtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchreadtokenrequest) if err != nil { return nil, err } @@ -3108,8 +3093,7 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksFetchReadWriteTokenCall) func (c *ProjectsLocationsConnectionsGitRepositoryLinksFetchReadWriteTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchreadwritetokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchreadwritetokenrequest) if err != nil { return nil, err } @@ -3220,12 +3204,11 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3356,12 +3339,11 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gitRepositoryLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3477,8 +3459,7 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksProcessGitLabEnterpriseWe func (c *ProjectsLocationsConnectionsGitRepositoryLinksProcessGitLabEnterpriseWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.processgitlabenterprisewebhookrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.processgitlabenterprisewebhookrequest) if err != nil { return nil, err } @@ -3580,8 +3561,7 @@ func (c *ProjectsLocationsConnectionsGitRepositoryLinksProcessGitLabWebhookCall) func (c *ProjectsLocationsConnectionsGitRepositoryLinksProcessGitLabWebhookCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.processgitlabwebhookrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.processgitlabwebhookrequest) if err != nil { return nil, err } @@ -3689,8 +3669,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3791,12 +3770,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3900,12 +3878,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4028,12 +4005,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/dfareporting/v3.5/dfareporting-gen.go b/dfareporting/v3.5/dfareporting-gen.go index 224e563ef06..6f6eb7f0178 100644 --- a/dfareporting/v3.5/dfareporting-gen.go +++ b/dfareporting/v3.5/dfareporting-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Media = NewMediaService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Media = NewMediaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -720,8 +719,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativeassetmetadata) if err != nil { return nil, err } @@ -732,14 +730,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/dfareporting/v3.5/userprofiles/{+profileId}/creativeAssets/{+advertiserId}/creativeAssets") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/dfareporting/v4/dfareporting-gen.go b/dfareporting/v4/dfareporting-gen.go index 7c708da72ec..22c7f558c83 100644 --- a/dfareporting/v4/dfareporting-gen.go +++ b/dfareporting/v4/dfareporting-gen.go @@ -128,25 +128,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s) s.AccountPermissionGroups = NewAccountPermissionGroupsService(s) @@ -213,9 +194,27 @@ func New(client *http.Client) (*Service, error) { s.UserRolePermissions = NewUserRolePermissionsService(s) s.UserRoles = NewUserRolesService(s) s.VideoFormats = NewVideoFormatsService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL @@ -12420,12 +12419,11 @@ func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accountActiveAdSummaries/{+summaryAccountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12532,12 +12530,11 @@ func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accountPermissionGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12641,12 +12638,11 @@ func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accountPermissionGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12752,12 +12748,11 @@ func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accountPermissions/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12861,12 +12856,11 @@ func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accountPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12972,12 +12966,11 @@ func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13071,8 +13064,7 @@ func (c *AccountUserProfilesInsertCall) Header() http.Header { func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountuserprofile) if err != nil { return nil, err } @@ -13266,12 +13258,11 @@ func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accountUserProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13388,8 +13379,7 @@ func (c *AccountUserProfilesPatchCall) Header() http.Header { func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountuserprofile) if err != nil { return nil, err } @@ -13490,8 +13480,7 @@ func (c *AccountUserProfilesUpdateCall) Header() http.Header { func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountuserprofile) if err != nil { return nil, err } @@ -13605,12 +13594,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accounts/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13780,12 +13768,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13901,8 +13888,7 @@ func (c *AccountsPatchCall) Header() http.Header { func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -14002,8 +13988,7 @@ func (c *AccountsUpdateCall) Header() http.Header { func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -14116,12 +14101,11 @@ func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/ads/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14214,8 +14198,7 @@ func (c *AdsInsertCall) Header() http.Header { func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ad) if err != nil { return nil, err } @@ -14557,12 +14540,11 @@ func (c *AdsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/ads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14678,8 +14660,7 @@ func (c *AdsPatchCall) Header() http.Header { func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ad) if err != nil { return nil, err } @@ -14779,8 +14760,7 @@ func (c *AdsUpdateCall) Header() http.Header { func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ad) if err != nil { return nil, err } @@ -14881,12 +14861,11 @@ func (c *AdvertiserGroupsDeleteCall) Header() http.Header { func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertiserGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14969,12 +14948,11 @@ func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertiserGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15068,8 +15046,7 @@ func (c *AdvertiserGroupsInsertCall) Header() http.Header { func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertisergroup) if err != nil { return nil, err } @@ -15242,12 +15219,11 @@ func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertiserGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15364,8 +15340,7 @@ func (c *AdvertiserGroupsPatchCall) Header() http.Header { func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertisergroup) if err != nil { return nil, err } @@ -15466,8 +15441,7 @@ func (c *AdvertiserGroupsUpdateCall) Header() http.Header { func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertisergroup) if err != nil { return nil, err } @@ -15604,12 +15578,11 @@ func (c *AdvertiserInvoicesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertisers/{+advertiserId}/invoices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15737,12 +15710,11 @@ func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertiserLandingPages/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15835,8 +15807,7 @@ func (c *AdvertiserLandingPagesInsertCall) Header() http.Header { func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.landingpage) if err != nil { return nil, err } @@ -16044,12 +16015,11 @@ func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertiserLandingPages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16166,8 +16136,7 @@ func (c *AdvertiserLandingPagesPatchCall) Header() http.Header { func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.landingpage) if err != nil { return nil, err } @@ -16267,8 +16236,7 @@ func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header { func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.landingpage) if err != nil { return nil, err } @@ -16381,12 +16349,11 @@ func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertisers/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16479,8 +16446,7 @@ func (c *AdvertisersInsertCall) Header() http.Header { func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -16709,12 +16675,11 @@ func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/advertisers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16830,8 +16795,7 @@ func (c *AdvertisersPatchCall) Header() http.Header { func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -16931,8 +16895,7 @@ func (c *AdvertisersUpdateCall) Header() http.Header { func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -17039,8 +17002,7 @@ func (c *BillingAssignmentsInsertCall) Header() http.Header { func (c *BillingAssignmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.billingassignment) if err != nil { return nil, err } @@ -17155,12 +17117,11 @@ func (c *BillingAssignmentsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/billingProfiles/{+billingProfileId}/billingAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17267,12 +17228,11 @@ func (c *BillingProfilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/billingProfiles/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17476,12 +17436,11 @@ func (c *BillingProfilesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/billingProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17595,8 +17554,7 @@ func (c *BillingProfilesUpdateCall) Header() http.Header { func (c *BillingProfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.billingprofile) if err != nil { return nil, err } @@ -17709,12 +17667,11 @@ func (c *BillingRatesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/billingProfiles/{+billingProfileId}/billingRates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17818,12 +17775,11 @@ func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/browsers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17921,8 +17877,7 @@ func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header { func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaigncreativeassociation) if err != nil { return nil, err } @@ -18063,12 +18018,11 @@ func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/campaigns/{+campaignId}/campaignCreativeAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18196,12 +18150,11 @@ func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/campaigns/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18294,8 +18247,7 @@ func (c *CampaignsInsertCall) Header() http.Header { func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -18528,12 +18480,11 @@ func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/campaigns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18649,8 +18600,7 @@ func (c *CampaignsPatchCall) Header() http.Header { func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -18750,8 +18700,7 @@ func (c *CampaignsUpdateCall) Header() http.Header { func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -18864,12 +18813,11 @@ func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/changeLogs/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19130,12 +19078,11 @@ func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/changeLogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19299,12 +19246,11 @@ func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/cities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19410,12 +19356,11 @@ func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/connectionTypes/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19518,12 +19463,11 @@ func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/connectionTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19617,12 +19561,11 @@ func (c *ContentCategoriesDeleteCall) Header() http.Header { func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/contentCategories/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19705,12 +19648,11 @@ func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/contentCategories/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19804,8 +19746,7 @@ func (c *ContentCategoriesInsertCall) Header() http.Header { func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.contentcategory) if err != nil { return nil, err } @@ -19978,12 +19919,11 @@ func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/contentCategories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20100,8 +20040,7 @@ func (c *ContentCategoriesPatchCall) Header() http.Header { func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.contentcategory) if err != nil { return nil, err } @@ -20202,8 +20141,7 @@ func (c *ContentCategoriesUpdateCall) Header() http.Header { func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.contentcategory) if err != nil { return nil, err } @@ -20304,8 +20242,7 @@ func (c *ConversionsBatchinsertCall) Header() http.Header { func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionsbatchinsertrequest) if err != nil { return nil, err } @@ -20406,8 +20343,7 @@ func (c *ConversionsBatchupdateCall) Header() http.Header { func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionsbatchupdaterequest) if err != nil { return nil, err } @@ -20521,12 +20457,11 @@ func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/countries/{+dartId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20629,12 +20564,11 @@ func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/countries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20769,8 +20703,7 @@ func (c *CreativeAssetsInsertCall) Header() http.Header { func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativeassetmetadata) if err != nil { return nil, err } @@ -20781,14 +20714,10 @@ func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/dfareporting/v4/userprofiles/{+profileId}/creativeAssets/{+advertiserId}/creativeAssets") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -20904,12 +20833,11 @@ func (c *CreativeFieldValuesDeleteCall) Header() http.Header { func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeFields/{+creativeFieldId}/creativeFieldValues/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20996,12 +20924,11 @@ func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeFields/{+creativeFieldId}/creativeFieldValues/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21099,8 +21026,7 @@ func (c *CreativeFieldValuesInsertCall) Header() http.Header { func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativefieldvalue) if err != nil { return nil, err } @@ -21272,12 +21198,11 @@ func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeFields/{+creativeFieldId}/creativeFieldValues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21398,8 +21323,7 @@ func (c *CreativeFieldValuesPatchCall) Header() http.Header { func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativefieldvalue) if err != nil { return nil, err } @@ -21504,8 +21428,7 @@ func (c *CreativeFieldValuesUpdateCall) Header() http.Header { func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativefieldvalue) if err != nil { return nil, err } @@ -21608,12 +21531,11 @@ func (c *CreativeFieldsDeleteCall) Header() http.Header { func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeFields/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21696,12 +21618,11 @@ func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeFields/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21794,8 +21715,7 @@ func (c *CreativeFieldsInsertCall) Header() http.Header { func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativefield) if err != nil { return nil, err } @@ -21978,12 +21898,11 @@ func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeFields") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22100,8 +22019,7 @@ func (c *CreativeFieldsPatchCall) Header() http.Header { func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativefield) if err != nil { return nil, err } @@ -22201,8 +22119,7 @@ func (c *CreativeFieldsUpdateCall) Header() http.Header { func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativefield) if err != nil { return nil, err } @@ -22315,12 +22232,11 @@ func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22413,8 +22329,7 @@ func (c *CreativeGroupsInsertCall) Header() http.Header { func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativegroup) if err != nil { return nil, err } @@ -22604,12 +22519,11 @@ func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creativeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22726,8 +22640,7 @@ func (c *CreativeGroupsPatchCall) Header() http.Header { func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativegroup) if err != nil { return nil, err } @@ -22827,8 +22740,7 @@ func (c *CreativeGroupsUpdateCall) Header() http.Header { func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creativegroup) if err != nil { return nil, err } @@ -22941,12 +22853,11 @@ func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creatives/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23039,8 +22950,7 @@ func (c *CreativesInsertCall) Header() http.Header { func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -23324,12 +23234,11 @@ func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23445,8 +23354,7 @@ func (c *CreativesPatchCall) Header() http.Header { func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -23546,8 +23454,7 @@ func (c *CreativesUpdateCall) Header() http.Header { func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -23661,8 +23568,7 @@ func (c *DimensionValuesQueryCall) Header() http.Header { func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dimensionvaluerequest) if err != nil { return nil, err } @@ -23797,12 +23703,11 @@ func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/directorySites/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23895,8 +23800,7 @@ func (c *DirectorySitesInsertCall) Header() http.Header { func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.directorysite) if err != nil { return nil, err } @@ -24106,12 +24010,11 @@ func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/directorySites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24234,12 +24137,11 @@ func (c *DynamicTargetingKeysDeleteCall) Header() http.Header { func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/dynamicTargetingKeys/{+objectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24312,8 +24214,7 @@ func (c *DynamicTargetingKeysInsertCall) Header() http.Header { func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dynamictargetingkey) if err != nil { return nil, err } @@ -24459,12 +24360,11 @@ func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/dynamicTargetingKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24558,12 +24458,11 @@ func (c *EventTagsDeleteCall) Header() http.Header { func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/eventTags/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24646,12 +24545,11 @@ func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/eventTags/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24744,8 +24642,7 @@ func (c *EventTagsInsertCall) Header() http.Header { func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventtag) if err != nil { return nil, err } @@ -24969,12 +24866,11 @@ func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/eventTags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25069,8 +24965,7 @@ func (c *EventTagsPatchCall) Header() http.Header { func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventtag) if err != nil { return nil, err } @@ -25170,8 +25065,7 @@ func (c *EventTagsUpdateCall) Header() http.Header { func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventtag) if err != nil { return nil, err } @@ -25285,12 +25179,11 @@ func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25459,12 +25352,11 @@ func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25578,12 +25470,11 @@ func (c *FloodlightActivitiesDeleteCall) Header() http.Header { func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightActivities/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25658,12 +25549,11 @@ func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header { func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightActivities/generatetag") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -25769,12 +25659,11 @@ func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightActivities/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25868,8 +25757,7 @@ func (c *FloodlightActivitiesInsertCall) Header() http.Header { func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightactivity) if err != nil { return nil, err } @@ -26109,12 +25997,11 @@ func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightActivities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26231,8 +26118,7 @@ func (c *FloodlightActivitiesPatchCall) Header() http.Header { func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightactivity) if err != nil { return nil, err } @@ -26333,8 +26219,7 @@ func (c *FloodlightActivitiesUpdateCall) Header() http.Header { func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightactivity) if err != nil { return nil, err } @@ -26448,12 +26333,11 @@ func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightActivityGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26547,8 +26431,7 @@ func (c *FloodlightActivityGroupsInsertCall) Header() http.Header { func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightactivitygroup) if err != nil { return nil, err } @@ -26752,12 +26635,11 @@ func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightActivityGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26874,8 +26756,7 @@ func (c *FloodlightActivityGroupsPatchCall) Header() http.Header { func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightactivitygroup) if err != nil { return nil, err } @@ -26976,8 +26857,7 @@ func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header { func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightactivitygroup) if err != nil { return nil, err } @@ -27091,12 +26971,11 @@ func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightConfigurations/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27212,12 +27091,11 @@ func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/floodlightConfigurations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27313,8 +27191,7 @@ func (c *FloodlightConfigurationsPatchCall) Header() http.Header { func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightconfiguration) if err != nil { return nil, err } @@ -27415,8 +27292,7 @@ func (c *FloodlightConfigurationsUpdateCall) Header() http.Header { func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightconfiguration) if err != nil { return nil, err } @@ -27533,12 +27409,11 @@ func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/projects/{projectId}/inventoryItems/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27735,12 +27610,11 @@ func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/projects/{projectId}/inventoryItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27865,12 +27739,11 @@ func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/languages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27973,12 +27846,11 @@ func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/metros") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28084,12 +27956,11 @@ func (c *MobileAppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/mobileApps/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28245,12 +28116,11 @@ func (c *MobileAppsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/mobileApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28377,12 +28247,11 @@ func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/mobileCarriers/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28485,12 +28354,11 @@ func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/mobileCarriers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28596,12 +28464,11 @@ func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/operatingSystemVersions/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28705,12 +28572,11 @@ func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/operatingSystemVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28816,12 +28682,11 @@ func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/operatingSystems/{+dartId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28925,12 +28790,11 @@ func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/operatingSystems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29039,12 +28903,11 @@ func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/projects/{projectId}/orders/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29222,12 +29085,11 @@ func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/projects/{projectId}/orders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29355,12 +29217,11 @@ func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placementGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29453,8 +29314,7 @@ func (c *PlacementGroupsInsertCall) Header() http.Header { func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placementgroup) if err != nil { return nil, err } @@ -29780,12 +29640,11 @@ func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placementGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29902,8 +29761,7 @@ func (c *PlacementGroupsPatchCall) Header() http.Header { func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placementgroup) if err != nil { return nil, err } @@ -30003,8 +29861,7 @@ func (c *PlacementGroupsUpdateCall) Header() http.Header { func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placementgroup) if err != nil { return nil, err } @@ -30105,12 +29962,11 @@ func (c *PlacementStrategiesDeleteCall) Header() http.Header { func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placementStrategies/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30193,12 +30049,11 @@ func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placementStrategies/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30292,8 +30147,7 @@ func (c *PlacementStrategiesInsertCall) Header() http.Header { func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placementstrategy) if err != nil { return nil, err } @@ -30466,12 +30320,11 @@ func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placementStrategies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30588,8 +30441,7 @@ func (c *PlacementStrategiesPatchCall) Header() http.Header { func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placementstrategy) if err != nil { return nil, err } @@ -30690,8 +30542,7 @@ func (c *PlacementStrategiesUpdateCall) Header() http.Header { func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placementstrategy) if err != nil { return nil, err } @@ -30839,12 +30690,11 @@ func (c *PlacementsGeneratetagsCall) Header() http.Header { func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placements/generatetags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -30950,12 +30800,11 @@ func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placements/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31048,8 +30897,7 @@ func (c *PlacementsInsertCall) Header() http.Header { func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placement) if err != nil { return nil, err } @@ -31404,12 +31252,11 @@ func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/placements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31525,8 +31372,7 @@ func (c *PlacementsPatchCall) Header() http.Header { func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placement) if err != nil { return nil, err } @@ -31626,8 +31472,7 @@ func (c *PlacementsUpdateCall) Header() http.Header { func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placement) if err != nil { return nil, err } @@ -31740,12 +31585,11 @@ func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/platformTypes/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31848,12 +31692,11 @@ func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/platformTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31959,12 +31802,11 @@ func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/postalCodes/{+code}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32067,12 +31909,11 @@ func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/postalCodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32178,12 +32019,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/projects/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32357,12 +32197,11 @@ func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32486,12 +32325,11 @@ func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/regions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32597,12 +32435,11 @@ func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/remarketingListShares/{+remarketingListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32699,8 +32536,7 @@ func (c *RemarketingListSharesPatchCall) Header() http.Header { func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketinglistshare) if err != nil { return nil, err } @@ -32801,8 +32637,7 @@ func (c *RemarketingListSharesUpdateCall) Header() http.Header { func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketinglistshare) if err != nil { return nil, err } @@ -32916,12 +32751,11 @@ func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/remarketingLists/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33015,8 +32849,7 @@ func (c *RemarketingListsInsertCall) Header() http.Header { func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketinglist) if err != nil { return nil, err } @@ -33194,12 +33027,11 @@ func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/remarketingLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33316,8 +33148,7 @@ func (c *RemarketingListsPatchCall) Header() http.Header { func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketinglist) if err != nil { return nil, err } @@ -33418,8 +33249,7 @@ func (c *RemarketingListsUpdateCall) Header() http.Header { func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.remarketinglist) if err != nil { return nil, err } @@ -33521,12 +33351,11 @@ func (c *ReportsDeleteCall) Header() http.Header { func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33609,12 +33438,11 @@ func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33707,8 +33535,7 @@ func (c *ReportsInsertCall) Header() http.Header { func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report) if err != nil { return nil, err } @@ -33868,12 +33695,11 @@ func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33989,8 +33815,7 @@ func (c *ReportsPatchCall) Header() http.Header { func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report) if err != nil { return nil, err } @@ -34099,12 +33924,11 @@ func (c *ReportsRunCall) Header() http.Header { func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34200,8 +34024,7 @@ func (c *ReportsUpdateCall) Header() http.Header { func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report) if err != nil { return nil, err } @@ -34304,8 +34127,7 @@ func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header { func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report) if err != nil { return nil, err } @@ -34423,12 +34245,11 @@ func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34588,12 +34409,11 @@ func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34720,12 +34540,11 @@ func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/sites/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34818,8 +34637,7 @@ func (c *SitesInsertCall) Header() http.Header { func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -35062,12 +34880,11 @@ func (c *SitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35183,8 +35000,7 @@ func (c *SitesPatchCall) Header() http.Header { func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -35284,8 +35100,7 @@ func (c *SitesUpdateCall) Header() http.Header { func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -35398,12 +35213,11 @@ func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/sizes/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35496,8 +35310,7 @@ func (c *SizesInsertCall) Header() http.Header { func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.size) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.size) if err != nil { return nil, err } @@ -35641,12 +35454,11 @@ func (c *SizesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/sizes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35752,12 +35564,11 @@ func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/subaccounts/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35850,8 +35661,7 @@ func (c *SubaccountsInsertCall) Header() http.Header { func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subaccount) if err != nil { return nil, err } @@ -36023,12 +35833,11 @@ func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/subaccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36144,8 +35953,7 @@ func (c *SubaccountsPatchCall) Header() http.Header { func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subaccount) if err != nil { return nil, err } @@ -36245,8 +36053,7 @@ func (c *SubaccountsUpdateCall) Header() http.Header { func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subaccount) if err != nil { return nil, err } @@ -36359,12 +36166,11 @@ func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/targetableRemarketingLists/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36529,12 +36335,11 @@ func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/targetableRemarketingLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36661,12 +36466,11 @@ func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/targetingTemplates/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36760,8 +36564,7 @@ func (c *TargetingTemplatesInsertCall) Header() http.Header { func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetingtemplate) if err != nil { return nil, err } @@ -36940,12 +36743,11 @@ func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/targetingTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37062,8 +36864,7 @@ func (c *TargetingTemplatesPatchCall) Header() http.Header { func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetingtemplate) if err != nil { return nil, err } @@ -37164,8 +36965,7 @@ func (c *TargetingTemplatesUpdateCall) Header() http.Header { func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetingtemplate) if err != nil { return nil, err } @@ -37286,12 +37086,11 @@ func (c *TvCampaignDetailsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/tvCampaignDetails/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37409,12 +37208,11 @@ func (c *TvCampaignSummariesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/tvCampaignSummaries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37517,12 +37315,11 @@ func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37620,12 +37417,11 @@ func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37728,12 +37524,11 @@ func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRolePermissionGroups/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37837,12 +37632,11 @@ func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRolePermissionGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37948,12 +37742,11 @@ func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRolePermissions/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38068,12 +37861,11 @@ func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRolePermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38167,12 +37959,11 @@ func (c *UserRolesDeleteCall) Header() http.Header { func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRoles/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38255,12 +38046,11 @@ func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRoles/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38353,8 +38143,7 @@ func (c *UserRolesInsertCall) Header() http.Header { func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userrole) if err != nil { return nil, err } @@ -38540,12 +38329,11 @@ func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/userRoles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38661,8 +38449,7 @@ func (c *UserRolesPatchCall) Header() http.Header { func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userrole) if err != nil { return nil, err } @@ -38762,8 +38549,7 @@ func (c *UserRolesUpdateCall) Header() http.Header { func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userrole) if err != nil { return nil, err } @@ -38876,12 +38662,11 @@ func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/videoFormats/{+id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38984,12 +38769,11 @@ func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{+profileId}/videoFormats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/dialogflow/v2/dialogflow-gen.go b/dialogflow/v2/dialogflow-gen.go index 047954abdd1..751c151baca 100644 --- a/dialogflow/v2/dialogflow-gen.go +++ b/dialogflow/v2/dialogflow-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -20253,12 +20252,11 @@ func (c *ProjectsDeleteAgentCall) Header() http.Header { func (c *ProjectsDeleteAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20362,12 +20360,11 @@ func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20469,8 +20466,7 @@ func (c *ProjectsSetAgentCall) Header() http.Header { func (c *ProjectsSetAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2agent) if err != nil { return nil, err } @@ -20578,8 +20574,7 @@ func (c *ProjectsAgentExportCall) Header() http.Header { func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2exportagentrequest) if err != nil { return nil, err } @@ -20690,12 +20685,11 @@ func (c *ProjectsAgentGetFulfillmentCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20811,12 +20805,11 @@ func (c *ProjectsAgentGetValidationResultCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent/validationResult") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20927,8 +20920,7 @@ func (c *ProjectsAgentImportCall) Header() http.Header { func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2importagentrequest) if err != nil { return nil, err } @@ -21046,8 +21038,7 @@ func (c *ProjectsAgentRestoreCall) Header() http.Header { func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2restoreagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2restoreagentrequest) if err != nil { return nil, err } @@ -21177,12 +21168,11 @@ func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21306,8 +21296,7 @@ func (c *ProjectsAgentTrainCall) Header() http.Header { func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2trainagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2trainagentrequest) if err != nil { return nil, err } @@ -21418,8 +21407,7 @@ func (c *ProjectsAgentUpdateFulfillmentCall) Header() http.Header { func (c *ProjectsAgentUpdateFulfillmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2fulfillment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2fulfillment) if err != nil { return nil, err } @@ -21531,8 +21519,7 @@ func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header { func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchdeleteentitytypesrequest) if err != nil { return nil, err } @@ -21642,8 +21629,7 @@ func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchupdateentitytypesrequest) if err != nil { return nil, err } @@ -21756,8 +21742,7 @@ func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2entitytype) if err != nil { return nil, err } @@ -21859,12 +21844,11 @@ func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21977,12 +21961,11 @@ func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22110,12 +22093,11 @@ func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22250,8 +22232,7 @@ func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header { func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2entitytype) if err != nil { return nil, err } @@ -22363,8 +22344,7 @@ func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchcreateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchcreateentitiesrequest) if err != nil { return nil, err } @@ -22476,8 +22456,7 @@ func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header { func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchdeleteentitiesrequest) if err != nil { return nil, err } @@ -22590,8 +22569,7 @@ func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchupdateentitiesrequest) if err != nil { return nil, err } @@ -22700,8 +22678,7 @@ func (c *ProjectsAgentEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsAgentEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2environment) if err != nil { return nil, err } @@ -22803,12 +22780,11 @@ func (c *ProjectsAgentEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsAgentEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22914,12 +22890,11 @@ func (c *ProjectsAgentEnvironmentsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23039,12 +23014,11 @@ func (c *ProjectsAgentEnvironmentsGetHistoryCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23184,12 +23158,11 @@ func (c *ProjectsAgentEnvironmentsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23333,8 +23306,7 @@ func (c *ProjectsAgentEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsAgentEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2environment) if err != nil { return nil, err } @@ -23488,12 +23460,11 @@ func (c *ProjectsAgentEnvironmentsIntentsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23609,12 +23580,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Header() http func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23728,8 +23698,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Header() http.H func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2detectintentrequest) if err != nil { return nil, err } @@ -23835,8 +23804,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Header() http func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -23939,12 +23907,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Header() http func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24051,12 +24018,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24177,12 +24143,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24312,8 +24277,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Header() http. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -24421,8 +24385,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Header() h func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -24527,12 +24490,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Header() h func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24641,12 +24603,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24770,12 +24731,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24904,8 +24864,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Header() ht func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -25017,8 +24976,7 @@ func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header { func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchdeleteintentsrequest) if err != nil { return nil, err } @@ -25128,8 +25086,7 @@ func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header { func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchupdateintentsrequest) if err != nil { return nil, err } @@ -25257,8 +25214,7 @@ func (c *ProjectsAgentIntentsCreateCall) Header() http.Header { func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2intent) if err != nil { return nil, err } @@ -25362,12 +25318,11 @@ func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header { func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25495,12 +25450,11 @@ func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25646,12 +25600,11 @@ func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25801,8 +25754,7 @@ func (c *ProjectsAgentIntentsPatchCall) Header() http.Header { func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2intent) if err != nil { return nil, err } @@ -25904,8 +25856,7 @@ func (c *ProjectsAgentKnowledgeBasesCreateCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2knowledgebase) if err != nil { return nil, err } @@ -26012,12 +25963,11 @@ func (c *ProjectsAgentKnowledgeBasesDeleteCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26121,12 +26071,11 @@ func (c *ProjectsAgentKnowledgeBasesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26262,12 +26211,11 @@ func (c *ProjectsAgentKnowledgeBasesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/knowledgeBases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26390,8 +26338,7 @@ func (c *ProjectsAgentKnowledgeBasesPatchCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2knowledgebase) if err != nil { return nil, err } @@ -26496,8 +26443,7 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2document) if err != nil { return nil, err } @@ -26602,12 +26548,11 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26711,12 +26656,11 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26849,12 +26793,11 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26982,8 +26925,7 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2document) if err != nil { return nil, err } @@ -27094,8 +27036,7 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2reloaddocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2reloaddocumentrequest) if err != nil { return nil, err } @@ -27198,12 +27139,11 @@ func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header { func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27317,8 +27257,7 @@ func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header { func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2detectintentrequest) if err != nil { return nil, err } @@ -27424,8 +27363,7 @@ func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header { func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -27528,12 +27466,11 @@ func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header { func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27640,12 +27577,11 @@ func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27766,12 +27702,11 @@ func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27901,8 +27836,7 @@ func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header { func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -28010,8 +27944,7 @@ func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header { func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -28116,12 +28049,11 @@ func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28230,12 +28162,11 @@ func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28359,12 +28290,11 @@ func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28493,8 +28423,7 @@ func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header { func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -28597,8 +28526,7 @@ func (c *ProjectsAgentVersionsCreateCall) Header() http.Header { func (c *ProjectsAgentVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2version) if err != nil { return nil, err } @@ -28698,12 +28626,11 @@ func (c *ProjectsAgentVersionsDeleteCall) Header() http.Header { func (c *ProjectsAgentVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28807,12 +28734,11 @@ func (c *ProjectsAgentVersionsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28930,12 +28856,11 @@ func (c *ProjectsAgentVersionsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29060,8 +28985,7 @@ func (c *ProjectsAgentVersionsPatchCall) Header() http.Header { func (c *ProjectsAgentVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2version) if err != nil { return nil, err } @@ -29199,12 +29123,11 @@ func (c *ProjectsAnswerRecordsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/answerRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29326,8 +29249,7 @@ func (c *ProjectsAnswerRecordsPatchCall) Header() http.Header { func (c *ProjectsAnswerRecordsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2answerrecord) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2answerrecord) if err != nil { return nil, err } @@ -29439,12 +29361,11 @@ func (c *ProjectsConversationDatasetsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29544,8 +29465,7 @@ func (c *ProjectsConversationDatasetsImportConversationDataCall) Header() http.H func (c *ProjectsConversationDatasetsImportConversationDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importconversationdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2importconversationdatarequest) if err != nil { return nil, err } @@ -29673,12 +29593,11 @@ func (c *ProjectsConversationDatasetsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversationDatasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29796,8 +29715,7 @@ func (c *ProjectsConversationModelsCreateCall) Header() http.Header { func (c *ProjectsConversationModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationmodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationmodel) if err != nil { return nil, err } @@ -29902,12 +29820,11 @@ func (c *ProjectsConversationModelsDeleteCall) Header() http.Header { func (c *ProjectsConversationModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30009,8 +29926,7 @@ func (c *ProjectsConversationModelsDeployCall) Header() http.Header { func (c *ProjectsConversationModelsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2deployconversationmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2deployconversationmodelrequest) if err != nil { return nil, err } @@ -30122,12 +30038,11 @@ func (c *ProjectsConversationModelsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30246,12 +30161,11 @@ func (c *ProjectsConversationModelsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversationModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30374,8 +30288,7 @@ func (c *ProjectsConversationModelsUndeployCall) Header() http.Header { func (c *ProjectsConversationModelsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2undeployconversationmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2undeployconversationmodelrequest) if err != nil { return nil, err } @@ -30487,12 +30400,11 @@ func (c *ProjectsConversationModelsEvaluationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30610,12 +30522,11 @@ func (c *ProjectsConversationModelsEvaluationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30737,8 +30648,7 @@ func (c *ProjectsConversationProfilesClearSuggestionFeatureConfigCall) Header() func (c *ProjectsConversationProfilesClearSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2clearsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2clearsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -30843,8 +30753,7 @@ func (c *ProjectsConversationProfilesCreateCall) Header() http.Header { func (c *ProjectsConversationProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationprofile) if err != nil { return nil, err } @@ -30944,12 +30853,11 @@ func (c *ProjectsConversationProfilesDeleteCall) Header() http.Header { func (c *ProjectsConversationProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31053,12 +30961,11 @@ func (c *ProjectsConversationProfilesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31177,12 +31084,11 @@ func (c *ProjectsConversationProfilesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversationProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31307,8 +31213,7 @@ func (c *ProjectsConversationProfilesPatchCall) Header() http.Header { func (c *ProjectsConversationProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationprofile) if err != nil { return nil, err } @@ -31422,8 +31327,7 @@ func (c *ProjectsConversationProfilesSetSuggestionFeatureConfigCall) Header() ht func (c *ProjectsConversationProfilesSetSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2setsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2setsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -31526,8 +31430,7 @@ func (c *ProjectsConversationsCompleteCall) Header() http.Header { func (c *ProjectsConversationsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2completeconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2completeconversationrequest) if err != nil { return nil, err } @@ -31652,8 +31555,7 @@ func (c *ProjectsConversationsCreateCall) Header() http.Header { func (c *ProjectsConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversation) if err != nil { return nil, err } @@ -31765,12 +31667,11 @@ func (c *ProjectsConversationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31898,12 +31799,11 @@ func (c *ProjectsConversationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32056,12 +31956,11 @@ func (c *ProjectsConversationsMessagesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32180,8 +32079,7 @@ func (c *ProjectsConversationsParticipantsAnalyzeContentCall) Header() http.Head func (c *ProjectsConversationsParticipantsAnalyzeContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2analyzecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2analyzecontentrequest) if err != nil { return nil, err } @@ -32283,8 +32181,7 @@ func (c *ProjectsConversationsParticipantsCreateCall) Header() http.Header { func (c *ProjectsConversationsParticipantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2participant) if err != nil { return nil, err } @@ -32396,12 +32293,11 @@ func (c *ProjectsConversationsParticipantsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32519,12 +32415,11 @@ func (c *ProjectsConversationsParticipantsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/participants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32646,8 +32541,7 @@ func (c *ProjectsConversationsParticipantsPatchCall) Header() http.Header { func (c *ProjectsConversationsParticipantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2participant) if err != nil { return nil, err } @@ -32750,8 +32644,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestArticlesCall) Header func (c *ProjectsConversationsParticipantsSuggestionsSuggestArticlesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestarticlesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestarticlesrequest) if err != nil { return nil, err } @@ -32854,8 +32747,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestFaqAnswersCall) Head func (c *ProjectsConversationsParticipantsSuggestionsSuggestFaqAnswersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestfaqanswersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestfaqanswersrequest) if err != nil { return nil, err } @@ -32958,8 +32850,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestKnowledgeAssistCall) func (c *ProjectsConversationsParticipantsSuggestionsSuggestKnowledgeAssistCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestknowledgeassistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestknowledgeassistrequest) if err != nil { return nil, err } @@ -33062,8 +32953,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestSmartRepliesCall) He func (c *ProjectsConversationsParticipantsSuggestionsSuggestSmartRepliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestsmartrepliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestsmartrepliesrequest) if err != nil { return nil, err } @@ -33167,8 +33057,7 @@ func (c *ProjectsConversationsSuggestionsSearchKnowledgeCall) Header() http.Head func (c *ProjectsConversationsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2searchknowledgerequest) if err != nil { return nil, err } @@ -33272,8 +33161,7 @@ func (c *ProjectsConversationsSuggestionsSuggestConversationSummaryCall) Header( func (c *ProjectsConversationsSuggestionsSuggestConversationSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestconversationsummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestconversationsummaryrequest) if err != nil { return nil, err } @@ -33388,8 +33276,7 @@ func (c *ProjectsGeneratorsCreateCall) Header() http.Header { func (c *ProjectsGeneratorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2generator) if err != nil { return nil, err } @@ -33515,12 +33402,11 @@ func (c *ProjectsGeneratorsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/generators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33635,8 +33521,7 @@ func (c *ProjectsKnowledgeBasesCreateCall) Header() http.Header { func (c *ProjectsKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2knowledgebase) if err != nil { return nil, err } @@ -33743,12 +33628,11 @@ func (c *ProjectsKnowledgeBasesDeleteCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33852,12 +33736,11 @@ func (c *ProjectsKnowledgeBasesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33993,12 +33876,11 @@ func (c *ProjectsKnowledgeBasesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/knowledgeBases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34121,8 +34003,7 @@ func (c *ProjectsKnowledgeBasesPatchCall) Header() http.Header { func (c *ProjectsKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2knowledgebase) if err != nil { return nil, err } @@ -34227,8 +34108,7 @@ func (c *ProjectsKnowledgeBasesDocumentsCreateCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2document) if err != nil { return nil, err } @@ -34333,12 +34213,11 @@ func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34436,8 +34315,7 @@ func (c *ProjectsKnowledgeBasesDocumentsExportCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2exportdocumentrequest) if err != nil { return nil, err } @@ -34549,12 +34427,11 @@ func (c *ProjectsKnowledgeBasesDocumentsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34654,8 +34531,7 @@ func (c *ProjectsKnowledgeBasesDocumentsImportCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2importdocumentsrequest) if err != nil { return nil, err } @@ -34796,12 +34672,11 @@ func (c *ProjectsKnowledgeBasesDocumentsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34929,8 +34804,7 @@ func (c *ProjectsKnowledgeBasesDocumentsPatchCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2document) if err != nil { return nil, err } @@ -35041,8 +34915,7 @@ func (c *ProjectsKnowledgeBasesDocumentsReloadCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2reloaddocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2reloaddocumentrequest) if err != nil { return nil, err } @@ -35142,12 +35015,11 @@ func (c *ProjectsLocationsDeleteAgentCall) Header() http.Header { func (c *ProjectsLocationsDeleteAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35250,12 +35122,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35359,12 +35230,11 @@ func (c *ProjectsLocationsGetAgentCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35467,12 +35337,11 @@ func (c *ProjectsLocationsGetEncryptionSpecCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35599,12 +35468,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35727,8 +35595,7 @@ func (c *ProjectsLocationsSetAgentCall) Header() http.Header { func (c *ProjectsLocationsSetAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2agent) if err != nil { return nil, err } @@ -35836,8 +35703,7 @@ func (c *ProjectsLocationsAgentExportCall) Header() http.Header { func (c *ProjectsLocationsAgentExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2exportagentrequest) if err != nil { return nil, err } @@ -35948,12 +35814,11 @@ func (c *ProjectsLocationsAgentGetFulfillmentCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36069,12 +35934,11 @@ func (c *ProjectsLocationsAgentGetValidationResultCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent/validationResult") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36185,8 +36049,7 @@ func (c *ProjectsLocationsAgentImportCall) Header() http.Header { func (c *ProjectsLocationsAgentImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2importagentrequest) if err != nil { return nil, err } @@ -36304,8 +36167,7 @@ func (c *ProjectsLocationsAgentRestoreCall) Header() http.Header { func (c *ProjectsLocationsAgentRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2restoreagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2restoreagentrequest) if err != nil { return nil, err } @@ -36435,12 +36297,11 @@ func (c *ProjectsLocationsAgentSearchCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36564,8 +36425,7 @@ func (c *ProjectsLocationsAgentTrainCall) Header() http.Header { func (c *ProjectsLocationsAgentTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2trainagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2trainagentrequest) if err != nil { return nil, err } @@ -36676,8 +36536,7 @@ func (c *ProjectsLocationsAgentUpdateFulfillmentCall) Header() http.Header { func (c *ProjectsLocationsAgentUpdateFulfillmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2fulfillment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2fulfillment) if err != nil { return nil, err } @@ -36789,8 +36648,7 @@ func (c *ProjectsLocationsAgentEntityTypesBatchDeleteCall) Header() http.Header func (c *ProjectsLocationsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchdeleteentitytypesrequest) if err != nil { return nil, err } @@ -36900,8 +36758,7 @@ func (c *ProjectsLocationsAgentEntityTypesBatchUpdateCall) Header() http.Header func (c *ProjectsLocationsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchupdateentitytypesrequest) if err != nil { return nil, err } @@ -37014,8 +36871,7 @@ func (c *ProjectsLocationsAgentEntityTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2entitytype) if err != nil { return nil, err } @@ -37117,12 +36973,11 @@ func (c *ProjectsLocationsAgentEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37235,12 +37090,11 @@ func (c *ProjectsLocationsAgentEntityTypesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37368,12 +37222,11 @@ func (c *ProjectsLocationsAgentEntityTypesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37508,8 +37361,7 @@ func (c *ProjectsLocationsAgentEntityTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2entitytype) if err != nil { return nil, err } @@ -37621,8 +37473,7 @@ func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchCreateCall) Header() http func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchcreateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchcreateentitiesrequest) if err != nil { return nil, err } @@ -37734,8 +37585,7 @@ func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchDeleteCall) Header() http func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchdeleteentitiesrequest) if err != nil { return nil, err } @@ -37848,8 +37698,7 @@ func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchUpdateCall) Header() http func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchupdateentitiesrequest) if err != nil { return nil, err } @@ -37958,8 +37807,7 @@ func (c *ProjectsLocationsAgentEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2environment) if err != nil { return nil, err } @@ -38061,12 +37909,11 @@ func (c *ProjectsLocationsAgentEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38172,12 +38019,11 @@ func (c *ProjectsLocationsAgentEnvironmentsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38297,12 +38143,11 @@ func (c *ProjectsLocationsAgentEnvironmentsGetHistoryCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38442,12 +38287,11 @@ func (c *ProjectsLocationsAgentEnvironmentsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38591,8 +38435,7 @@ func (c *ProjectsLocationsAgentEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2environment) if err != nil { return nil, err } @@ -38746,12 +38589,11 @@ func (c *ProjectsLocationsAgentEnvironmentsIntentsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38867,12 +38709,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDeleteContextsCall) Head func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38986,8 +38827,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDetectIntentCall) Header func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2detectintentrequest) if err != nil { return nil, err } @@ -39093,8 +38933,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsCreateCall) Head func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -39197,12 +39036,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsDeleteCall) Head func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39309,12 +39147,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39435,12 +39272,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39570,8 +39406,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsPatchCall) Heade func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -39679,8 +39514,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) H func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -39785,12 +39619,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) H func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39899,12 +39732,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40028,12 +39860,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40162,8 +39993,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) He func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -40275,8 +40105,7 @@ func (c *ProjectsLocationsAgentIntentsBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchdeleteintentsrequest) if err != nil { return nil, err } @@ -40386,8 +40215,7 @@ func (c *ProjectsLocationsAgentIntentsBatchUpdateCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2batchupdateintentsrequest) if err != nil { return nil, err } @@ -40515,8 +40343,7 @@ func (c *ProjectsLocationsAgentIntentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2intent) if err != nil { return nil, err } @@ -40620,12 +40447,11 @@ func (c *ProjectsLocationsAgentIntentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40753,12 +40579,11 @@ func (c *ProjectsLocationsAgentIntentsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40904,12 +40729,11 @@ func (c *ProjectsLocationsAgentIntentsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41059,8 +40883,7 @@ func (c *ProjectsLocationsAgentIntentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2intent) if err != nil { return nil, err } @@ -41163,12 +40986,11 @@ func (c *ProjectsLocationsAgentSessionsDeleteContextsCall) Header() http.Header func (c *ProjectsLocationsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41282,8 +41104,7 @@ func (c *ProjectsLocationsAgentSessionsDetectIntentCall) Header() http.Header { func (c *ProjectsLocationsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2detectintentrequest) if err != nil { return nil, err } @@ -41389,8 +41210,7 @@ func (c *ProjectsLocationsAgentSessionsContextsCreateCall) Header() http.Header func (c *ProjectsLocationsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -41493,12 +41313,11 @@ func (c *ProjectsLocationsAgentSessionsContextsDeleteCall) Header() http.Header func (c *ProjectsLocationsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41605,12 +41424,11 @@ func (c *ProjectsLocationsAgentSessionsContextsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41731,12 +41549,11 @@ func (c *ProjectsLocationsAgentSessionsContextsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41866,8 +41683,7 @@ func (c *ProjectsLocationsAgentSessionsContextsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2context) if err != nil { return nil, err } @@ -41975,8 +41791,7 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesCreateCall) Header() http.Head func (c *ProjectsLocationsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -42081,12 +41896,11 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesDeleteCall) Header() http.Head func (c *ProjectsLocationsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42195,12 +42009,11 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42324,12 +42137,11 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42458,8 +42270,7 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesPatchCall) Header() http.Heade func (c *ProjectsLocationsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2sessionentitytype) if err != nil { return nil, err } @@ -42562,8 +42373,7 @@ func (c *ProjectsLocationsAgentVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2version) if err != nil { return nil, err } @@ -42663,12 +42473,11 @@ func (c *ProjectsLocationsAgentVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42772,12 +42581,11 @@ func (c *ProjectsLocationsAgentVersionsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42895,12 +42703,11 @@ func (c *ProjectsLocationsAgentVersionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43025,8 +42832,7 @@ func (c *ProjectsLocationsAgentVersionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2version) if err != nil { return nil, err } @@ -43164,12 +42970,11 @@ func (c *ProjectsLocationsAnswerRecordsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/answerRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43291,8 +43096,7 @@ func (c *ProjectsLocationsAnswerRecordsPatchCall) Header() http.Header { func (c *ProjectsLocationsAnswerRecordsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2answerrecord) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2answerrecord) if err != nil { return nil, err } @@ -43399,8 +43203,7 @@ func (c *ProjectsLocationsConversationDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationdataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationdataset) if err != nil { return nil, err } @@ -43506,12 +43309,11 @@ func (c *ProjectsLocationsConversationDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversationDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43615,12 +43417,11 @@ func (c *ProjectsLocationsConversationDatasetsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43720,8 +43521,7 @@ func (c *ProjectsLocationsConversationDatasetsImportConversationDataCall) Header func (c *ProjectsLocationsConversationDatasetsImportConversationDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importconversationdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2importconversationdatarequest) if err != nil { return nil, err } @@ -43849,12 +43649,11 @@ func (c *ProjectsLocationsConversationDatasetsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversationDatasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43972,8 +43771,7 @@ func (c *ProjectsLocationsConversationModelsCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationmodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationmodel) if err != nil { return nil, err } @@ -44078,12 +43876,11 @@ func (c *ProjectsLocationsConversationModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversationModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44185,8 +43982,7 @@ func (c *ProjectsLocationsConversationModelsDeployCall) Header() http.Header { func (c *ProjectsLocationsConversationModelsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2deployconversationmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2deployconversationmodelrequest) if err != nil { return nil, err } @@ -44298,12 +44094,11 @@ func (c *ProjectsLocationsConversationModelsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44422,12 +44217,11 @@ func (c *ProjectsLocationsConversationModelsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversationModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44550,8 +44344,7 @@ func (c *ProjectsLocationsConversationModelsUndeployCall) Header() http.Header { func (c *ProjectsLocationsConversationModelsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2undeployconversationmodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2undeployconversationmodelrequest) if err != nil { return nil, err } @@ -44653,8 +44446,7 @@ func (c *ProjectsLocationsConversationModelsEvaluationsCreateCall) Header() http func (c *ProjectsLocationsConversationModelsEvaluationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2createconversationmodelevaluationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2createconversationmodelevaluationrequest) if err != nil { return nil, err } @@ -44766,12 +44558,11 @@ func (c *ProjectsLocationsConversationModelsEvaluationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44889,12 +44680,11 @@ func (c *ProjectsLocationsConversationModelsEvaluationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45016,8 +44806,7 @@ func (c *ProjectsLocationsConversationProfilesClearSuggestionFeatureConfigCall) func (c *ProjectsLocationsConversationProfilesClearSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2clearsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2clearsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -45122,8 +44911,7 @@ func (c *ProjectsLocationsConversationProfilesCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationprofile) if err != nil { return nil, err } @@ -45223,12 +45011,11 @@ func (c *ProjectsLocationsConversationProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversationProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45332,12 +45119,11 @@ func (c *ProjectsLocationsConversationProfilesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45456,12 +45242,11 @@ func (c *ProjectsLocationsConversationProfilesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversationProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45586,8 +45371,7 @@ func (c *ProjectsLocationsConversationProfilesPatchCall) Header() http.Header { func (c *ProjectsLocationsConversationProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversationprofile) if err != nil { return nil, err } @@ -45701,8 +45485,7 @@ func (c *ProjectsLocationsConversationProfilesSetSuggestionFeatureConfigCall) He func (c *ProjectsLocationsConversationProfilesSetSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2setsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2setsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -45805,8 +45588,7 @@ func (c *ProjectsLocationsConversationsCompleteCall) Header() http.Header { func (c *ProjectsLocationsConversationsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2completeconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2completeconversationrequest) if err != nil { return nil, err } @@ -45931,8 +45713,7 @@ func (c *ProjectsLocationsConversationsCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2conversation) if err != nil { return nil, err } @@ -46044,12 +45825,11 @@ func (c *ProjectsLocationsConversationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46177,12 +45957,11 @@ func (c *ProjectsLocationsConversationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46335,12 +46114,11 @@ func (c *ProjectsLocationsConversationsMessagesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46459,8 +46237,7 @@ func (c *ProjectsLocationsConversationsParticipantsAnalyzeContentCall) Header() func (c *ProjectsLocationsConversationsParticipantsAnalyzeContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2analyzecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2analyzecontentrequest) if err != nil { return nil, err } @@ -46562,8 +46339,7 @@ func (c *ProjectsLocationsConversationsParticipantsCreateCall) Header() http.Hea func (c *ProjectsLocationsConversationsParticipantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2participant) if err != nil { return nil, err } @@ -46675,12 +46451,11 @@ func (c *ProjectsLocationsConversationsParticipantsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46798,12 +46573,11 @@ func (c *ProjectsLocationsConversationsParticipantsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/participants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46925,8 +46699,7 @@ func (c *ProjectsLocationsConversationsParticipantsPatchCall) Header() http.Head func (c *ProjectsLocationsConversationsParticipantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2participant) if err != nil { return nil, err } @@ -47029,8 +46802,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestArticlesCal func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestArticlesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestarticlesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestarticlesrequest) if err != nil { return nil, err } @@ -47133,8 +46905,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestFaqAnswersC func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestFaqAnswersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestfaqanswersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestfaqanswersrequest) if err != nil { return nil, err } @@ -47237,8 +47008,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestKnowledgeAs func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestKnowledgeAssistCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestknowledgeassistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestknowledgeassistrequest) if err != nil { return nil, err } @@ -47341,8 +47111,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestSmartReplie func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestSmartRepliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestsmartrepliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestsmartrepliesrequest) if err != nil { return nil, err } @@ -47446,8 +47215,7 @@ func (c *ProjectsLocationsConversationsSuggestionsSearchKnowledgeCall) Header() func (c *ProjectsLocationsConversationsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2searchknowledgerequest) if err != nil { return nil, err } @@ -47551,8 +47319,7 @@ func (c *ProjectsLocationsConversationsSuggestionsSuggestConversationSummaryCall func (c *ProjectsLocationsConversationsSuggestionsSuggestConversationSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2suggestconversationsummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2suggestconversationsummaryrequest) if err != nil { return nil, err } @@ -47658,8 +47425,7 @@ func (c *ProjectsLocationsEncryptionSpecInitializeCall) Header() http.Header { func (c *ProjectsLocationsEncryptionSpecInitializeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2initializeencryptionspecrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2initializeencryptionspecrequest) if err != nil { return nil, err } @@ -47774,8 +47540,7 @@ func (c *ProjectsLocationsGeneratorsCreateCall) Header() http.Header { func (c *ProjectsLocationsGeneratorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2generator) if err != nil { return nil, err } @@ -47875,12 +47640,11 @@ func (c *ProjectsLocationsGeneratorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGeneratorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47984,12 +47748,11 @@ func (c *ProjectsLocationsGeneratorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48107,12 +47870,11 @@ func (c *ProjectsLocationsGeneratorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/generators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48234,8 +47996,7 @@ func (c *ProjectsLocationsGeneratorsPatchCall) Header() http.Header { func (c *ProjectsLocationsGeneratorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2generator) if err != nil { return nil, err } @@ -48337,8 +48098,7 @@ func (c *ProjectsLocationsKnowledgeBasesCreateCall) Header() http.Header { func (c *ProjectsLocationsKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2knowledgebase) if err != nil { return nil, err } @@ -48445,12 +48205,11 @@ func (c *ProjectsLocationsKnowledgeBasesDeleteCall) Header() http.Header { func (c *ProjectsLocationsKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48554,12 +48313,11 @@ func (c *ProjectsLocationsKnowledgeBasesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48695,12 +48453,11 @@ func (c *ProjectsLocationsKnowledgeBasesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/knowledgeBases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48823,8 +48580,7 @@ func (c *ProjectsLocationsKnowledgeBasesPatchCall) Header() http.Header { func (c *ProjectsLocationsKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2knowledgebase) if err != nil { return nil, err } @@ -48929,8 +48685,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsCreateCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2document) if err != nil { return nil, err } @@ -49035,12 +48790,11 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsDeleteCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49138,8 +48892,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsExportCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2exportdocumentrequest) if err != nil { return nil, err } @@ -49251,12 +49004,11 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49356,8 +49108,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsImportCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2importdocumentsrequest) if err != nil { return nil, err } @@ -49498,12 +49249,11 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49631,8 +49381,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsPatchCall) Header() http.Header func (c *ProjectsLocationsKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2document) if err != nil { return nil, err } @@ -49743,8 +49492,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsReloadCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2reloaddocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2reloaddocumentrequest) if err != nil { return nil, err } @@ -49851,12 +49599,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49961,12 +49708,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50090,12 +49836,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50211,8 +49956,7 @@ func (c *ProjectsLocationsStatelessSuggestionGenerateCall) Header() http.Header func (c *ProjectsLocationsStatelessSuggestionGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2generatestatelesssuggestionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2generatestatelesssuggestionrequest) if err != nil { return nil, err } @@ -50315,8 +50059,7 @@ func (c *ProjectsLocationsSuggestionsGenerateStatelessSummaryCall) Header() http func (c *ProjectsLocationsSuggestionsGenerateStatelessSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2generatestatelesssummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2generatestatelesssummaryrequest) if err != nil { return nil, err } @@ -50419,8 +50162,7 @@ func (c *ProjectsLocationsSuggestionsSearchKnowledgeCall) Header() http.Header { func (c *ProjectsLocationsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2searchknowledgerequest) if err != nil { return nil, err } @@ -50527,12 +50269,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -50637,12 +50378,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50766,12 +50506,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50887,8 +50626,7 @@ func (c *ProjectsSuggestionsGenerateStatelessSummaryCall) Header() http.Header { func (c *ProjectsSuggestionsGenerateStatelessSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2generatestatelesssummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2generatestatelesssummaryrequest) if err != nil { return nil, err } @@ -50991,8 +50729,7 @@ func (c *ProjectsSuggestionsSearchKnowledgeCall) Header() http.Header { func (c *ProjectsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2searchknowledgerequest) if err != nil { return nil, err } diff --git a/dialogflow/v2beta1/dialogflow-gen.go b/dialogflow/v2beta1/dialogflow-gen.go index 1507105d318..cc1918db7d2 100644 --- a/dialogflow/v2beta1/dialogflow-gen.go +++ b/dialogflow/v2beta1/dialogflow-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -20387,12 +20386,11 @@ func (c *ProjectsDeleteAgentCall) Header() http.Header { func (c *ProjectsDeleteAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20496,12 +20494,11 @@ func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20604,8 +20601,7 @@ func (c *ProjectsSetAgentCall) Header() http.Header { func (c *ProjectsSetAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1agent) if err != nil { return nil, err } @@ -20713,8 +20709,7 @@ func (c *ProjectsAgentExportCall) Header() http.Header { func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1exportagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1exportagentrequest) if err != nil { return nil, err } @@ -20826,12 +20821,11 @@ func (c *ProjectsAgentGetFulfillmentCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20947,12 +20941,11 @@ func (c *ProjectsAgentGetValidationResultCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent/validationResult") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21063,8 +21056,7 @@ func (c *ProjectsAgentImportCall) Header() http.Header { func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1importagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1importagentrequest) if err != nil { return nil, err } @@ -21182,8 +21174,7 @@ func (c *ProjectsAgentRestoreCall) Header() http.Header { func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1restoreagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1restoreagentrequest) if err != nil { return nil, err } @@ -21314,12 +21305,11 @@ func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21443,8 +21433,7 @@ func (c *ProjectsAgentTrainCall) Header() http.Header { func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1trainagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1trainagentrequest) if err != nil { return nil, err } @@ -21555,8 +21544,7 @@ func (c *ProjectsAgentUpdateFulfillmentCall) Header() http.Header { func (c *ProjectsAgentUpdateFulfillmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1fulfillment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1fulfillment) if err != nil { return nil, err } @@ -21668,8 +21656,7 @@ func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header { func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest) if err != nil { return nil, err } @@ -21779,8 +21766,7 @@ func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchupdateentitytypesrequest) if err != nil { return nil, err } @@ -21894,8 +21880,7 @@ func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1entitytype) if err != nil { return nil, err } @@ -21997,12 +21982,11 @@ func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22116,12 +22100,11 @@ func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22249,12 +22232,11 @@ func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22390,8 +22372,7 @@ func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header { func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1entitytype) if err != nil { return nil, err } @@ -22504,8 +22485,7 @@ func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchcreateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchcreateentitiesrequest) if err != nil { return nil, err } @@ -22618,8 +22598,7 @@ func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header { func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchdeleteentitiesrequest) if err != nil { return nil, err } @@ -22733,8 +22712,7 @@ func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header { func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchupdateentitiesrequest) if err != nil { return nil, err } @@ -22843,8 +22821,7 @@ func (c *ProjectsAgentEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsAgentEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1environment) if err != nil { return nil, err } @@ -22945,12 +22922,11 @@ func (c *ProjectsAgentEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsAgentEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23055,12 +23031,11 @@ func (c *ProjectsAgentEnvironmentsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23179,12 +23154,11 @@ func (c *ProjectsAgentEnvironmentsGetHistoryCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23323,12 +23297,11 @@ func (c *ProjectsAgentEnvironmentsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23471,8 +23444,7 @@ func (c *ProjectsAgentEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsAgentEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1environment) if err != nil { return nil, err } @@ -23626,12 +23598,11 @@ func (c *ProjectsAgentEnvironmentsIntentsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23750,12 +23721,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Header() http func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23871,8 +23841,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Header() http.H func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1detectintentrequest) if err != nil { return nil, err } @@ -23980,8 +23949,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Header() http func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -24087,12 +24055,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Header() http func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24202,12 +24169,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24330,12 +24296,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24467,8 +24432,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Header() http. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -24579,8 +24543,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Header() h func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -24688,12 +24651,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Header() h func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24805,12 +24767,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24937,12 +24898,11 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25074,8 +25034,7 @@ func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Header() ht func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -25187,8 +25146,7 @@ func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header { func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchdeleteintentsrequest) if err != nil { return nil, err } @@ -25298,8 +25256,7 @@ func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header { func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchupdateintentsrequest) if err != nil { return nil, err } @@ -25428,8 +25385,7 @@ func (c *ProjectsAgentIntentsCreateCall) Header() http.Header { func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1intent) if err != nil { return nil, err } @@ -25533,12 +25489,11 @@ func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header { func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25667,12 +25622,11 @@ func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25818,12 +25772,11 @@ func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25974,8 +25927,7 @@ func (c *ProjectsAgentIntentsPatchCall) Header() http.Header { func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1intent) if err != nil { return nil, err } @@ -26078,8 +26030,7 @@ func (c *ProjectsAgentKnowledgeBasesCreateCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1knowledgebase) if err != nil { return nil, err } @@ -26188,12 +26139,11 @@ func (c *ProjectsAgentKnowledgeBasesDeleteCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26299,12 +26249,11 @@ func (c *ProjectsAgentKnowledgeBasesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26442,12 +26391,11 @@ func (c *ProjectsAgentKnowledgeBasesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26574,8 +26522,7 @@ func (c *ProjectsAgentKnowledgeBasesPatchCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1knowledgebase) if err != nil { return nil, err } @@ -26691,8 +26638,7 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1document) if err != nil { return nil, err } @@ -26799,12 +26745,11 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26910,12 +26855,11 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27050,12 +26994,11 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27185,8 +27128,7 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1document) if err != nil { return nil, err } @@ -27300,8 +27242,7 @@ func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) Header() http.Header { func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1reloaddocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1reloaddocumentrequest) if err != nil { return nil, err } @@ -27407,12 +27348,11 @@ func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header { func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27528,8 +27468,7 @@ func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header { func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1detectintentrequest) if err != nil { return nil, err } @@ -27637,8 +27576,7 @@ func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header { func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -27744,12 +27682,11 @@ func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header { func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27859,12 +27796,11 @@ func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27987,12 +27923,11 @@ func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28124,8 +28059,7 @@ func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header { func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -28236,8 +28170,7 @@ func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header { func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -28345,12 +28278,11 @@ func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28462,12 +28394,11 @@ func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28594,12 +28525,11 @@ func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28731,8 +28661,7 @@ func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header { func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -28835,8 +28764,7 @@ func (c *ProjectsAgentVersionsCreateCall) Header() http.Header { func (c *ProjectsAgentVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1version) if err != nil { return nil, err } @@ -28936,12 +28864,11 @@ func (c *ProjectsAgentVersionsDeleteCall) Header() http.Header { func (c *ProjectsAgentVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29045,12 +28972,11 @@ func (c *ProjectsAgentVersionsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29168,12 +29094,11 @@ func (c *ProjectsAgentVersionsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29298,8 +29223,7 @@ func (c *ProjectsAgentVersionsPatchCall) Header() http.Header { func (c *ProjectsAgentVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1version) if err != nil { return nil, err } @@ -29411,12 +29335,11 @@ func (c *ProjectsAnswerRecordsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29545,12 +29468,11 @@ func (c *ProjectsAnswerRecordsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/answerRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29673,8 +29595,7 @@ func (c *ProjectsAnswerRecordsPatchCall) Header() http.Header { func (c *ProjectsAnswerRecordsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1answerrecord) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1answerrecord) if err != nil { return nil, err } @@ -29783,8 +29704,7 @@ func (c *ProjectsConversationProfilesClearSuggestionFeatureConfigCall) Header() func (c *ProjectsConversationProfilesClearSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1clearsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1clearsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -29889,8 +29809,7 @@ func (c *ProjectsConversationProfilesCreateCall) Header() http.Header { func (c *ProjectsConversationProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1conversationprofile) if err != nil { return nil, err } @@ -29990,12 +29909,11 @@ func (c *ProjectsConversationProfilesDeleteCall) Header() http.Header { func (c *ProjectsConversationProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30099,12 +30017,11 @@ func (c *ProjectsConversationProfilesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30223,12 +30140,11 @@ func (c *ProjectsConversationProfilesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/conversationProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30353,8 +30269,7 @@ func (c *ProjectsConversationProfilesPatchCall) Header() http.Header { func (c *ProjectsConversationProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1conversationprofile) if err != nil { return nil, err } @@ -30468,8 +30383,7 @@ func (c *ProjectsConversationProfilesSetSuggestionFeatureConfigCall) Header() ht func (c *ProjectsConversationProfilesSetSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1setsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1setsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -30572,8 +30486,7 @@ func (c *ProjectsConversationsCompleteCall) Header() http.Header { func (c *ProjectsConversationsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1completeconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1completeconversationrequest) if err != nil { return nil, err } @@ -30698,8 +30611,7 @@ func (c *ProjectsConversationsCreateCall) Header() http.Header { func (c *ProjectsConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1conversation) if err != nil { return nil, err } @@ -30811,12 +30723,11 @@ func (c *ProjectsConversationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30944,12 +30855,11 @@ func (c *ProjectsConversationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31065,8 +30975,7 @@ func (c *ProjectsConversationsMessagesBatchCreateCall) Header() http.Header { func (c *ProjectsConversationsMessagesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchcreatemessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchcreatemessagesrequest) if err != nil { return nil, err } @@ -31206,12 +31115,11 @@ func (c *ProjectsConversationsMessagesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31330,8 +31238,7 @@ func (c *ProjectsConversationsParticipantsAnalyzeContentCall) Header() http.Head func (c *ProjectsConversationsParticipantsAnalyzeContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1analyzecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1analyzecontentrequest) if err != nil { return nil, err } @@ -31433,8 +31340,7 @@ func (c *ProjectsConversationsParticipantsCreateCall) Header() http.Header { func (c *ProjectsConversationsParticipantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1participant) if err != nil { return nil, err } @@ -31546,12 +31452,11 @@ func (c *ProjectsConversationsParticipantsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31669,12 +31574,11 @@ func (c *ProjectsConversationsParticipantsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/participants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31796,8 +31700,7 @@ func (c *ProjectsConversationsParticipantsPatchCall) Header() http.Header { func (c *ProjectsConversationsParticipantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1participant) if err != nil { return nil, err } @@ -31903,8 +31806,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsCompileCall) Header() http. func (c *ProjectsConversationsParticipantsSuggestionsCompileCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1compilesuggestionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1compilesuggestionrequest) if err != nil { return nil, err } @@ -32055,12 +31957,11 @@ func (c *ProjectsConversationsParticipantsSuggestionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/suggestions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32178,8 +32079,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestArticlesCall) Header func (c *ProjectsConversationsParticipantsSuggestionsSuggestArticlesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestarticlesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestarticlesrequest) if err != nil { return nil, err } @@ -32282,8 +32182,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestFaqAnswersCall) Head func (c *ProjectsConversationsParticipantsSuggestionsSuggestFaqAnswersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestfaqanswersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestfaqanswersrequest) if err != nil { return nil, err } @@ -32386,8 +32285,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestKnowledgeAssistCall) func (c *ProjectsConversationsParticipantsSuggestionsSuggestKnowledgeAssistCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestknowledgeassistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestknowledgeassistrequest) if err != nil { return nil, err } @@ -32490,8 +32388,7 @@ func (c *ProjectsConversationsParticipantsSuggestionsSuggestSmartRepliesCall) He func (c *ProjectsConversationsParticipantsSuggestionsSuggestSmartRepliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestsmartrepliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestsmartrepliesrequest) if err != nil { return nil, err } @@ -32595,8 +32492,7 @@ func (c *ProjectsConversationsSuggestionsSearchKnowledgeCall) Header() http.Head func (c *ProjectsConversationsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1searchknowledgerequest) if err != nil { return nil, err } @@ -32700,8 +32596,7 @@ func (c *ProjectsConversationsSuggestionsSuggestConversationSummaryCall) Header( func (c *ProjectsConversationsSuggestionsSuggestConversationSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestconversationsummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestconversationsummaryrequest) if err != nil { return nil, err } @@ -32816,8 +32711,7 @@ func (c *ProjectsGeneratorsCreateCall) Header() http.Header { func (c *ProjectsGeneratorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1generator) if err != nil { return nil, err } @@ -32943,12 +32837,11 @@ func (c *ProjectsGeneratorsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/generators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33064,8 +32957,7 @@ func (c *ProjectsKnowledgeBasesCreateCall) Header() http.Header { func (c *ProjectsKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1knowledgebase) if err != nil { return nil, err } @@ -33174,12 +33066,11 @@ func (c *ProjectsKnowledgeBasesDeleteCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33285,12 +33176,11 @@ func (c *ProjectsKnowledgeBasesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33428,12 +33318,11 @@ func (c *ProjectsKnowledgeBasesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33560,8 +33449,7 @@ func (c *ProjectsKnowledgeBasesPatchCall) Header() http.Header { func (c *ProjectsKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1knowledgebase) if err != nil { return nil, err } @@ -33677,8 +33565,7 @@ func (c *ProjectsKnowledgeBasesDocumentsCreateCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1document) if err != nil { return nil, err } @@ -33785,12 +33672,11 @@ func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33896,12 +33782,11 @@ func (c *ProjectsKnowledgeBasesDocumentsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34000,8 +33885,7 @@ func (c *ProjectsKnowledgeBasesDocumentsImportCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1importdocumentsrequest) if err != nil { return nil, err } @@ -34144,12 +34028,11 @@ func (c *ProjectsKnowledgeBasesDocumentsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34279,8 +34162,7 @@ func (c *ProjectsKnowledgeBasesDocumentsPatchCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1document) if err != nil { return nil, err } @@ -34394,8 +34276,7 @@ func (c *ProjectsKnowledgeBasesDocumentsReloadCall) Header() http.Header { func (c *ProjectsKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1reloaddocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1reloaddocumentrequest) if err != nil { return nil, err } @@ -34495,12 +34376,11 @@ func (c *ProjectsLocationsDeleteAgentCall) Header() http.Header { func (c *ProjectsLocationsDeleteAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34603,12 +34483,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34712,12 +34591,11 @@ func (c *ProjectsLocationsGetAgentCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34820,12 +34698,11 @@ func (c *ProjectsLocationsGetEncryptionSpecCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34952,12 +34829,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35081,8 +34957,7 @@ func (c *ProjectsLocationsSetAgentCall) Header() http.Header { func (c *ProjectsLocationsSetAgentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1agent) if err != nil { return nil, err } @@ -35190,8 +35065,7 @@ func (c *ProjectsLocationsAgentExportCall) Header() http.Header { func (c *ProjectsLocationsAgentExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1exportagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1exportagentrequest) if err != nil { return nil, err } @@ -35303,12 +35177,11 @@ func (c *ProjectsLocationsAgentGetFulfillmentCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35424,12 +35297,11 @@ func (c *ProjectsLocationsAgentGetValidationResultCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent/validationResult") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35540,8 +35412,7 @@ func (c *ProjectsLocationsAgentImportCall) Header() http.Header { func (c *ProjectsLocationsAgentImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1importagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1importagentrequest) if err != nil { return nil, err } @@ -35659,8 +35530,7 @@ func (c *ProjectsLocationsAgentRestoreCall) Header() http.Header { func (c *ProjectsLocationsAgentRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1restoreagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1restoreagentrequest) if err != nil { return nil, err } @@ -35791,12 +35661,11 @@ func (c *ProjectsLocationsAgentSearchCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35920,8 +35789,7 @@ func (c *ProjectsLocationsAgentTrainCall) Header() http.Header { func (c *ProjectsLocationsAgentTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1trainagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1trainagentrequest) if err != nil { return nil, err } @@ -36032,8 +35900,7 @@ func (c *ProjectsLocationsAgentUpdateFulfillmentCall) Header() http.Header { func (c *ProjectsLocationsAgentUpdateFulfillmentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1fulfillment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1fulfillment) if err != nil { return nil, err } @@ -36145,8 +36012,7 @@ func (c *ProjectsLocationsAgentEntityTypesBatchDeleteCall) Header() http.Header func (c *ProjectsLocationsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest) if err != nil { return nil, err } @@ -36256,8 +36122,7 @@ func (c *ProjectsLocationsAgentEntityTypesBatchUpdateCall) Header() http.Header func (c *ProjectsLocationsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchupdateentitytypesrequest) if err != nil { return nil, err } @@ -36371,8 +36236,7 @@ func (c *ProjectsLocationsAgentEntityTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1entitytype) if err != nil { return nil, err } @@ -36474,12 +36338,11 @@ func (c *ProjectsLocationsAgentEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36593,12 +36456,11 @@ func (c *ProjectsLocationsAgentEntityTypesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36726,12 +36588,11 @@ func (c *ProjectsLocationsAgentEntityTypesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36867,8 +36728,7 @@ func (c *ProjectsLocationsAgentEntityTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1entitytype) if err != nil { return nil, err } @@ -36981,8 +36841,7 @@ func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchCreateCall) Header() http func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchcreateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchcreateentitiesrequest) if err != nil { return nil, err } @@ -37095,8 +36954,7 @@ func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchDeleteCall) Header() http func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchdeleteentitiesrequest) if err != nil { return nil, err } @@ -37210,8 +37068,7 @@ func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchUpdateCall) Header() http func (c *ProjectsLocationsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchupdateentitiesrequest) if err != nil { return nil, err } @@ -37320,8 +37177,7 @@ func (c *ProjectsLocationsAgentEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1environment) if err != nil { return nil, err } @@ -37422,12 +37278,11 @@ func (c *ProjectsLocationsAgentEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37532,12 +37387,11 @@ func (c *ProjectsLocationsAgentEnvironmentsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37656,12 +37510,11 @@ func (c *ProjectsLocationsAgentEnvironmentsGetHistoryCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37800,12 +37653,11 @@ func (c *ProjectsLocationsAgentEnvironmentsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37948,8 +37800,7 @@ func (c *ProjectsLocationsAgentEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1environment) if err != nil { return nil, err } @@ -38103,12 +37954,11 @@ func (c *ProjectsLocationsAgentEnvironmentsIntentsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38227,12 +38077,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDeleteContextsCall) Head func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38348,8 +38197,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDetectIntentCall) Header func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1detectintentrequest) if err != nil { return nil, err } @@ -38457,8 +38305,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsCreateCall) Head func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -38564,12 +38411,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsDeleteCall) Head func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38679,12 +38525,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38807,12 +38652,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38944,8 +38788,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsPatchCall) Heade func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -39056,8 +38899,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) H func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -39165,12 +39007,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) H func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39282,12 +39123,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39414,12 +39254,11 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39551,8 +39390,7 @@ func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) He func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -39664,8 +39502,7 @@ func (c *ProjectsLocationsAgentIntentsBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchdeleteintentsrequest) if err != nil { return nil, err } @@ -39775,8 +39612,7 @@ func (c *ProjectsLocationsAgentIntentsBatchUpdateCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchupdateintentsrequest) if err != nil { return nil, err } @@ -39905,8 +39741,7 @@ func (c *ProjectsLocationsAgentIntentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1intent) if err != nil { return nil, err } @@ -40010,12 +39845,11 @@ func (c *ProjectsLocationsAgentIntentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40144,12 +39978,11 @@ func (c *ProjectsLocationsAgentIntentsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40295,12 +40128,11 @@ func (c *ProjectsLocationsAgentIntentsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40451,8 +40283,7 @@ func (c *ProjectsLocationsAgentIntentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1intent) if err != nil { return nil, err } @@ -40558,12 +40389,11 @@ func (c *ProjectsLocationsAgentSessionsDeleteContextsCall) Header() http.Header func (c *ProjectsLocationsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40679,8 +40509,7 @@ func (c *ProjectsLocationsAgentSessionsDetectIntentCall) Header() http.Header { func (c *ProjectsLocationsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1detectintentrequest) if err != nil { return nil, err } @@ -40788,8 +40617,7 @@ func (c *ProjectsLocationsAgentSessionsContextsCreateCall) Header() http.Header func (c *ProjectsLocationsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -40895,12 +40723,11 @@ func (c *ProjectsLocationsAgentSessionsContextsDeleteCall) Header() http.Header func (c *ProjectsLocationsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41010,12 +40837,11 @@ func (c *ProjectsLocationsAgentSessionsContextsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41138,12 +40964,11 @@ func (c *ProjectsLocationsAgentSessionsContextsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41275,8 +41100,7 @@ func (c *ProjectsLocationsAgentSessionsContextsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1context) if err != nil { return nil, err } @@ -41387,8 +41211,7 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesCreateCall) Header() http.Head func (c *ProjectsLocationsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -41496,12 +41319,11 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesDeleteCall) Header() http.Head func (c *ProjectsLocationsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41613,12 +41435,11 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41745,12 +41566,11 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41882,8 +41702,7 @@ func (c *ProjectsLocationsAgentSessionsEntityTypesPatchCall) Header() http.Heade func (c *ProjectsLocationsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1sessionentitytype) if err != nil { return nil, err } @@ -41986,8 +41805,7 @@ func (c *ProjectsLocationsAgentVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1version) if err != nil { return nil, err } @@ -42087,12 +41905,11 @@ func (c *ProjectsLocationsAgentVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42196,12 +42013,11 @@ func (c *ProjectsLocationsAgentVersionsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42319,12 +42135,11 @@ func (c *ProjectsLocationsAgentVersionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42449,8 +42264,7 @@ func (c *ProjectsLocationsAgentVersionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1version) if err != nil { return nil, err } @@ -42562,12 +42376,11 @@ func (c *ProjectsLocationsAnswerRecordsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42696,12 +42509,11 @@ func (c *ProjectsLocationsAnswerRecordsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/answerRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42824,8 +42636,7 @@ func (c *ProjectsLocationsAnswerRecordsPatchCall) Header() http.Header { func (c *ProjectsLocationsAnswerRecordsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1answerrecord) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1answerrecord) if err != nil { return nil, err } @@ -42934,8 +42745,7 @@ func (c *ProjectsLocationsConversationProfilesClearSuggestionFeatureConfigCall) func (c *ProjectsLocationsConversationProfilesClearSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1clearsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1clearsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -43040,8 +42850,7 @@ func (c *ProjectsLocationsConversationProfilesCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1conversationprofile) if err != nil { return nil, err } @@ -43141,12 +42950,11 @@ func (c *ProjectsLocationsConversationProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsConversationProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43250,12 +43058,11 @@ func (c *ProjectsLocationsConversationProfilesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43374,12 +43181,11 @@ func (c *ProjectsLocationsConversationProfilesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/conversationProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43504,8 +43310,7 @@ func (c *ProjectsLocationsConversationProfilesPatchCall) Header() http.Header { func (c *ProjectsLocationsConversationProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1conversationprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1conversationprofile) if err != nil { return nil, err } @@ -43619,8 +43424,7 @@ func (c *ProjectsLocationsConversationProfilesSetSuggestionFeatureConfigCall) He func (c *ProjectsLocationsConversationProfilesSetSuggestionFeatureConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1setsuggestionfeatureconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1setsuggestionfeatureconfigrequest) if err != nil { return nil, err } @@ -43723,8 +43527,7 @@ func (c *ProjectsLocationsConversationsCompleteCall) Header() http.Header { func (c *ProjectsLocationsConversationsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1completeconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1completeconversationrequest) if err != nil { return nil, err } @@ -43849,8 +43652,7 @@ func (c *ProjectsLocationsConversationsCreateCall) Header() http.Header { func (c *ProjectsLocationsConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1conversation) if err != nil { return nil, err } @@ -43962,12 +43764,11 @@ func (c *ProjectsLocationsConversationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44095,12 +43896,11 @@ func (c *ProjectsLocationsConversationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44216,8 +44016,7 @@ func (c *ProjectsLocationsConversationsMessagesBatchCreateCall) Header() http.He func (c *ProjectsLocationsConversationsMessagesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchcreatemessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1batchcreatemessagesrequest) if err != nil { return nil, err } @@ -44357,12 +44156,11 @@ func (c *ProjectsLocationsConversationsMessagesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44481,8 +44279,7 @@ func (c *ProjectsLocationsConversationsParticipantsAnalyzeContentCall) Header() func (c *ProjectsLocationsConversationsParticipantsAnalyzeContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1analyzecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1analyzecontentrequest) if err != nil { return nil, err } @@ -44584,8 +44381,7 @@ func (c *ProjectsLocationsConversationsParticipantsCreateCall) Header() http.Hea func (c *ProjectsLocationsConversationsParticipantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1participant) if err != nil { return nil, err } @@ -44697,12 +44493,11 @@ func (c *ProjectsLocationsConversationsParticipantsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44820,12 +44615,11 @@ func (c *ProjectsLocationsConversationsParticipantsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/participants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44947,8 +44741,7 @@ func (c *ProjectsLocationsConversationsParticipantsPatchCall) Header() http.Head func (c *ProjectsLocationsConversationsParticipantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1participant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1participant) if err != nil { return nil, err } @@ -45053,8 +44846,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestArticlesCal func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestArticlesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestarticlesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestarticlesrequest) if err != nil { return nil, err } @@ -45157,8 +44949,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestFaqAnswersC func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestFaqAnswersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestfaqanswersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestfaqanswersrequest) if err != nil { return nil, err } @@ -45261,8 +45052,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestKnowledgeAs func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestKnowledgeAssistCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestknowledgeassistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestknowledgeassistrequest) if err != nil { return nil, err } @@ -45365,8 +45155,7 @@ func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestSmartReplie func (c *ProjectsLocationsConversationsParticipantsSuggestionsSuggestSmartRepliesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestsmartrepliesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestsmartrepliesrequest) if err != nil { return nil, err } @@ -45470,8 +45259,7 @@ func (c *ProjectsLocationsConversationsSuggestionsSearchKnowledgeCall) Header() func (c *ProjectsLocationsConversationsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1searchknowledgerequest) if err != nil { return nil, err } @@ -45575,8 +45363,7 @@ func (c *ProjectsLocationsConversationsSuggestionsSuggestConversationSummaryCall func (c *ProjectsLocationsConversationsSuggestionsSuggestConversationSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1suggestconversationsummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1suggestconversationsummaryrequest) if err != nil { return nil, err } @@ -45682,8 +45469,7 @@ func (c *ProjectsLocationsEncryptionSpecInitializeCall) Header() http.Header { func (c *ProjectsLocationsEncryptionSpecInitializeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1initializeencryptionspecrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1initializeencryptionspecrequest) if err != nil { return nil, err } @@ -45798,8 +45584,7 @@ func (c *ProjectsLocationsGeneratorsCreateCall) Header() http.Header { func (c *ProjectsLocationsGeneratorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1generator) if err != nil { return nil, err } @@ -45899,12 +45684,11 @@ func (c *ProjectsLocationsGeneratorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGeneratorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46008,12 +45792,11 @@ func (c *ProjectsLocationsGeneratorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46131,12 +45914,11 @@ func (c *ProjectsLocationsGeneratorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/generators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46258,8 +46040,7 @@ func (c *ProjectsLocationsGeneratorsPatchCall) Header() http.Header { func (c *ProjectsLocationsGeneratorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1generator) if err != nil { return nil, err } @@ -46362,8 +46143,7 @@ func (c *ProjectsLocationsKnowledgeBasesCreateCall) Header() http.Header { func (c *ProjectsLocationsKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1knowledgebase) if err != nil { return nil, err } @@ -46472,12 +46252,11 @@ func (c *ProjectsLocationsKnowledgeBasesDeleteCall) Header() http.Header { func (c *ProjectsLocationsKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46583,12 +46362,11 @@ func (c *ProjectsLocationsKnowledgeBasesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46726,12 +46504,11 @@ func (c *ProjectsLocationsKnowledgeBasesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46858,8 +46635,7 @@ func (c *ProjectsLocationsKnowledgeBasesPatchCall) Header() http.Header { func (c *ProjectsLocationsKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1knowledgebase) if err != nil { return nil, err } @@ -46975,8 +46751,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsCreateCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1document) if err != nil { return nil, err } @@ -47083,12 +46858,11 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsDeleteCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -47194,12 +46968,11 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47298,8 +47071,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsImportCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1importdocumentsrequest) if err != nil { return nil, err } @@ -47442,12 +47214,11 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47577,8 +47348,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsPatchCall) Header() http.Header func (c *ProjectsLocationsKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1document) if err != nil { return nil, err } @@ -47692,8 +47462,7 @@ func (c *ProjectsLocationsKnowledgeBasesDocumentsReloadCall) Header() http.Heade func (c *ProjectsLocationsKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1reloaddocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1reloaddocumentrequest) if err != nil { return nil, err } @@ -47800,12 +47569,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -47910,12 +47678,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48039,12 +47806,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48159,8 +47925,7 @@ func (c *ProjectsLocationsSipTrunksCreateCall) Header() http.Header { func (c *ProjectsLocationsSipTrunksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1siptrunk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1siptrunk) if err != nil { return nil, err } @@ -48260,12 +48025,11 @@ func (c *ProjectsLocationsSipTrunksDeleteCall) Header() http.Header { func (c *ProjectsLocationsSipTrunksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48369,12 +48133,11 @@ func (c *ProjectsLocationsSipTrunksGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48492,12 +48255,11 @@ func (c *ProjectsLocationsSipTrunksListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/sipTrunks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48620,8 +48382,7 @@ func (c *ProjectsLocationsSipTrunksPatchCall) Header() http.Header { func (c *ProjectsLocationsSipTrunksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1siptrunk) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1siptrunk) if err != nil { return nil, err } @@ -48724,8 +48485,7 @@ func (c *ProjectsLocationsStatelessSuggestionGenerateCall) Header() http.Header func (c *ProjectsLocationsStatelessSuggestionGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1generatestatelesssuggestionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1generatestatelesssuggestionrequest) if err != nil { return nil, err } @@ -48828,8 +48588,7 @@ func (c *ProjectsLocationsSuggestionsGenerateStatelessSummaryCall) Header() http func (c *ProjectsLocationsSuggestionsGenerateStatelessSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1generatestatelesssummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1generatestatelesssummaryrequest) if err != nil { return nil, err } @@ -48932,8 +48691,7 @@ func (c *ProjectsLocationsSuggestionsSearchKnowledgeCall) Header() http.Header { func (c *ProjectsLocationsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1searchknowledgerequest) if err != nil { return nil, err } @@ -49040,12 +48798,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -49150,12 +48907,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49279,12 +49035,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49400,8 +49155,7 @@ func (c *ProjectsSuggestionsGenerateStatelessSummaryCall) Header() http.Header { func (c *ProjectsSuggestionsGenerateStatelessSummaryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1generatestatelesssummaryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1generatestatelesssummaryrequest) if err != nil { return nil, err } @@ -49504,8 +49258,7 @@ func (c *ProjectsSuggestionsSearchKnowledgeCall) Header() http.Header { func (c *ProjectsSuggestionsSearchKnowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1searchknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowv2beta1searchknowledgerequest) if err != nil { return nil, err } diff --git a/dialogflow/v3/dialogflow-gen.go b/dialogflow/v3/dialogflow-gen.go index 475316ad923..d42b403b1bd 100644 --- a/dialogflow/v3/dialogflow-gen.go +++ b/dialogflow/v3/dialogflow-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -19158,12 +19157,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19290,12 +19288,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19412,8 +19409,7 @@ func (c *ProjectsLocationsAgentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3agent) if err != nil { return nil, err } @@ -19513,12 +19509,11 @@ func (c *ProjectsLocationsAgentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19618,8 +19613,7 @@ func (c *ProjectsLocationsAgentsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3exportagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3exportagentrequest) if err != nil { return nil, err } @@ -19730,12 +19724,11 @@ func (c *ProjectsLocationsAgentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19845,12 +19838,11 @@ func (c *ProjectsLocationsAgentsGetGenerativeSettingsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19962,12 +19954,11 @@ func (c *ProjectsLocationsAgentsGetValidationResultCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20085,12 +20076,11 @@ func (c *ProjectsLocationsAgentsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/agents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20216,8 +20206,7 @@ func (c *ProjectsLocationsAgentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3agent) if err != nil { return nil, err } @@ -20331,8 +20320,7 @@ func (c *ProjectsLocationsAgentsRestoreCall) Header() http.Header { func (c *ProjectsLocationsAgentsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3restoreagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3restoreagentrequest) if err != nil { return nil, err } @@ -20441,8 +20429,7 @@ func (c *ProjectsLocationsAgentsUpdateGenerativeSettingsCall) Header() http.Head func (c *ProjectsLocationsAgentsUpdateGenerativeSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3generativesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3generativesettings) if err != nil { return nil, err } @@ -20545,8 +20532,7 @@ func (c *ProjectsLocationsAgentsValidateCall) Header() http.Header { func (c *ProjectsLocationsAgentsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3validateagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3validateagentrequest) if err != nil { return nil, err } @@ -20658,12 +20644,11 @@ func (c *ProjectsLocationsAgentsChangelogsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20797,12 +20782,11 @@ func (c *ProjectsLocationsAgentsChangelogsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/changelogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20932,8 +20916,7 @@ func (c *ProjectsLocationsAgentsEntityTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3entitytype) if err != nil { return nil, err } @@ -21047,12 +21030,11 @@ func (c *ProjectsLocationsAgentsEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21146,8 +21128,7 @@ func (c *ProjectsLocationsAgentsEntityTypesExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3exportentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3exportentitytypesrequest) if err != nil { return nil, err } @@ -21272,12 +21253,11 @@ func (c *ProjectsLocationsAgentsEntityTypesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21371,8 +21351,7 @@ func (c *ProjectsLocationsAgentsEntityTypesImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3importentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3importentitytypesrequest) if err != nil { return nil, err } @@ -21511,12 +21490,11 @@ func (c *ProjectsLocationsAgentsEntityTypesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21653,8 +21631,7 @@ func (c *ProjectsLocationsAgentsEntityTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3entitytype) if err != nil { return nil, err } @@ -21762,8 +21739,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3environment) if err != nil { return nil, err } @@ -21863,12 +21839,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21966,8 +21941,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeployFlowCall) Header() http.Header func (c *ProjectsLocationsAgentsEnvironmentsDeployFlowCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3deployflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3deployflowrequest) if err != nil { return nil, err } @@ -22079,12 +22053,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22202,12 +22175,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22346,12 +22318,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsLookupEnvironmentHistoryCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:lookupEnvironmentHistory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22479,8 +22450,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3environment) if err != nil { return nil, err } @@ -22586,8 +22556,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsRunContinuousTestCall) Header() http func (c *ProjectsLocationsAgentsEnvironmentsRunContinuousTestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3runcontinuoustestrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3runcontinuoustestrequest) if err != nil { return nil, err } @@ -22713,12 +22682,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsContinuousTestResultsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/continuousTestResults") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22843,12 +22811,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeploymentsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22966,12 +22933,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeploymentsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23086,8 +23052,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsCreateCall) Header() http func (c *ProjectsLocationsAgentsEnvironmentsExperimentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3experiment) if err != nil { return nil, err } @@ -23187,12 +23152,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsDeleteCall) Header() http func (c *ProjectsLocationsAgentsEnvironmentsExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23296,12 +23260,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23419,12 +23382,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/experiments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23546,8 +23508,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsPatchCall) Header() http. func (c *ProjectsLocationsAgentsEnvironmentsExperimentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3experiment) if err != nil { return nil, err } @@ -23650,8 +23611,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStartCall) Header() http. func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3startexperimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3startexperimentrequest) if err != nil { return nil, err } @@ -23754,8 +23714,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStopCall) Header() http.H func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3stopexperimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3stopexperimentrequest) if err != nil { return nil, err } @@ -23872,8 +23831,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsDetectIntentCall) Header() h func (c *ProjectsLocationsAgentsEnvironmentsSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3detectintentrequest) if err != nil { return nil, err } @@ -23984,8 +23942,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsFulfillIntentCall) Header() func (c *ProjectsLocationsAgentsEnvironmentsSessionsFulfillIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3fulfillintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3fulfillintentrequest) if err != nil { return nil, err } @@ -24095,8 +24052,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsMatchIntentCall) Header() ht func (c *ProjectsLocationsAgentsEnvironmentsSessionsMatchIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3matchintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3matchintentrequest) if err != nil { return nil, err } @@ -24212,8 +24168,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsServerStreamingDetectIntentC func (c *ProjectsLocationsAgentsEnvironmentsSessionsServerStreamingDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3detectintentrequest) if err != nil { return nil, err } @@ -24317,8 +24272,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesCreateCall) Heade func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3sessionentitytype) if err != nil { return nil, err } @@ -24420,12 +24374,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesDeleteCall) Heade func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24531,12 +24484,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24656,12 +24608,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24785,8 +24736,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesPatchCall) Header func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3sessionentitytype) if err != nil { return nil, err } @@ -24905,8 +24855,7 @@ func (c *ProjectsLocationsAgentsFlowsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3flow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3flow) if err != nil { return nil, err } @@ -25018,12 +24967,11 @@ func (c *ProjectsLocationsAgentsFlowsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25124,8 +25072,7 @@ func (c *ProjectsLocationsAgentsFlowsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3exportflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3exportflowrequest) if err != nil { return nil, err } @@ -25252,12 +25199,11 @@ func (c *ProjectsLocationsAgentsFlowsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25369,12 +25315,11 @@ func (c *ProjectsLocationsAgentsFlowsGetValidationResultCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25476,8 +25421,7 @@ func (c *ProjectsLocationsAgentsFlowsImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3importflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3importflowrequest) if err != nil { return nil, err } @@ -25618,12 +25562,11 @@ func (c *ProjectsLocationsAgentsFlowsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/flows") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25763,8 +25706,7 @@ func (c *ProjectsLocationsAgentsFlowsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3flow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3flow) if err != nil { return nil, err } @@ -25875,8 +25817,7 @@ func (c *ProjectsLocationsAgentsFlowsTrainCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3trainflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3trainflowrequest) if err != nil { return nil, err } @@ -25979,8 +25920,7 @@ func (c *ProjectsLocationsAgentsFlowsValidateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3validateflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3validateflowrequest) if err != nil { return nil, err } @@ -26105,8 +26045,7 @@ func (c *ProjectsLocationsAgentsFlowsPagesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3page) if err != nil { return nil, err } @@ -26220,12 +26159,11 @@ func (c *ProjectsLocationsAgentsFlowsPagesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26351,12 +26289,11 @@ func (c *ProjectsLocationsAgentsFlowsPagesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26496,12 +26433,11 @@ func (c *ProjectsLocationsAgentsFlowsPagesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26648,8 +26584,7 @@ func (c *ProjectsLocationsAgentsFlowsPagesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3page) if err != nil { return nil, err } @@ -26768,8 +26703,7 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsCreateCall) Header() h func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3transitionroutegroup) if err != nil { return nil, err } @@ -26883,12 +26817,11 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsDeleteCall) Header() h func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27007,12 +26940,11 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27144,12 +27076,11 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/transitionRouteGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27288,8 +27219,7 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsPatchCall) Header() ht func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3transitionroutegroup) if err != nil { return nil, err } @@ -27392,8 +27322,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsCompareVersionsCall) Header() http. func (c *ProjectsLocationsAgentsFlowsVersionsCompareVersionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3compareversionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3compareversionsrequest) if err != nil { return nil, err } @@ -27499,8 +27428,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3version) if err != nil { return nil, err } @@ -27600,12 +27528,11 @@ func (c *ProjectsLocationsAgentsFlowsVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27709,12 +27636,11 @@ func (c *ProjectsLocationsAgentsFlowsVersionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27832,12 +27758,11 @@ func (c *ProjectsLocationsAgentsFlowsVersionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27959,8 +27884,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsLoadCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsLoadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3loadversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3loadversionrequest) if err != nil { return nil, err } @@ -28070,8 +27994,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3version) if err != nil { return nil, err } @@ -28181,8 +28104,7 @@ func (c *ProjectsLocationsAgentsGeneratorsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsGeneratorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3generator) if err != nil { return nil, err } @@ -28293,12 +28215,11 @@ func (c *ProjectsLocationsAgentsGeneratorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsGeneratorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28409,12 +28330,11 @@ func (c *ProjectsLocationsAgentsGeneratorsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28539,12 +28459,11 @@ func (c *ProjectsLocationsAgentsGeneratorsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/generators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28675,8 +28594,7 @@ func (c *ProjectsLocationsAgentsGeneratorsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsGeneratorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3generator) if err != nil { return nil, err } @@ -28791,8 +28709,7 @@ func (c *ProjectsLocationsAgentsIntentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3intent) if err != nil { return nil, err } @@ -28894,12 +28811,11 @@ func (c *ProjectsLocationsAgentsIntentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28997,8 +28913,7 @@ func (c *ProjectsLocationsAgentsIntentsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3exportintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3exportintentsrequest) if err != nil { return nil, err } @@ -29122,12 +29037,11 @@ func (c *ProjectsLocationsAgentsIntentsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29225,8 +29139,7 @@ func (c *ProjectsLocationsAgentsIntentsImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3importintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3importintentsrequest) if err != nil { return nil, err } @@ -29380,12 +29293,11 @@ func (c *ProjectsLocationsAgentsIntentsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29522,8 +29434,7 @@ func (c *ProjectsLocationsAgentsIntentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3intent) if err != nil { return nil, err } @@ -29640,8 +29551,7 @@ func (c *ProjectsLocationsAgentsSessionsDetectIntentCall) Header() http.Header { func (c *ProjectsLocationsAgentsSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3detectintentrequest) if err != nil { return nil, err } @@ -29752,8 +29662,7 @@ func (c *ProjectsLocationsAgentsSessionsFulfillIntentCall) Header() http.Header func (c *ProjectsLocationsAgentsSessionsFulfillIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3fulfillintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3fulfillintentrequest) if err != nil { return nil, err } @@ -29863,8 +29772,7 @@ func (c *ProjectsLocationsAgentsSessionsMatchIntentCall) Header() http.Header { func (c *ProjectsLocationsAgentsSessionsMatchIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3matchintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3matchintentrequest) if err != nil { return nil, err } @@ -29980,8 +29888,7 @@ func (c *ProjectsLocationsAgentsSessionsServerStreamingDetectIntentCall) Header( func (c *ProjectsLocationsAgentsSessionsServerStreamingDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3detectintentrequest) if err != nil { return nil, err } @@ -30083,8 +29990,7 @@ func (c *ProjectsLocationsAgentsSessionsSubmitAnswerFeedbackCall) Header() http. func (c *ProjectsLocationsAgentsSessionsSubmitAnswerFeedbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3submitanswerfeedbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3submitanswerfeedbackrequest) if err != nil { return nil, err } @@ -30188,8 +30094,7 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesCreateCall) Header() http.Hea func (c *ProjectsLocationsAgentsSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3sessionentitytype) if err != nil { return nil, err } @@ -30291,12 +30196,11 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesDeleteCall) Header() http.Hea func (c *ProjectsLocationsAgentsSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30402,12 +30306,11 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30527,12 +30430,11 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30656,8 +30558,7 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesPatchCall) Header() http.Head func (c *ProjectsLocationsAgentsSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3sessionentitytype) if err != nil { return nil, err } @@ -30759,8 +30660,7 @@ func (c *ProjectsLocationsAgentsTestCasesBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3batchdeletetestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3batchdeletetestcasesrequest) if err != nil { return nil, err } @@ -30866,8 +30766,7 @@ func (c *ProjectsLocationsAgentsTestCasesBatchRunCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesBatchRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3batchruntestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3batchruntestcasesrequest) if err != nil { return nil, err } @@ -30993,12 +30892,11 @@ func (c *ProjectsLocationsAgentsTestCasesCalculateCoverageCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+agent}/testCases:calculateCoverage") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31092,8 +30990,7 @@ func (c *ProjectsLocationsAgentsTestCasesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3testcase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3testcase) if err != nil { return nil, err } @@ -31200,8 +31097,7 @@ func (c *ProjectsLocationsAgentsTestCasesExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3exporttestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3exporttestcasesrequest) if err != nil { return nil, err } @@ -31313,12 +31209,11 @@ func (c *ProjectsLocationsAgentsTestCasesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31418,8 +31313,7 @@ func (c *ProjectsLocationsAgentsTestCasesImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3importtestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3importtestcasesrequest) if err != nil { return nil, err } @@ -31566,12 +31460,11 @@ func (c *ProjectsLocationsAgentsTestCasesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/testCases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31695,8 +31588,7 @@ func (c *ProjectsLocationsAgentsTestCasesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3testcase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3testcase) if err != nil { return nil, err } @@ -31801,8 +31693,7 @@ func (c *ProjectsLocationsAgentsTestCasesRunCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3runtestcaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3runtestcaserequest) if err != nil { return nil, err } @@ -31914,12 +31805,11 @@ func (c *ProjectsLocationsAgentsTestCasesResultsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32056,12 +31946,11 @@ func (c *ProjectsLocationsAgentsTestCasesResultsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32193,8 +32082,7 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsCreateCall) Header() http.H func (c *ProjectsLocationsAgentsTransitionRouteGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3transitionroutegroup) if err != nil { return nil, err } @@ -32308,12 +32196,11 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsDeleteCall) Header() http.H func (c *ProjectsLocationsAgentsTransitionRouteGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32432,12 +32319,11 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32569,12 +32455,11 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/transitionRouteGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32713,8 +32598,7 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsPatchCall) Header() http.He func (c *ProjectsLocationsAgentsTransitionRouteGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3transitionroutegroup) if err != nil { return nil, err } @@ -32816,8 +32700,7 @@ func (c *ProjectsLocationsAgentsWebhooksCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsWebhooksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3webhook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3webhook) if err != nil { return nil, err } @@ -32929,12 +32812,11 @@ func (c *ProjectsLocationsAgentsWebhooksDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsWebhooksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33038,12 +32920,11 @@ func (c *ProjectsLocationsAgentsWebhooksGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33161,12 +33042,11 @@ func (c *ProjectsLocationsAgentsWebhooksListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/webhooks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33290,8 +33170,7 @@ func (c *ProjectsLocationsAgentsWebhooksPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsWebhooksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3webhook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3webhook) if err != nil { return nil, err } @@ -33398,12 +33277,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -33508,12 +33386,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33637,12 +33514,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33757,8 +33633,7 @@ func (c *ProjectsLocationsSecuritySettingsCreateCall) Header() http.Header { func (c *ProjectsLocationsSecuritySettingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3securitysettings) if err != nil { return nil, err } @@ -33858,12 +33733,11 @@ func (c *ProjectsLocationsSecuritySettingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSecuritySettingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33968,12 +33842,11 @@ func (c *ProjectsLocationsSecuritySettingsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34091,12 +33964,11 @@ func (c *ProjectsLocationsSecuritySettingsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/securitySettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34221,8 +34093,7 @@ func (c *ProjectsLocationsSecuritySettingsPatchCall) Header() http.Header { func (c *ProjectsLocationsSecuritySettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3securitysettings) if err != nil { return nil, err } @@ -34329,12 +34200,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -34439,12 +34309,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34568,12 +34437,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/dialogflow/v3beta1/dialogflow-gen.go b/dialogflow/v3beta1/dialogflow-gen.go index 51b3a55184d..456024ac416 100644 --- a/dialogflow/v3beta1/dialogflow-gen.go +++ b/dialogflow/v3beta1/dialogflow-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -20849,12 +20848,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20981,12 +20979,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21103,8 +21100,7 @@ func (c *ProjectsLocationsAgentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1agent) if err != nil { return nil, err } @@ -21204,12 +21200,11 @@ func (c *ProjectsLocationsAgentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21309,8 +21304,7 @@ func (c *ProjectsLocationsAgentsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1exportagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1exportagentrequest) if err != nil { return nil, err } @@ -21421,12 +21415,11 @@ func (c *ProjectsLocationsAgentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21536,12 +21529,11 @@ func (c *ProjectsLocationsAgentsGetGenerativeSettingsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21653,12 +21645,11 @@ func (c *ProjectsLocationsAgentsGetValidationResultCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21776,12 +21767,11 @@ func (c *ProjectsLocationsAgentsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/agents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21907,8 +21897,7 @@ func (c *ProjectsLocationsAgentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1agent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1agent) if err != nil { return nil, err } @@ -22022,8 +22011,7 @@ func (c *ProjectsLocationsAgentsRestoreCall) Header() http.Header { func (c *ProjectsLocationsAgentsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1restoreagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1restoreagentrequest) if err != nil { return nil, err } @@ -22132,8 +22120,7 @@ func (c *ProjectsLocationsAgentsUpdateGenerativeSettingsCall) Header() http.Head func (c *ProjectsLocationsAgentsUpdateGenerativeSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1generativesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1generativesettings) if err != nil { return nil, err } @@ -22236,8 +22223,7 @@ func (c *ProjectsLocationsAgentsValidateCall) Header() http.Header { func (c *ProjectsLocationsAgentsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1validateagentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1validateagentrequest) if err != nil { return nil, err } @@ -22349,12 +22335,11 @@ func (c *ProjectsLocationsAgentsChangelogsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22488,12 +22473,11 @@ func (c *ProjectsLocationsAgentsChangelogsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/changelogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22606,12 +22590,11 @@ func (c *ProjectsLocationsAgentsConversationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22715,12 +22698,11 @@ func (c *ProjectsLocationsAgentsConversationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22851,12 +22833,11 @@ func (c *ProjectsLocationsAgentsConversationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22983,8 +22964,7 @@ func (c *ProjectsLocationsAgentsEntityTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1entitytype) if err != nil { return nil, err } @@ -23098,12 +23078,11 @@ func (c *ProjectsLocationsAgentsEntityTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23197,8 +23176,7 @@ func (c *ProjectsLocationsAgentsEntityTypesExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1exportentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1exportentitytypesrequest) if err != nil { return nil, err } @@ -23323,12 +23301,11 @@ func (c *ProjectsLocationsAgentsEntityTypesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23422,8 +23399,7 @@ func (c *ProjectsLocationsAgentsEntityTypesImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1importentitytypesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1importentitytypesrequest) if err != nil { return nil, err } @@ -23562,12 +23538,11 @@ func (c *ProjectsLocationsAgentsEntityTypesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23704,8 +23679,7 @@ func (c *ProjectsLocationsAgentsEntityTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1entitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1entitytype) if err != nil { return nil, err } @@ -23813,8 +23787,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1environment) if err != nil { return nil, err } @@ -23914,12 +23887,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24017,8 +23989,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeployFlowCall) Header() http.Header func (c *ProjectsLocationsAgentsEnvironmentsDeployFlowCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1deployflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1deployflowrequest) if err != nil { return nil, err } @@ -24130,12 +24101,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24253,12 +24223,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24399,12 +24368,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsLookupEnvironmentHistoryCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}:lookupEnvironmentHistory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24532,8 +24500,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1environment) if err != nil { return nil, err } @@ -24639,8 +24606,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsRunContinuousTestCall) Header() http func (c *ProjectsLocationsAgentsEnvironmentsRunContinuousTestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1runcontinuoustestrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1runcontinuoustestrequest) if err != nil { return nil, err } @@ -24766,12 +24732,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsContinuousTestResultsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/continuousTestResults") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24896,12 +24861,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeploymentsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25019,12 +24983,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsDeploymentsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25139,8 +25102,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsCreateCall) Header() http func (c *ProjectsLocationsAgentsEnvironmentsExperimentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1experiment) if err != nil { return nil, err } @@ -25240,12 +25202,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsDeleteCall) Header() http func (c *ProjectsLocationsAgentsEnvironmentsExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25349,12 +25310,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25472,12 +25432,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/experiments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25599,8 +25558,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsPatchCall) Header() http. func (c *ProjectsLocationsAgentsEnvironmentsExperimentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1experiment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1experiment) if err != nil { return nil, err } @@ -25703,8 +25661,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStartCall) Header() http. func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1startexperimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1startexperimentrequest) if err != nil { return nil, err } @@ -25807,8 +25764,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStopCall) Header() http.H func (c *ProjectsLocationsAgentsEnvironmentsExperimentsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1stopexperimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1stopexperimentrequest) if err != nil { return nil, err } @@ -25925,8 +25881,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsDetectIntentCall) Header() h func (c *ProjectsLocationsAgentsEnvironmentsSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1detectintentrequest) if err != nil { return nil, err } @@ -26037,8 +25992,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsFulfillIntentCall) Header() func (c *ProjectsLocationsAgentsEnvironmentsSessionsFulfillIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1fulfillintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1fulfillintentrequest) if err != nil { return nil, err } @@ -26148,8 +26102,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsMatchIntentCall) Header() ht func (c *ProjectsLocationsAgentsEnvironmentsSessionsMatchIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1matchintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1matchintentrequest) if err != nil { return nil, err } @@ -26265,8 +26218,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsServerStreamingDetectIntentC func (c *ProjectsLocationsAgentsEnvironmentsSessionsServerStreamingDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1detectintentrequest) if err != nil { return nil, err } @@ -26370,8 +26322,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesCreateCall) Heade func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1sessionentitytype) if err != nil { return nil, err } @@ -26473,12 +26424,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesDeleteCall) Heade func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26584,12 +26534,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26709,12 +26658,11 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26838,8 +26786,7 @@ func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesPatchCall) Header func (c *ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1sessionentitytype) if err != nil { return nil, err } @@ -26958,8 +26905,7 @@ func (c *ProjectsLocationsAgentsFlowsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1flow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1flow) if err != nil { return nil, err } @@ -27071,12 +27017,11 @@ func (c *ProjectsLocationsAgentsFlowsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27177,8 +27122,7 @@ func (c *ProjectsLocationsAgentsFlowsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1exportflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1exportflowrequest) if err != nil { return nil, err } @@ -27305,12 +27249,11 @@ func (c *ProjectsLocationsAgentsFlowsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27422,12 +27365,11 @@ func (c *ProjectsLocationsAgentsFlowsGetValidationResultCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27529,8 +27471,7 @@ func (c *ProjectsLocationsAgentsFlowsImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1importflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1importflowrequest) if err != nil { return nil, err } @@ -27671,12 +27612,11 @@ func (c *ProjectsLocationsAgentsFlowsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/flows") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27816,8 +27756,7 @@ func (c *ProjectsLocationsAgentsFlowsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1flow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1flow) if err != nil { return nil, err } @@ -27928,8 +27867,7 @@ func (c *ProjectsLocationsAgentsFlowsTrainCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1trainflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1trainflowrequest) if err != nil { return nil, err } @@ -28032,8 +27970,7 @@ func (c *ProjectsLocationsAgentsFlowsValidateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1validateflowrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1validateflowrequest) if err != nil { return nil, err } @@ -28156,8 +28093,7 @@ func (c *ProjectsLocationsAgentsFlowsPagesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1page) if err != nil { return nil, err } @@ -28269,12 +28205,11 @@ func (c *ProjectsLocationsAgentsFlowsPagesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28400,12 +28335,11 @@ func (c *ProjectsLocationsAgentsFlowsPagesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28545,12 +28479,11 @@ func (c *ProjectsLocationsAgentsFlowsPagesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28695,8 +28628,7 @@ func (c *ProjectsLocationsAgentsFlowsPagesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsPagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1page) if err != nil { return nil, err } @@ -28815,8 +28747,7 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsCreateCall) Header() h func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1transitionroutegroup) if err != nil { return nil, err } @@ -28930,12 +28861,11 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsDeleteCall) Header() h func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29054,12 +28984,11 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29191,12 +29120,11 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/transitionRouteGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29337,8 +29265,7 @@ func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsPatchCall) Header() ht func (c *ProjectsLocationsAgentsFlowsTransitionRouteGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1transitionroutegroup) if err != nil { return nil, err } @@ -29441,8 +29368,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsCompareVersionsCall) Header() http. func (c *ProjectsLocationsAgentsFlowsVersionsCompareVersionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1compareversionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1compareversionsrequest) if err != nil { return nil, err } @@ -29548,8 +29474,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1version) if err != nil { return nil, err } @@ -29649,12 +29574,11 @@ func (c *ProjectsLocationsAgentsFlowsVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29758,12 +29682,11 @@ func (c *ProjectsLocationsAgentsFlowsVersionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29881,12 +29804,11 @@ func (c *ProjectsLocationsAgentsFlowsVersionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30008,8 +29930,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsLoadCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsLoadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1loadversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1loadversionrequest) if err != nil { return nil, err } @@ -30119,8 +30040,7 @@ func (c *ProjectsLocationsAgentsFlowsVersionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsFlowsVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1version) if err != nil { return nil, err } @@ -30230,8 +30150,7 @@ func (c *ProjectsLocationsAgentsGeneratorsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsGeneratorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1generator) if err != nil { return nil, err } @@ -30342,12 +30261,11 @@ func (c *ProjectsLocationsAgentsGeneratorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsGeneratorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30458,12 +30376,11 @@ func (c *ProjectsLocationsAgentsGeneratorsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30588,12 +30505,11 @@ func (c *ProjectsLocationsAgentsGeneratorsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/generators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30724,8 +30640,7 @@ func (c *ProjectsLocationsAgentsGeneratorsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsGeneratorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1generator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1generator) if err != nil { return nil, err } @@ -30840,8 +30755,7 @@ func (c *ProjectsLocationsAgentsIntentsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1intent) if err != nil { return nil, err } @@ -30943,12 +30857,11 @@ func (c *ProjectsLocationsAgentsIntentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31046,8 +30959,7 @@ func (c *ProjectsLocationsAgentsIntentsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1exportintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1exportintentsrequest) if err != nil { return nil, err } @@ -31171,12 +31083,11 @@ func (c *ProjectsLocationsAgentsIntentsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31274,8 +31185,7 @@ func (c *ProjectsLocationsAgentsIntentsImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1importintentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1importintentsrequest) if err != nil { return nil, err } @@ -31429,12 +31339,11 @@ func (c *ProjectsLocationsAgentsIntentsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/intents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31571,8 +31480,7 @@ func (c *ProjectsLocationsAgentsIntentsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsIntentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1intent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1intent) if err != nil { return nil, err } @@ -31674,8 +31582,7 @@ func (c *ProjectsLocationsAgentsPlaybooksCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsPlaybooksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1playbook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1playbook) if err != nil { return nil, err } @@ -31775,12 +31682,11 @@ func (c *ProjectsLocationsAgentsPlaybooksDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsPlaybooksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31884,12 +31790,11 @@ func (c *ProjectsLocationsAgentsPlaybooksGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32007,12 +31912,11 @@ func (c *ProjectsLocationsAgentsPlaybooksListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/playbooks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32135,8 +32039,7 @@ func (c *ProjectsLocationsAgentsPlaybooksPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsPlaybooksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1playbook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1playbook) if err != nil { return nil, err } @@ -32238,8 +32141,7 @@ func (c *ProjectsLocationsAgentsPlaybooksExamplesCreateCall) Header() http.Heade func (c *ProjectsLocationsAgentsPlaybooksExamplesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1example) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1example) if err != nil { return nil, err } @@ -32339,12 +32241,11 @@ func (c *ProjectsLocationsAgentsPlaybooksExamplesDeleteCall) Header() http.Heade func (c *ProjectsLocationsAgentsPlaybooksExamplesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32448,12 +32349,11 @@ func (c *ProjectsLocationsAgentsPlaybooksExamplesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32579,12 +32479,11 @@ func (c *ProjectsLocationsAgentsPlaybooksExamplesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/examples") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32707,8 +32606,7 @@ func (c *ProjectsLocationsAgentsPlaybooksExamplesPatchCall) Header() http.Header func (c *ProjectsLocationsAgentsPlaybooksExamplesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1example) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1example) if err != nil { return nil, err } @@ -32810,8 +32708,7 @@ func (c *ProjectsLocationsAgentsPlaybooksVersionsCreateCall) Header() http.Heade func (c *ProjectsLocationsAgentsPlaybooksVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1playbookversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1playbookversion) if err != nil { return nil, err } @@ -32911,12 +32808,11 @@ func (c *ProjectsLocationsAgentsPlaybooksVersionsDeleteCall) Header() http.Heade func (c *ProjectsLocationsAgentsPlaybooksVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33020,12 +32916,11 @@ func (c *ProjectsLocationsAgentsPlaybooksVersionsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33143,12 +33038,11 @@ func (c *ProjectsLocationsAgentsPlaybooksVersionsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33278,8 +33172,7 @@ func (c *ProjectsLocationsAgentsSessionsDetectIntentCall) Header() http.Header { func (c *ProjectsLocationsAgentsSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1detectintentrequest) if err != nil { return nil, err } @@ -33390,8 +33283,7 @@ func (c *ProjectsLocationsAgentsSessionsFulfillIntentCall) Header() http.Header func (c *ProjectsLocationsAgentsSessionsFulfillIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1fulfillintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1fulfillintentrequest) if err != nil { return nil, err } @@ -33501,8 +33393,7 @@ func (c *ProjectsLocationsAgentsSessionsMatchIntentCall) Header() http.Header { func (c *ProjectsLocationsAgentsSessionsMatchIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1matchintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1matchintentrequest) if err != nil { return nil, err } @@ -33618,8 +33509,7 @@ func (c *ProjectsLocationsAgentsSessionsServerStreamingDetectIntentCall) Header( func (c *ProjectsLocationsAgentsSessionsServerStreamingDetectIntentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1detectintentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1detectintentrequest) if err != nil { return nil, err } @@ -33721,8 +33611,7 @@ func (c *ProjectsLocationsAgentsSessionsSubmitAnswerFeedbackCall) Header() http. func (c *ProjectsLocationsAgentsSessionsSubmitAnswerFeedbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1submitanswerfeedbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1submitanswerfeedbackrequest) if err != nil { return nil, err } @@ -33826,8 +33715,7 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesCreateCall) Header() http.Hea func (c *ProjectsLocationsAgentsSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1sessionentitytype) if err != nil { return nil, err } @@ -33929,12 +33817,11 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesDeleteCall) Header() http.Hea func (c *ProjectsLocationsAgentsSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34040,12 +33927,11 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34165,12 +34051,11 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/entityTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34294,8 +34179,7 @@ func (c *ProjectsLocationsAgentsSessionsEntityTypesPatchCall) Header() http.Head func (c *ProjectsLocationsAgentsSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1sessionentitytype) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1sessionentitytype) if err != nil { return nil, err } @@ -34397,8 +34281,7 @@ func (c *ProjectsLocationsAgentsTestCasesBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1batchdeletetestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1batchdeletetestcasesrequest) if err != nil { return nil, err } @@ -34504,8 +34387,7 @@ func (c *ProjectsLocationsAgentsTestCasesBatchRunCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesBatchRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1batchruntestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1batchruntestcasesrequest) if err != nil { return nil, err } @@ -34631,12 +34513,11 @@ func (c *ProjectsLocationsAgentsTestCasesCalculateCoverageCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+agent}/testCases:calculateCoverage") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34730,8 +34611,7 @@ func (c *ProjectsLocationsAgentsTestCasesCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1testcase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1testcase) if err != nil { return nil, err } @@ -34838,8 +34718,7 @@ func (c *ProjectsLocationsAgentsTestCasesExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1exporttestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1exporttestcasesrequest) if err != nil { return nil, err } @@ -34951,12 +34830,11 @@ func (c *ProjectsLocationsAgentsTestCasesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35056,8 +34934,7 @@ func (c *ProjectsLocationsAgentsTestCasesImportCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1importtestcasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1importtestcasesrequest) if err != nil { return nil, err } @@ -35204,12 +35081,11 @@ func (c *ProjectsLocationsAgentsTestCasesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/testCases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35333,8 +35209,7 @@ func (c *ProjectsLocationsAgentsTestCasesPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1testcase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1testcase) if err != nil { return nil, err } @@ -35439,8 +35314,7 @@ func (c *ProjectsLocationsAgentsTestCasesRunCall) Header() http.Header { func (c *ProjectsLocationsAgentsTestCasesRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1runtestcaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1runtestcaserequest) if err != nil { return nil, err } @@ -35552,12 +35426,11 @@ func (c *ProjectsLocationsAgentsTestCasesResultsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35694,12 +35567,11 @@ func (c *ProjectsLocationsAgentsTestCasesResultsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35814,8 +35686,7 @@ func (c *ProjectsLocationsAgentsToolsCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsToolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1tool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1tool) if err != nil { return nil, err } @@ -35925,12 +35796,11 @@ func (c *ProjectsLocationsAgentsToolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsToolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36024,8 +35894,7 @@ func (c *ProjectsLocationsAgentsToolsExportCall) Header() http.Header { func (c *ProjectsLocationsAgentsToolsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1exporttoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1exporttoolsrequest) if err != nil { return nil, err } @@ -36136,12 +36005,11 @@ func (c *ProjectsLocationsAgentsToolsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36259,12 +36127,11 @@ func (c *ProjectsLocationsAgentsToolsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/tools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36387,8 +36254,7 @@ func (c *ProjectsLocationsAgentsToolsPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsToolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1tool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1tool) if err != nil { return nil, err } @@ -36507,8 +36373,7 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsCreateCall) Header() http.H func (c *ProjectsLocationsAgentsTransitionRouteGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1transitionroutegroup) if err != nil { return nil, err } @@ -36622,12 +36487,11 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsDeleteCall) Header() http.H func (c *ProjectsLocationsAgentsTransitionRouteGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36746,12 +36610,11 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36883,12 +36746,11 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/transitionRouteGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37029,8 +36891,7 @@ func (c *ProjectsLocationsAgentsTransitionRouteGroupsPatchCall) Header() http.He func (c *ProjectsLocationsAgentsTransitionRouteGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1transitionroutegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1transitionroutegroup) if err != nil { return nil, err } @@ -37132,8 +36993,7 @@ func (c *ProjectsLocationsAgentsWebhooksCreateCall) Header() http.Header { func (c *ProjectsLocationsAgentsWebhooksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1webhook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1webhook) if err != nil { return nil, err } @@ -37245,12 +37105,11 @@ func (c *ProjectsLocationsAgentsWebhooksDeleteCall) Header() http.Header { func (c *ProjectsLocationsAgentsWebhooksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37354,12 +37213,11 @@ func (c *ProjectsLocationsAgentsWebhooksGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37477,12 +37335,11 @@ func (c *ProjectsLocationsAgentsWebhooksListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/webhooks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37606,8 +37463,7 @@ func (c *ProjectsLocationsAgentsWebhooksPatchCall) Header() http.Header { func (c *ProjectsLocationsAgentsWebhooksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1webhook) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1webhook) if err != nil { return nil, err } @@ -37714,12 +37570,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -37824,12 +37679,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37953,12 +37807,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38073,8 +37926,7 @@ func (c *ProjectsLocationsSecuritySettingsCreateCall) Header() http.Header { func (c *ProjectsLocationsSecuritySettingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1securitysettings) if err != nil { return nil, err } @@ -38174,12 +38026,11 @@ func (c *ProjectsLocationsSecuritySettingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSecuritySettingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38284,12 +38135,11 @@ func (c *ProjectsLocationsSecuritySettingsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38407,12 +38257,11 @@ func (c *ProjectsLocationsSecuritySettingsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/securitySettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38537,8 +38386,7 @@ func (c *ProjectsLocationsSecuritySettingsPatchCall) Header() http.Header { func (c *ProjectsLocationsSecuritySettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowcxv3beta1securitysettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddialogflowcxv3beta1securitysettings) if err != nil { return nil, err } @@ -38645,12 +38493,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -38755,12 +38602,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38884,12 +38730,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/digitalassetlinks/v1/digitalassetlinks-gen.go b/digitalassetlinks/v1/digitalassetlinks-gen.go index c3db3fb0883..40fa03a2192 100644 --- a/digitalassetlinks/v1/digitalassetlinks-gen.go +++ b/digitalassetlinks/v1/digitalassetlinks-gen.go @@ -103,7 +103,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Assetlinks = NewAssetlinksService(s) + s.Statements = NewStatementsService(s) if err != nil { return nil, err } @@ -122,10 +124,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Assetlinks = NewAssetlinksService(s) - s.Statements = NewStatementsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -625,12 +624,11 @@ func (c *AssetlinksCheckCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/assetlinks:check") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -801,12 +799,11 @@ func (c *StatementsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/statements:list") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/discovery/v1/discovery-gen.go b/discovery/v1/discovery-gen.go index de1adc454c6..539b48f0f47 100644 --- a/discovery/v1/discovery-gen.go +++ b/discovery/v1/discovery-gen.go @@ -101,7 +101,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Apis = NewApisService(s) if err != nil { return nil, err } @@ -120,9 +121,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Apis = NewApisService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -900,12 +899,11 @@ func (c *ApisGetRestCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/{api}/{version}/rest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1019,12 +1017,11 @@ func (c *ApisListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/discoveryengine/v1/discoveryengine-gen.go b/discoveryengine/v1/discoveryengine-gen.go index c95b45072df..4c0436a43d2 100644 --- a/discoveryengine/v1/discoveryengine-gen.go +++ b/discoveryengine/v1/discoveryengine-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -20277,8 +20276,7 @@ func (c *ProjectsProvisionCall) Header() http.Header { func (c *ProjectsProvisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1provisionprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1provisionprojectrequest) if err != nil { return nil, err } @@ -20391,12 +20389,11 @@ func (c *ProjectsLocationsCollectionsDataConnectorOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20520,12 +20517,11 @@ func (c *ProjectsLocationsCollectionsDataConnectorOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20700,12 +20696,11 @@ func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20848,8 +20843,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCreateCall) Header() http.Header func (c *ProjectsLocationsCollectionsDataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1datastore) if err != nil { return nil, err } @@ -20953,12 +20947,11 @@ func (c *ProjectsLocationsCollectionsDataStoresDeleteCall) Header() http.Header func (c *ProjectsLocationsCollectionsDataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21066,12 +21059,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21178,12 +21170,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetSiteSearchEngineCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21317,12 +21308,11 @@ func (c *ProjectsLocationsCollectionsDataStoresListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21447,8 +21437,7 @@ func (c *ProjectsLocationsCollectionsDataStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectionsDataStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1datastore) if err != nil { return nil, err } @@ -21552,8 +21541,7 @@ func (c *ProjectsLocationsCollectionsDataStoresTrainCustomModelCall) Header() ht func (c *ProjectsLocationsCollectionsDataStoresTrainCustomModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1traincustommodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1traincustommodelrequest) if err != nil { return nil, err } @@ -21684,12 +21672,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadata if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/batchGetDocumentsMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21797,8 +21784,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1document) if err != nil { return nil, err } @@ -21902,12 +21888,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22015,12 +22000,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22117,8 +22101,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importdocumentsrequest) if err != nil { return nil, err } @@ -22254,12 +22237,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22391,8 +22373,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Heade func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1document) if err != nil { return nil, err } @@ -22500,8 +22481,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Heade func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgedocumentsrequest) if err != nil { return nil, err } @@ -22610,8 +22590,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsCancelCall) Hea func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -22724,12 +22703,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22853,12 +22831,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22974,8 +22951,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest) if err != nil { return nil, err } @@ -23078,8 +23054,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) H func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest) if err != nil { return nil, err } @@ -23195,8 +23170,7 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsCreateCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1control) if err != nil { return nil, err } @@ -23298,12 +23272,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsDeleteCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23408,12 +23381,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23543,12 +23515,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23673,8 +23644,7 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsPatchCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1control) if err != nil { return nil, err } @@ -23781,8 +23751,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Header func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1converseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1converseconversationrequest) if err != nil { return nil, err } @@ -23886,8 +23855,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1conversation) if err != nil { return nil, err } @@ -23989,12 +23957,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24099,12 +24066,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24241,12 +24207,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24373,8 +24338,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1conversation) if err != nil { return nil, err } @@ -24488,12 +24452,11 @@ func (c *ProjectsLocationsCollectionsDataStoresCustomModelsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+dataStore}/customModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24598,12 +24561,11 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24727,12 +24689,11 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24858,12 +24819,11 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24987,12 +24947,11 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25117,8 +25076,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1schema) if err != nil { return nil, err } @@ -25219,12 +25177,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25329,12 +25286,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25457,12 +25413,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25587,8 +25542,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Header() http.H func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1schema) if err != nil { return nil, err } @@ -25701,12 +25655,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25830,12 +25783,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25954,8 +25906,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsAnswerCall) Header( func (c *ProjectsLocationsCollectionsDataStoresServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1answerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1answerqueryrequest) if err != nil { return nil, err } @@ -26067,8 +26018,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsPatchCall) Header() func (c *ProjectsLocationsCollectionsDataStoresServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1servingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1servingconfig) if err != nil { return nil, err } @@ -26177,8 +26127,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Head func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1recommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1recommendrequest) if err != nil { return nil, err } @@ -26285,8 +26234,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Header( func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1searchrequest) if err != nil { return nil, err } @@ -26421,8 +26369,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchLiteCall) Hea func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1searchrequest) if err != nil { return nil, err } @@ -26551,8 +26498,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsStreamAnswerCall) H func (c *ProjectsLocationsCollectionsDataStoresServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1answerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1answerqueryrequest) if err != nil { return nil, err } @@ -26656,8 +26602,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsCreateCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1session) if err != nil { return nil, err } @@ -26759,12 +26704,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsDeleteCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26876,12 +26820,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27020,12 +26963,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27150,8 +27092,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsPatchCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1session) if err != nil { return nil, err } @@ -27264,12 +27205,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsAnswersGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27365,8 +27305,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTarget func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTargetSitesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1batchverifytargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1batchverifytargetsitesrequest) if err != nil { return nil, err } @@ -27470,8 +27409,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSi func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1disableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1disableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -27575,8 +27513,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSit func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1enableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1enableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -27712,12 +27649,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerifi if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+siteSearchEngine}:fetchDomainVerificationStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27832,8 +27768,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUrisCall) func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUrisCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1recrawlurisrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1recrawlurisrequest) if err != nil { return nil, err } @@ -27946,12 +27881,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28075,12 +28009,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28197,8 +28130,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchC func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1batchcreatetargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1batchcreatetargetsitesrequest) if err != nil { return nil, err } @@ -28301,8 +28233,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreate func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1targetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1targetsite) if err != nil { return nil, err } @@ -28406,12 +28337,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDelete func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28519,12 +28449,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesGetCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28650,12 +28579,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesListCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/targetSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28772,8 +28700,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatchC func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1targetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1targetsite) if err != nil { return nil, err } @@ -28886,12 +28813,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29015,12 +28941,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29136,8 +29061,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImportCa func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importsuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importsuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -29240,8 +29164,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurgeCal func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgesuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgesuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -29384,12 +29307,11 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29488,8 +29410,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() ht func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importusereventsrequest) if err != nil { return nil, err } @@ -29596,8 +29517,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Header() htt func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgeusereventsrequest) if err != nil { return nil, err } @@ -29711,8 +29631,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() htt func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1userevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1userevent) if err != nil { return nil, err } @@ -29824,8 +29743,7 @@ func (c *ProjectsLocationsCollectionsEnginesCreateCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1engine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1engine) if err != nil { return nil, err } @@ -29929,12 +29847,11 @@ func (c *ProjectsLocationsCollectionsEnginesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30039,12 +29956,11 @@ func (c *ProjectsLocationsCollectionsEnginesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30167,12 +30083,11 @@ func (c *ProjectsLocationsCollectionsEnginesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/engines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30299,8 +30214,7 @@ func (c *ProjectsLocationsCollectionsEnginesPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1engine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1engine) if err != nil { return nil, err } @@ -30416,8 +30330,7 @@ func (c *ProjectsLocationsCollectionsEnginesControlsCreateCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1control) if err != nil { return nil, err } @@ -30519,12 +30432,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsDeleteCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30629,12 +30541,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30764,12 +30675,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30894,8 +30804,7 @@ func (c *ProjectsLocationsCollectionsEnginesControlsPatchCall) Header() http.Hea func (c *ProjectsLocationsCollectionsEnginesControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1control) if err != nil { return nil, err } @@ -31002,8 +30911,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsConverseCall) Header() func (c *ProjectsLocationsCollectionsEnginesConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1converseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1converseconversationrequest) if err != nil { return nil, err } @@ -31107,8 +31015,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsCreateCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1conversation) if err != nil { return nil, err } @@ -31210,12 +31117,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsDeleteCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31320,12 +31226,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31462,12 +31367,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31594,8 +31498,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsPatchCall) Header() htt func (c *ProjectsLocationsCollectionsEnginesConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1conversation) if err != nil { return nil, err } @@ -31708,12 +31611,11 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31837,12 +31739,11 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31961,8 +31862,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsAnswerCall) Header() h func (c *ProjectsLocationsCollectionsEnginesServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1answerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1answerqueryrequest) if err != nil { return nil, err } @@ -32074,8 +31974,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsPatchCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1servingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1servingconfig) if err != nil { return nil, err } @@ -32184,8 +32083,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsRecommendCall) Header( func (c *ProjectsLocationsCollectionsEnginesServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1recommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1recommendrequest) if err != nil { return nil, err } @@ -32292,8 +32190,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchCall) Header() h func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1searchrequest) if err != nil { return nil, err } @@ -32428,8 +32325,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchLiteCall) Header func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1searchrequest) if err != nil { return nil, err } @@ -32558,8 +32454,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsStreamAnswerCall) Head func (c *ProjectsLocationsCollectionsEnginesServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1answerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1answerqueryrequest) if err != nil { return nil, err } @@ -32663,8 +32558,7 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsCreateCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1session) if err != nil { return nil, err } @@ -32766,12 +32660,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsDeleteCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32883,12 +32776,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33027,12 +32919,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33157,8 +33048,7 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsPatchCall) Header() http.Hea func (c *ProjectsLocationsCollectionsEnginesSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1session) if err != nil { return nil, err } @@ -33271,12 +33161,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsAnswersGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33381,12 +33270,11 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33510,12 +33398,11 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33690,12 +33577,11 @@ func (c *ProjectsLocationsDataStoresCompleteQueryCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33838,8 +33724,7 @@ func (c *ProjectsLocationsDataStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1datastore) if err != nil { return nil, err } @@ -33943,12 +33828,11 @@ func (c *ProjectsLocationsDataStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34056,12 +33940,11 @@ func (c *ProjectsLocationsDataStoresGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34168,12 +34051,11 @@ func (c *ProjectsLocationsDataStoresGetSiteSearchEngineCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34307,12 +34189,11 @@ func (c *ProjectsLocationsDataStoresListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34437,8 +34318,7 @@ func (c *ProjectsLocationsDataStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1datastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1datastore) if err != nil { return nil, err } @@ -34569,12 +34449,11 @@ func (c *ProjectsLocationsDataStoresBranchesBatchGetDocumentsMetadataCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/batchGetDocumentsMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34682,8 +34561,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1document) if err != nil { return nil, err } @@ -34787,12 +34665,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34900,12 +34777,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35002,8 +34878,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importdocumentsrequest) if err != nil { return nil, err } @@ -35139,12 +35014,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35276,8 +35150,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.He func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1document) if err != nil { return nil, err } @@ -35385,8 +35258,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.He func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgedocumentsrequest) if err != nil { return nil, err } @@ -35495,8 +35367,7 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsCancelCall) Header() http. func (c *ProjectsLocationsDataStoresBranchesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -35609,12 +35480,11 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35738,12 +35608,11 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35859,8 +35728,7 @@ func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Header() ht func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest) if err != nil { return nil, err } @@ -35963,8 +35831,7 @@ func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Header() htt func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest) if err != nil { return nil, err } @@ -36080,8 +35947,7 @@ func (c *ProjectsLocationsDataStoresControlsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1control) if err != nil { return nil, err } @@ -36183,12 +36049,11 @@ func (c *ProjectsLocationsDataStoresControlsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36293,12 +36158,11 @@ func (c *ProjectsLocationsDataStoresControlsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36428,12 +36292,11 @@ func (c *ProjectsLocationsDataStoresControlsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36558,8 +36421,7 @@ func (c *ProjectsLocationsDataStoresControlsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1control) if err != nil { return nil, err } @@ -36666,8 +36528,7 @@ func (c *ProjectsLocationsDataStoresConversationsConverseCall) Header() http.Hea func (c *ProjectsLocationsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1converseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1converseconversationrequest) if err != nil { return nil, err } @@ -36771,8 +36632,7 @@ func (c *ProjectsLocationsDataStoresConversationsCreateCall) Header() http.Heade func (c *ProjectsLocationsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1conversation) if err != nil { return nil, err } @@ -36874,12 +36734,11 @@ func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36984,12 +36843,11 @@ func (c *ProjectsLocationsDataStoresConversationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37126,12 +36984,11 @@ func (c *ProjectsLocationsDataStoresConversationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37258,8 +37115,7 @@ func (c *ProjectsLocationsDataStoresConversationsPatchCall) Header() http.Header func (c *ProjectsLocationsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1conversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1conversation) if err != nil { return nil, err } @@ -37372,12 +37228,11 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37501,12 +37356,11 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37632,12 +37486,11 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37761,12 +37614,11 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37891,8 +37743,7 @@ func (c *ProjectsLocationsDataStoresSchemasCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1schema) if err != nil { return nil, err } @@ -37993,12 +37844,11 @@ func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38103,12 +37953,11 @@ func (c *ProjectsLocationsDataStoresSchemasGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38231,12 +38080,11 @@ func (c *ProjectsLocationsDataStoresSchemasListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38361,8 +38209,7 @@ func (c *ProjectsLocationsDataStoresSchemasPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1schema) if err != nil { return nil, err } @@ -38468,8 +38315,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsAnswerCall) Header() http.Head func (c *ProjectsLocationsDataStoresServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1answerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1answerqueryrequest) if err != nil { return nil, err } @@ -38581,8 +38427,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsPatchCall) Header() http.Heade func (c *ProjectsLocationsDataStoresServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1servingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1servingconfig) if err != nil { return nil, err } @@ -38691,8 +38536,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.H func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1recommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1recommendrequest) if err != nil { return nil, err } @@ -38799,8 +38643,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Header() http.Head func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1searchrequest) if err != nil { return nil, err } @@ -38935,8 +38778,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsSearchLiteCall) Header() http. func (c *ProjectsLocationsDataStoresServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1searchrequest) if err != nil { return nil, err } @@ -39065,8 +38907,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsStreamAnswerCall) Header() htt func (c *ProjectsLocationsDataStoresServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1answerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1answerqueryrequest) if err != nil { return nil, err } @@ -39170,8 +39011,7 @@ func (c *ProjectsLocationsDataStoresSessionsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1session) if err != nil { return nil, err } @@ -39273,12 +39113,11 @@ func (c *ProjectsLocationsDataStoresSessionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39390,12 +39229,11 @@ func (c *ProjectsLocationsDataStoresSessionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39534,12 +39372,11 @@ func (c *ProjectsLocationsDataStoresSessionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39664,8 +39501,7 @@ func (c *ProjectsLocationsDataStoresSessionsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1session) if err != nil { return nil, err } @@ -39778,12 +39614,11 @@ func (c *ProjectsLocationsDataStoresSessionsAnswersGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39879,8 +39714,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCal func (c *ProjectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1disableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1disableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -39984,8 +39818,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall func (c *ProjectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1enableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1enableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -40087,8 +39920,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineRecrawlUrisCall) Header() ht func (c *ProjectsLocationsDataStoresSiteSearchEngineRecrawlUrisCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1recrawlurisrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1recrawlurisrequest) if err != nil { return nil, err } @@ -40192,8 +40024,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1batchcreatetargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1batchcreatetargetsitesrequest) if err != nil { return nil, err } @@ -40296,8 +40127,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesCreateCall) Heade func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1targetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1targetsite) if err != nil { return nil, err } @@ -40401,12 +40231,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesDeleteCall) Heade func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40514,12 +40343,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40645,12 +40473,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/targetSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40767,8 +40594,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesPatchCall) Header func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1targetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1targetsite) if err != nil { return nil, err } @@ -40871,8 +40697,7 @@ func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesImportCall) Header( func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importsuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importsuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -40975,8 +40800,7 @@ func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesPurgeCall) Header() func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgesuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgesuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -41119,12 +40943,11 @@ func (c *ProjectsLocationsDataStoresUserEventsCollectCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41223,8 +41046,7 @@ func (c *ProjectsLocationsDataStoresUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importusereventsrequest) if err != nil { return nil, err } @@ -41331,8 +41153,7 @@ func (c *ProjectsLocationsDataStoresUserEventsPurgeCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1purgeusereventsrequest) if err != nil { return nil, err } @@ -41446,8 +41267,7 @@ func (c *ProjectsLocationsDataStoresUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1userevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1userevent) if err != nil { return nil, err } @@ -41549,8 +41369,7 @@ func (c *ProjectsLocationsGroundingConfigsCheckCall) Header() http.Header { func (c *ProjectsLocationsGroundingConfigsCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1checkgroundingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1checkgroundingrequest) if err != nil { return nil, err } @@ -41663,12 +41482,11 @@ func (c *ProjectsLocationsIdentityMappingStoresOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41792,12 +41610,11 @@ func (c *ProjectsLocationsIdentityMappingStoresOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41923,12 +41740,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42052,12 +41868,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42173,8 +41988,7 @@ func (c *ProjectsLocationsRankingConfigsRankCall) Header() http.Header { func (c *ProjectsLocationsRankingConfigsRankCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1rankrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1rankrequest) if err != nil { return nil, err } @@ -42317,12 +42131,11 @@ func (c *ProjectsLocationsUserEventsCollectCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42421,8 +42234,7 @@ func (c *ProjectsLocationsUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1importusereventsrequest) if err != nil { return nil, err } @@ -42536,8 +42348,7 @@ func (c *ProjectsLocationsUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1userevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1userevent) if err != nil { return nil, err } @@ -42646,8 +42457,7 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -42760,12 +42570,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42889,12 +42698,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/discoveryengine/v1alpha/discoveryengine-gen.go b/discoveryengine/v1alpha/discoveryengine-gen.go index 2831e058cca..a8928bb341f 100644 --- a/discoveryengine/v1alpha/discoveryengine-gen.go +++ b/discoveryengine/v1alpha/discoveryengine-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -21115,12 +21114,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21217,8 +21215,7 @@ func (c *ProjectsProvisionCall) Header() http.Header { func (c *ProjectsProvisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaprovisionprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaprovisionprojectrequest) if err != nil { return nil, err } @@ -21323,8 +21320,7 @@ func (c *ProjectsReportConsentChangeCall) Header() http.Header { func (c *ProjectsReportConsentChangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphareportconsentchangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphareportconsentchangerequest) if err != nil { return nil, err } @@ -21426,8 +21422,7 @@ func (c *ProjectsLocationsEstimateDataSizeCall) Header() http.Header { func (c *ProjectsLocationsEstimateDataSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaestimatedatasizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaestimatedatasizerequest) if err != nil { return nil, err } @@ -21541,12 +21536,11 @@ func (c *ProjectsLocationsGetAclConfigCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21653,12 +21647,11 @@ func (c *ProjectsLocationsGetCmekConfigCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21755,8 +21748,7 @@ func (c *ProjectsLocationsUpdateAclConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateAclConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaaclconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaaclconfig) if err != nil { return nil, err } @@ -21870,8 +21862,7 @@ func (c *ProjectsLocationsUpdateCmekConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateCmekConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacmekconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacmekconfig) if err != nil { return nil, err } @@ -21986,12 +21977,11 @@ func (c *ProjectsLocationsCmekConfigsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22097,12 +22087,11 @@ func (c *ProjectsLocationsCmekConfigsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/cmekConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22207,8 +22196,7 @@ func (c *ProjectsLocationsCmekConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsCmekConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacmekconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacmekconfig) if err != nil { return nil, err } @@ -22321,12 +22309,11 @@ func (c *ProjectsLocationsCollectionsDataConnectorOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22450,12 +22437,11 @@ func (c *ProjectsLocationsCollectionsDataConnectorOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22630,12 +22616,11 @@ func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22780,8 +22765,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCreateCall) Header() http.Header func (c *ProjectsLocationsCollectionsDataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadatastore) if err != nil { return nil, err } @@ -22885,12 +22869,11 @@ func (c *ProjectsLocationsCollectionsDataStoresDeleteCall) Header() http.Header func (c *ProjectsLocationsCollectionsDataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22998,12 +22981,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23108,12 +23090,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetDocumentProcessingConfigCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23220,12 +23201,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetSiteSearchEngineCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23359,12 +23339,11 @@ func (c *ProjectsLocationsCollectionsDataStoresListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/dataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23489,8 +23468,7 @@ func (c *ProjectsLocationsCollectionsDataStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectionsDataStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadatastore) if err != nil { return nil, err } @@ -23594,8 +23572,7 @@ func (c *ProjectsLocationsCollectionsDataStoresTrainCustomModelCall) Header() ht func (c *ProjectsLocationsCollectionsDataStoresTrainCustomModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphatraincustommodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphatraincustommodelrequest) if err != nil { return nil, err } @@ -23710,8 +23687,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUpdateDocumentProcessingConfigCal func (c *ProjectsLocationsCollectionsDataStoresUpdateDocumentProcessingConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocumentprocessingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadocumentprocessingconfig) if err != nil { return nil, err } @@ -23842,12 +23818,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadata if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/batchGetDocumentsMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23955,8 +23930,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadocument) if err != nil { return nil, err } @@ -24060,12 +24034,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24173,12 +24146,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24320,12 +24292,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetProcessedDocu if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:getProcessedDocument") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24422,8 +24393,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) if err != nil { return nil, err } @@ -24559,12 +24529,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24698,8 +24667,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Heade func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadocument) if err != nil { return nil, err } @@ -24807,8 +24775,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Heade func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) if err != nil { return nil, err } @@ -24924,12 +24891,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsChunksGetCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25057,12 +25023,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsChunksListCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/chunks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25184,8 +25149,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsCancelCall) Hea func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -25298,12 +25262,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25427,12 +25390,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25551,8 +25513,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionConfigCompleteQueryCall func (c *ProjectsLocationsCollectionsDataStoresCompletionConfigCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaadvancedcompletequeryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaadvancedcompletequeryrequest) if err != nil { return nil, err } @@ -25655,8 +25616,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest) if err != nil { return nil, err } @@ -25759,8 +25719,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) H func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest) if err != nil { return nil, err } @@ -25876,8 +25835,7 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsCreateCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacontrol) if err != nil { return nil, err } @@ -25979,12 +25937,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsDeleteCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26089,12 +26046,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26224,12 +26180,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26354,8 +26309,7 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsPatchCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacontrol) if err != nil { return nil, err } @@ -26462,8 +26416,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Header func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) if err != nil { return nil, err } @@ -26567,8 +26520,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconversation) if err != nil { return nil, err } @@ -26670,12 +26622,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26780,12 +26731,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26922,12 +26872,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27054,8 +27003,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconversation) if err != nil { return nil, err } @@ -27169,12 +27117,11 @@ func (c *ProjectsLocationsCollectionsDataStoresCustomModelsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+dataStore}/customModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27279,12 +27226,11 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27408,12 +27354,11 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27539,12 +27484,11 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27668,12 +27612,11 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27798,8 +27741,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaschema) if err != nil { return nil, err } @@ -27900,12 +27842,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28010,12 +27951,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28138,12 +28078,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28268,8 +28207,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Header() http.H func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaschema) if err != nil { return nil, err } @@ -28382,12 +28320,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28511,12 +28448,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28635,8 +28571,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsAnswerCall) Header( func (c *ProjectsLocationsCollectionsDataStoresServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) if err != nil { return nil, err } @@ -28750,12 +28685,11 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28876,12 +28810,11 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29006,8 +28939,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsPatchCall) Header() func (c *ProjectsLocationsCollectionsDataStoresServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaservingconfig) if err != nil { return nil, err } @@ -29116,8 +29048,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Head func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharecommendrequest) if err != nil { return nil, err } @@ -29224,8 +29155,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Header( func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } @@ -29360,8 +29290,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchLiteCall) Hea func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } @@ -29490,8 +29419,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsStreamAnswerCall) H func (c *ProjectsLocationsCollectionsDataStoresServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) if err != nil { return nil, err } @@ -29595,8 +29523,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsCreateCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasession) if err != nil { return nil, err } @@ -29698,12 +29625,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsDeleteCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29815,12 +29741,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29959,12 +29884,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30089,8 +30013,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsPatchCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasession) if err != nil { return nil, err } @@ -30203,12 +30126,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsAnswersGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30304,8 +30226,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTarget func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTargetSitesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphabatchverifytargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphabatchverifytargetsitesrequest) if err != nil { return nil, err } @@ -30409,8 +30330,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSi func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadisableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadisableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -30514,8 +30434,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSit func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaenableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaenableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -30651,12 +30570,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerifi if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+siteSearchEngine}:fetchDomainVerificationStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30782,12 +30700,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineGetUriPatternDocu if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+siteSearchEngine}:getUriPatternDocumentData") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30881,8 +30798,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUrisCall) func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUrisCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecrawlurisrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharecrawlurisrequest) if err != nil { return nil, err } @@ -30985,8 +30901,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSetUriPatternDocu func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSetUriPatternDocumentDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaseturipatterndocumentdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaseturipatterndocumentdatarequest) if err != nil { return nil, err } @@ -31099,12 +31014,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31228,12 +31142,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31348,8 +31261,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsCreateCal func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasitemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasitemap) if err != nil { return nil, err } @@ -31453,12 +31365,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsDeleteCal func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31554,8 +31465,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchC func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphabatchcreatetargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphabatchcreatetargetsitesrequest) if err != nil { return nil, err } @@ -31658,8 +31568,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreate func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphatargetsite) if err != nil { return nil, err } @@ -31763,12 +31672,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDelete func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31876,12 +31784,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesGetCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32007,12 +31914,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesListCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/targetSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32129,8 +32035,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatchC func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphatargetsite) if err != nil { return nil, err } @@ -32243,12 +32148,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32372,12 +32276,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32493,8 +32396,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImportCa func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportsuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportsuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -32597,8 +32499,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurgeCal func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgesuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgesuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -32741,12 +32642,11 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32845,8 +32745,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() ht func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) if err != nil { return nil, err } @@ -32953,8 +32852,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Header() htt func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgeusereventsrequest) if err != nil { return nil, err } @@ -33068,8 +32966,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() htt func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphauserevent) if err != nil { return nil, err } @@ -33181,8 +33078,7 @@ func (c *ProjectsLocationsCollectionsEnginesCreateCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaengine) if err != nil { return nil, err } @@ -33286,12 +33182,11 @@ func (c *ProjectsLocationsCollectionsEnginesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33396,12 +33291,11 @@ func (c *ProjectsLocationsCollectionsEnginesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33524,12 +33418,11 @@ func (c *ProjectsLocationsCollectionsEnginesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/engines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33656,8 +33549,7 @@ func (c *ProjectsLocationsCollectionsEnginesPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaengine) if err != nil { return nil, err } @@ -33761,8 +33653,7 @@ func (c *ProjectsLocationsCollectionsEnginesPauseCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapauseenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapauseenginerequest) if err != nil { return nil, err } @@ -33866,8 +33757,7 @@ func (c *ProjectsLocationsCollectionsEnginesResumeCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharesumeenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharesumeenginerequest) if err != nil { return nil, err } @@ -33971,8 +33861,7 @@ func (c *ProjectsLocationsCollectionsEnginesTuneCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesTuneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphatuneenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphatuneenginerequest) if err != nil { return nil, err } @@ -34078,8 +33967,7 @@ func (c *ProjectsLocationsCollectionsEnginesCompletionConfigCompleteQueryCall) H func (c *ProjectsLocationsCollectionsEnginesCompletionConfigCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaadvancedcompletequeryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaadvancedcompletequeryrequest) if err != nil { return nil, err } @@ -34195,8 +34083,7 @@ func (c *ProjectsLocationsCollectionsEnginesControlsCreateCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacontrol) if err != nil { return nil, err } @@ -34298,12 +34185,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsDeleteCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34408,12 +34294,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34543,12 +34428,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34673,8 +34557,7 @@ func (c *ProjectsLocationsCollectionsEnginesControlsPatchCall) Header() http.Hea func (c *ProjectsLocationsCollectionsEnginesControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacontrol) if err != nil { return nil, err } @@ -34781,8 +34664,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsConverseCall) Header() func (c *ProjectsLocationsCollectionsEnginesConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) if err != nil { return nil, err } @@ -34886,8 +34768,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsCreateCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconversation) if err != nil { return nil, err } @@ -34989,12 +34870,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsDeleteCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35099,12 +34979,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35241,12 +35120,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35373,8 +35251,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsPatchCall) Header() htt func (c *ProjectsLocationsCollectionsEnginesConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconversation) if err != nil { return nil, err } @@ -35487,12 +35364,11 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35616,12 +35492,11 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35740,8 +35615,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsAnswerCall) Header() h func (c *ProjectsLocationsCollectionsEnginesServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) if err != nil { return nil, err } @@ -35855,12 +35729,11 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35981,12 +35854,11 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36111,8 +35983,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsPatchCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaservingconfig) if err != nil { return nil, err } @@ -36221,8 +36092,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsRecommendCall) Header( func (c *ProjectsLocationsCollectionsEnginesServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharecommendrequest) if err != nil { return nil, err } @@ -36329,8 +36199,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchCall) Header() h func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } @@ -36465,8 +36334,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchLiteCall) Header func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } @@ -36595,8 +36463,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsStreamAnswerCall) Head func (c *ProjectsLocationsCollectionsEnginesServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) if err != nil { return nil, err } @@ -36700,8 +36567,7 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsCreateCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasession) if err != nil { return nil, err } @@ -36803,12 +36669,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsDeleteCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36920,12 +36785,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37064,12 +36928,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37194,8 +37057,7 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsPatchCall) Header() http.Hea func (c *ProjectsLocationsCollectionsEnginesSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasession) if err != nil { return nil, err } @@ -37308,12 +37170,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsAnswersGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37418,12 +37279,11 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37547,12 +37407,11 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37727,12 +37586,11 @@ func (c *ProjectsLocationsDataStoresCompleteQueryCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37877,8 +37735,7 @@ func (c *ProjectsLocationsDataStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadatastore) if err != nil { return nil, err } @@ -37982,12 +37839,11 @@ func (c *ProjectsLocationsDataStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38095,12 +37951,11 @@ func (c *ProjectsLocationsDataStoresGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38205,12 +38060,11 @@ func (c *ProjectsLocationsDataStoresGetDocumentProcessingConfigCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38317,12 +38171,11 @@ func (c *ProjectsLocationsDataStoresGetSiteSearchEngineCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38456,12 +38309,11 @@ func (c *ProjectsLocationsDataStoresListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/dataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38586,8 +38438,7 @@ func (c *ProjectsLocationsDataStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadatastore) if err != nil { return nil, err } @@ -38702,8 +38553,7 @@ func (c *ProjectsLocationsDataStoresUpdateDocumentProcessingConfigCall) Header() func (c *ProjectsLocationsDataStoresUpdateDocumentProcessingConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocumentprocessingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadocumentprocessingconfig) if err != nil { return nil, err } @@ -38834,12 +38684,11 @@ func (c *ProjectsLocationsDataStoresBranchesBatchGetDocumentsMetadataCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/batchGetDocumentsMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38947,8 +38796,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadocument) if err != nil { return nil, err } @@ -39052,12 +38900,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39165,12 +39012,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39312,12 +39158,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetProcessedDocumentCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:getProcessedDocument") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39414,8 +39259,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) if err != nil { return nil, err } @@ -39551,12 +39395,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39690,8 +39533,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.He func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadocument) if err != nil { return nil, err } @@ -39799,8 +39641,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.He func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) if err != nil { return nil, err } @@ -39916,12 +39757,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsChunksGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40049,12 +39889,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsChunksListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/chunks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40176,8 +40015,7 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsCancelCall) Header() http. func (c *ProjectsLocationsDataStoresBranchesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -40290,12 +40128,11 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40419,12 +40256,11 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40543,8 +40379,7 @@ func (c *ProjectsLocationsDataStoresCompletionConfigCompleteQueryCall) Header() func (c *ProjectsLocationsDataStoresCompletionConfigCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaadvancedcompletequeryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaadvancedcompletequeryrequest) if err != nil { return nil, err } @@ -40647,8 +40482,7 @@ func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Header() ht func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest) if err != nil { return nil, err } @@ -40751,8 +40585,7 @@ func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Header() htt func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest) if err != nil { return nil, err } @@ -40868,8 +40701,7 @@ func (c *ProjectsLocationsDataStoresControlsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacontrol) if err != nil { return nil, err } @@ -40971,12 +40803,11 @@ func (c *ProjectsLocationsDataStoresControlsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41081,12 +40912,11 @@ func (c *ProjectsLocationsDataStoresControlsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41216,12 +41046,11 @@ func (c *ProjectsLocationsDataStoresControlsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41346,8 +41175,7 @@ func (c *ProjectsLocationsDataStoresControlsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacontrol) if err != nil { return nil, err } @@ -41454,8 +41282,7 @@ func (c *ProjectsLocationsDataStoresConversationsConverseCall) Header() http.Hea func (c *ProjectsLocationsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) if err != nil { return nil, err } @@ -41559,8 +41386,7 @@ func (c *ProjectsLocationsDataStoresConversationsCreateCall) Header() http.Heade func (c *ProjectsLocationsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconversation) if err != nil { return nil, err } @@ -41662,12 +41488,11 @@ func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41772,12 +41597,11 @@ func (c *ProjectsLocationsDataStoresConversationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41914,12 +41738,11 @@ func (c *ProjectsLocationsDataStoresConversationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42046,8 +41869,7 @@ func (c *ProjectsLocationsDataStoresConversationsPatchCall) Header() http.Header func (c *ProjectsLocationsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaconversation) if err != nil { return nil, err } @@ -42160,12 +41982,11 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42289,12 +42110,11 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42420,12 +42240,11 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42549,12 +42368,11 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42679,8 +42497,7 @@ func (c *ProjectsLocationsDataStoresSchemasCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaschema) if err != nil { return nil, err } @@ -42781,12 +42598,11 @@ func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42891,12 +42707,11 @@ func (c *ProjectsLocationsDataStoresSchemasGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43019,12 +42834,11 @@ func (c *ProjectsLocationsDataStoresSchemasListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43149,8 +42963,7 @@ func (c *ProjectsLocationsDataStoresSchemasPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaschema) if err != nil { return nil, err } @@ -43256,8 +43069,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsAnswerCall) Header() http.Head func (c *ProjectsLocationsDataStoresServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) if err != nil { return nil, err } @@ -43371,12 +43183,11 @@ func (c *ProjectsLocationsDataStoresServingConfigsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43497,12 +43308,11 @@ func (c *ProjectsLocationsDataStoresServingConfigsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43627,8 +43437,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsPatchCall) Header() http.Heade func (c *ProjectsLocationsDataStoresServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaservingconfig) if err != nil { return nil, err } @@ -43737,8 +43546,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.H func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharecommendrequest) if err != nil { return nil, err } @@ -43845,8 +43653,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Header() http.Head func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } @@ -43981,8 +43788,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsSearchLiteCall) Header() http. func (c *ProjectsLocationsDataStoresServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } @@ -44111,8 +43917,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsStreamAnswerCall) Header() htt func (c *ProjectsLocationsDataStoresServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaanswerqueryrequest) if err != nil { return nil, err } @@ -44216,8 +44021,7 @@ func (c *ProjectsLocationsDataStoresSessionsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasession) if err != nil { return nil, err } @@ -44319,12 +44123,11 @@ func (c *ProjectsLocationsDataStoresSessionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -44436,12 +44239,11 @@ func (c *ProjectsLocationsDataStoresSessionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44580,12 +44382,11 @@ func (c *ProjectsLocationsDataStoresSessionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44710,8 +44511,7 @@ func (c *ProjectsLocationsDataStoresSessionsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasession) if err != nil { return nil, err } @@ -44824,12 +44624,11 @@ func (c *ProjectsLocationsDataStoresSessionsAnswersGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44925,8 +44724,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCal func (c *ProjectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadisableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphadisableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -45030,8 +44828,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall func (c *ProjectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaenableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaenableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -45133,8 +44930,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineRecrawlUrisCall) Header() ht func (c *ProjectsLocationsDataStoresSiteSearchEngineRecrawlUrisCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecrawlurisrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharecrawlurisrequest) if err != nil { return nil, err } @@ -45236,8 +45032,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsCreateCall) Header() func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasitemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasitemap) if err != nil { return nil, err } @@ -45341,12 +45136,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsDeleteCall) Header() func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45457,12 +45251,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsFetchCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sitemaps:fetch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45560,8 +45353,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphabatchcreatetargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphabatchcreatetargetsitesrequest) if err != nil { return nil, err } @@ -45664,8 +45456,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesCreateCall) Heade func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphatargetsite) if err != nil { return nil, err } @@ -45769,12 +45560,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesDeleteCall) Heade func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45882,12 +45672,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46013,12 +45802,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/targetSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46135,8 +45923,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesPatchCall) Header func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphatargetsite) if err != nil { return nil, err } @@ -46239,8 +46026,7 @@ func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesImportCall) Header( func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportsuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportsuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -46343,8 +46129,7 @@ func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesPurgeCall) Header() func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgesuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgesuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -46487,12 +46272,11 @@ func (c *ProjectsLocationsDataStoresUserEventsCollectCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46591,8 +46375,7 @@ func (c *ProjectsLocationsDataStoresUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) if err != nil { return nil, err } @@ -46699,8 +46482,7 @@ func (c *ProjectsLocationsDataStoresUserEventsPurgeCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphapurgeusereventsrequest) if err != nil { return nil, err } @@ -46814,8 +46596,7 @@ func (c *ProjectsLocationsDataStoresUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphauserevent) if err != nil { return nil, err } @@ -46918,8 +46699,7 @@ func (c *ProjectsLocationsEvaluationsCreateCall) Header() http.Header { func (c *ProjectsLocationsEvaluationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaevaluation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaevaluation) if err != nil { return nil, err } @@ -47034,12 +46814,11 @@ func (c *ProjectsLocationsEvaluationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47165,12 +46944,11 @@ func (c *ProjectsLocationsEvaluationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47318,12 +47096,11 @@ func (c *ProjectsLocationsEvaluationsListResultsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+evaluation}:listResults") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47449,12 +47226,11 @@ func (c *ProjectsLocationsEvaluationsOperationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47548,8 +47324,7 @@ func (c *ProjectsLocationsGroundingConfigsCheckCall) Header() http.Header { func (c *ProjectsLocationsGroundingConfigsCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacheckgroundingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacheckgroundingrequest) if err != nil { return nil, err } @@ -47662,12 +47437,11 @@ func (c *ProjectsLocationsIdentityMappingStoresOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47791,12 +47565,11 @@ func (c *ProjectsLocationsIdentityMappingStoresOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47922,12 +47695,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48051,12 +47823,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48172,8 +47943,7 @@ func (c *ProjectsLocationsRankingConfigsRankCall) Header() http.Header { func (c *ProjectsLocationsRankingConfigsRankCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharankrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alpharankrequest) if err != nil { return nil, err } @@ -48275,8 +48045,7 @@ func (c *ProjectsLocationsRequirementsCheckRequirementCall) Header() http.Header func (c *ProjectsLocationsRequirementsCheckRequirementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphacheckrequirementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphacheckrequirementrequest) if err != nil { return nil, err } @@ -48392,8 +48161,7 @@ func (c *ProjectsLocationsSampleQuerySetsCreateCall) Header() http.Header { func (c *ProjectsLocationsSampleQuerySetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasamplequeryset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasamplequeryset) if err != nil { return nil, err } @@ -48497,12 +48265,11 @@ func (c *ProjectsLocationsSampleQuerySetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSampleQuerySetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -48610,12 +48377,11 @@ func (c *ProjectsLocationsSampleQuerySetsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48742,12 +48508,11 @@ func (c *ProjectsLocationsSampleQuerySetsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sampleQuerySets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -48873,8 +48638,7 @@ func (c *ProjectsLocationsSampleQuerySetsPatchCall) Header() http.Header { func (c *ProjectsLocationsSampleQuerySetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasamplequeryset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasamplequeryset) if err != nil { return nil, err } @@ -48987,12 +48751,11 @@ func (c *ProjectsLocationsSampleQuerySetsOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49100,8 +48863,7 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesCreateCall) Header() http. func (c *ProjectsLocationsSampleQuerySetsSampleQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasamplequery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasamplequery) if err != nil { return nil, err } @@ -49205,12 +48967,11 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesDeleteCall) Header() http. func (c *ProjectsLocationsSampleQuerySetsSampleQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -49318,12 +49079,11 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49422,8 +49182,7 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesImportCall) Header() http. func (c *ProjectsLocationsSampleQuerySetsSampleQueriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportsamplequeriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportsamplequeriesrequest) if err != nil { return nil, err } @@ -49558,12 +49317,11 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/sampleQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49689,8 +49447,7 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesPatchCall) Header() http.H func (c *ProjectsLocationsSampleQuerySetsSampleQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasamplequery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphasamplequery) if err != nil { return nil, err } @@ -49833,12 +49590,11 @@ func (c *ProjectsLocationsUserEventsCollectCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -49937,8 +49693,7 @@ func (c *ProjectsLocationsUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) if err != nil { return nil, err } @@ -50052,8 +49807,7 @@ func (c *ProjectsLocationsUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1alphauserevent) if err != nil { return nil, err } @@ -50166,12 +49920,11 @@ func (c *ProjectsLocationsUserStoresOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50295,12 +50048,11 @@ func (c *ProjectsLocationsUserStoresOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50426,12 +50178,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -50555,12 +50306,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/discoveryengine/v1beta/discoveryengine-gen.go b/discoveryengine/v1beta/discoveryengine-gen.go index d09689dcee4..62673623bc8 100644 --- a/discoveryengine/v1beta/discoveryengine-gen.go +++ b/discoveryengine/v1beta/discoveryengine-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -21071,8 +21070,7 @@ func (c *ProjectsProvisionCall) Header() http.Header { func (c *ProjectsProvisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaprovisionprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaprovisionprojectrequest) if err != nil { return nil, err } @@ -21185,12 +21183,11 @@ func (c *ProjectsLocationsCollectionsDataConnectorOperationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21314,12 +21311,11 @@ func (c *ProjectsLocationsCollectionsDataConnectorOperationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21494,12 +21490,11 @@ func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21642,8 +21637,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCreateCall) Header() http.Header func (c *ProjectsLocationsCollectionsDataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadatastore) if err != nil { return nil, err } @@ -21747,12 +21741,11 @@ func (c *ProjectsLocationsCollectionsDataStoresDeleteCall) Header() http.Header func (c *ProjectsLocationsCollectionsDataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21860,12 +21853,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21972,12 +21964,11 @@ func (c *ProjectsLocationsCollectionsDataStoresGetSiteSearchEngineCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22111,12 +22102,11 @@ func (c *ProjectsLocationsCollectionsDataStoresListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/dataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22243,8 +22233,7 @@ func (c *ProjectsLocationsCollectionsDataStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectionsDataStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadatastore) if err != nil { return nil, err } @@ -22348,8 +22337,7 @@ func (c *ProjectsLocationsCollectionsDataStoresTrainCustomModelCall) Header() ht func (c *ProjectsLocationsCollectionsDataStoresTrainCustomModelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betatraincustommodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betatraincustommodelrequest) if err != nil { return nil, err } @@ -22480,12 +22468,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadata if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/batchGetDocumentsMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22593,8 +22580,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadocument) if err != nil { return nil, err } @@ -22698,12 +22684,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22811,12 +22796,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22913,8 +22897,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Head func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) if err != nil { return nil, err } @@ -23050,12 +23033,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23187,8 +23169,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Heade func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadocument) if err != nil { return nil, err } @@ -23296,8 +23277,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Heade func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) if err != nil { return nil, err } @@ -23406,8 +23386,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsCancelCall) Hea func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -23520,12 +23499,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23649,12 +23627,11 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23773,8 +23750,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionConfigCompleteQueryCall func (c *ProjectsLocationsCollectionsDataStoresCompletionConfigCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaadvancedcompletequeryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaadvancedcompletequeryrequest) if err != nil { return nil, err } @@ -23877,8 +23853,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest) if err != nil { return nil, err } @@ -23981,8 +23956,7 @@ func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) H func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest) if err != nil { return nil, err } @@ -24098,8 +24072,7 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsCreateCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacontrol) if err != nil { return nil, err } @@ -24201,12 +24174,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsDeleteCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24311,12 +24283,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24446,12 +24417,11 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24576,8 +24546,7 @@ func (c *ProjectsLocationsCollectionsDataStoresControlsPatchCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacontrol) if err != nil { return nil, err } @@ -24684,8 +24653,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Header func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconverseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconverseconversationrequest) if err != nil { return nil, err } @@ -24789,8 +24757,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconversation) if err != nil { return nil, err } @@ -24892,12 +24859,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25002,12 +24968,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25144,12 +25109,11 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25276,8 +25240,7 @@ func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Header() func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconversation) if err != nil { return nil, err } @@ -25391,12 +25354,11 @@ func (c *ProjectsLocationsCollectionsDataStoresCustomModelsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+dataStore}/customModels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25501,12 +25463,11 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25630,12 +25591,11 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25761,12 +25721,11 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25890,12 +25849,11 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26020,8 +25978,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaschema) if err != nil { return nil, err } @@ -26122,12 +26079,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26232,12 +26188,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26360,12 +26315,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26490,8 +26444,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Header() http.H func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaschema) if err != nil { return nil, err } @@ -26604,12 +26557,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26733,12 +26685,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26857,8 +26808,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsAnswerCall) Header( func (c *ProjectsLocationsCollectionsDataStoresServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaanswerqueryrequest) if err != nil { return nil, err } @@ -26972,12 +26922,11 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27098,12 +27047,11 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27228,8 +27176,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsPatchCall) Header() func (c *ProjectsLocationsCollectionsDataStoresServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaservingconfig) if err != nil { return nil, err } @@ -27338,8 +27285,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Head func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betarecommendrequest) if err != nil { return nil, err } @@ -27446,8 +27392,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Header( func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } @@ -27582,8 +27527,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchLiteCall) Hea func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } @@ -27712,8 +27656,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsStreamAnswerCall) H func (c *ProjectsLocationsCollectionsDataStoresServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaanswerqueryrequest) if err != nil { return nil, err } @@ -27817,8 +27760,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsCreateCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasession) if err != nil { return nil, err } @@ -27920,12 +27862,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsDeleteCall) Header() http func (c *ProjectsLocationsCollectionsDataStoresSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28037,12 +27978,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28181,12 +28121,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28311,8 +28250,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsPatchCall) Header() http. func (c *ProjectsLocationsCollectionsDataStoresSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasession) if err != nil { return nil, err } @@ -28425,12 +28363,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSessionsAnswersGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28526,8 +28463,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTarget func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTargetSitesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betabatchverifytargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betabatchverifytargetsitesrequest) if err != nil { return nil, err } @@ -28631,8 +28567,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSi func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadisableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadisableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -28736,8 +28671,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSit func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaenableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaenableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -28873,12 +28807,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerifi if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+siteSearchEngine}:fetchDomainVerificationStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28993,8 +28926,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUrisCall) func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUrisCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecrawlurisrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betarecrawlurisrequest) if err != nil { return nil, err } @@ -29107,12 +29039,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29236,12 +29167,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29356,8 +29286,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsCreateCal func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasitemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasitemap) if err != nil { return nil, err } @@ -29461,12 +29390,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsDeleteCal func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineSitemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29562,8 +29490,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchC func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betabatchcreatetargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betabatchcreatetargetsitesrequest) if err != nil { return nil, err } @@ -29666,8 +29593,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreate func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betatargetsite) if err != nil { return nil, err } @@ -29771,12 +29697,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDelete func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29884,12 +29809,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesGetCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30015,12 +29939,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesListCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/targetSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30137,8 +30060,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatchC func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betatargetsite) if err != nil { return nil, err } @@ -30251,12 +30173,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30380,12 +30301,11 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30501,8 +30421,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImportCa func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportsuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportsuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -30605,8 +30524,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurgeCal func (c *ProjectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgesuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgesuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -30749,12 +30667,11 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30853,8 +30770,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() ht func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportusereventsrequest) if err != nil { return nil, err } @@ -30961,8 +30877,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Header() htt func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgeusereventsrequest) if err != nil { return nil, err } @@ -31076,8 +30991,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() htt func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betauserevent) if err != nil { return nil, err } @@ -31189,8 +31103,7 @@ func (c *ProjectsLocationsCollectionsEnginesCreateCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaengine) if err != nil { return nil, err } @@ -31294,12 +31207,11 @@ func (c *ProjectsLocationsCollectionsEnginesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31404,12 +31316,11 @@ func (c *ProjectsLocationsCollectionsEnginesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31532,12 +31443,11 @@ func (c *ProjectsLocationsCollectionsEnginesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/engines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31664,8 +31574,7 @@ func (c *ProjectsLocationsCollectionsEnginesPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaengine) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaengine) if err != nil { return nil, err } @@ -31769,8 +31678,7 @@ func (c *ProjectsLocationsCollectionsEnginesPauseCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapauseenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapauseenginerequest) if err != nil { return nil, err } @@ -31874,8 +31782,7 @@ func (c *ProjectsLocationsCollectionsEnginesResumeCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaresumeenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaresumeenginerequest) if err != nil { return nil, err } @@ -31979,8 +31886,7 @@ func (c *ProjectsLocationsCollectionsEnginesTuneCall) Header() http.Header { func (c *ProjectsLocationsCollectionsEnginesTuneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betatuneenginerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betatuneenginerequest) if err != nil { return nil, err } @@ -32086,8 +31992,7 @@ func (c *ProjectsLocationsCollectionsEnginesCompletionConfigCompleteQueryCall) H func (c *ProjectsLocationsCollectionsEnginesCompletionConfigCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaadvancedcompletequeryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaadvancedcompletequeryrequest) if err != nil { return nil, err } @@ -32203,8 +32108,7 @@ func (c *ProjectsLocationsCollectionsEnginesControlsCreateCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacontrol) if err != nil { return nil, err } @@ -32306,12 +32210,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsDeleteCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32416,12 +32319,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32551,12 +32453,11 @@ func (c *ProjectsLocationsCollectionsEnginesControlsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32681,8 +32582,7 @@ func (c *ProjectsLocationsCollectionsEnginesControlsPatchCall) Header() http.Hea func (c *ProjectsLocationsCollectionsEnginesControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacontrol) if err != nil { return nil, err } @@ -32789,8 +32689,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsConverseCall) Header() func (c *ProjectsLocationsCollectionsEnginesConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconverseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconverseconversationrequest) if err != nil { return nil, err } @@ -32894,8 +32793,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsCreateCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconversation) if err != nil { return nil, err } @@ -32997,12 +32895,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsDeleteCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33107,12 +33004,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33249,12 +33145,11 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33381,8 +33276,7 @@ func (c *ProjectsLocationsCollectionsEnginesConversationsPatchCall) Header() htt func (c *ProjectsLocationsCollectionsEnginesConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconversation) if err != nil { return nil, err } @@ -33495,12 +33389,11 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33624,12 +33517,11 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33748,8 +33640,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsAnswerCall) Header() h func (c *ProjectsLocationsCollectionsEnginesServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaanswerqueryrequest) if err != nil { return nil, err } @@ -33863,12 +33754,11 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33989,12 +33879,11 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34119,8 +34008,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsPatchCall) Header() ht func (c *ProjectsLocationsCollectionsEnginesServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaservingconfig) if err != nil { return nil, err } @@ -34229,8 +34117,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsRecommendCall) Header( func (c *ProjectsLocationsCollectionsEnginesServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betarecommendrequest) if err != nil { return nil, err } @@ -34337,8 +34224,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchCall) Header() h func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } @@ -34473,8 +34359,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchLiteCall) Header func (c *ProjectsLocationsCollectionsEnginesServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } @@ -34603,8 +34488,7 @@ func (c *ProjectsLocationsCollectionsEnginesServingConfigsStreamAnswerCall) Head func (c *ProjectsLocationsCollectionsEnginesServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaanswerqueryrequest) if err != nil { return nil, err } @@ -34708,8 +34592,7 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsCreateCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasession) if err != nil { return nil, err } @@ -34811,12 +34694,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsDeleteCall) Header() http.He func (c *ProjectsLocationsCollectionsEnginesSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34928,12 +34810,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35072,12 +34953,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35202,8 +35082,7 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsPatchCall) Header() http.Hea func (c *ProjectsLocationsCollectionsEnginesSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasession) if err != nil { return nil, err } @@ -35316,12 +35195,11 @@ func (c *ProjectsLocationsCollectionsEnginesSessionsAnswersGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35426,12 +35304,11 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35555,12 +35432,11 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35735,12 +35611,11 @@ func (c *ProjectsLocationsDataStoresCompleteQueryCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35883,8 +35758,7 @@ func (c *ProjectsLocationsDataStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadatastore) if err != nil { return nil, err } @@ -35988,12 +35862,11 @@ func (c *ProjectsLocationsDataStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36101,12 +35974,11 @@ func (c *ProjectsLocationsDataStoresGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36213,12 +36085,11 @@ func (c *ProjectsLocationsDataStoresGetSiteSearchEngineCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36352,12 +36223,11 @@ func (c *ProjectsLocationsDataStoresListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/dataStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36484,8 +36354,7 @@ func (c *ProjectsLocationsDataStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadatastore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadatastore) if err != nil { return nil, err } @@ -36616,12 +36485,11 @@ func (c *ProjectsLocationsDataStoresBranchesBatchGetDocumentsMetadataCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/batchGetDocumentsMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36729,8 +36597,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadocument) if err != nil { return nil, err } @@ -36834,12 +36701,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36947,12 +36813,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37049,8 +36914,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.H func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) if err != nil { return nil, err } @@ -37186,12 +37050,11 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37323,8 +37186,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.He func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadocument) if err != nil { return nil, err } @@ -37432,8 +37294,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.He func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) if err != nil { return nil, err } @@ -37542,8 +37403,7 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsCancelCall) Header() http. func (c *ProjectsLocationsDataStoresBranchesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -37656,12 +37516,11 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37785,12 +37644,11 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37909,8 +37767,7 @@ func (c *ProjectsLocationsDataStoresCompletionConfigCompleteQueryCall) Header() func (c *ProjectsLocationsDataStoresCompletionConfigCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaadvancedcompletequeryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaadvancedcompletequeryrequest) if err != nil { return nil, err } @@ -38013,8 +37870,7 @@ func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Header() ht func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest) if err != nil { return nil, err } @@ -38117,8 +37973,7 @@ func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Header() htt func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest) if err != nil { return nil, err } @@ -38234,8 +38089,7 @@ func (c *ProjectsLocationsDataStoresControlsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacontrol) if err != nil { return nil, err } @@ -38337,12 +38191,11 @@ func (c *ProjectsLocationsDataStoresControlsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -38447,12 +38300,11 @@ func (c *ProjectsLocationsDataStoresControlsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38582,12 +38434,11 @@ func (c *ProjectsLocationsDataStoresControlsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -38712,8 +38563,7 @@ func (c *ProjectsLocationsDataStoresControlsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacontrol) if err != nil { return nil, err } @@ -38820,8 +38670,7 @@ func (c *ProjectsLocationsDataStoresConversationsConverseCall) Header() http.Hea func (c *ProjectsLocationsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconverseconversationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconverseconversationrequest) if err != nil { return nil, err } @@ -38925,8 +38774,7 @@ func (c *ProjectsLocationsDataStoresConversationsCreateCall) Header() http.Heade func (c *ProjectsLocationsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconversation) if err != nil { return nil, err } @@ -39028,12 +38876,11 @@ func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Header() http.Heade func (c *ProjectsLocationsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -39138,12 +38985,11 @@ func (c *ProjectsLocationsDataStoresConversationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39280,12 +39126,11 @@ func (c *ProjectsLocationsDataStoresConversationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39412,8 +39257,7 @@ func (c *ProjectsLocationsDataStoresConversationsPatchCall) Header() http.Header func (c *ProjectsLocationsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaconversation) if err != nil { return nil, err } @@ -39526,12 +39370,11 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39655,12 +39498,11 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39786,12 +39628,11 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -39915,12 +39756,11 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40045,8 +39885,7 @@ func (c *ProjectsLocationsDataStoresSchemasCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaschema) if err != nil { return nil, err } @@ -40147,12 +39986,11 @@ func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -40257,12 +40095,11 @@ func (c *ProjectsLocationsDataStoresSchemasGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40385,12 +40222,11 @@ func (c *ProjectsLocationsDataStoresSchemasListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40515,8 +40351,7 @@ func (c *ProjectsLocationsDataStoresSchemasPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaschema) if err != nil { return nil, err } @@ -40622,8 +40457,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsAnswerCall) Header() http.Head func (c *ProjectsLocationsDataStoresServingConfigsAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaanswerqueryrequest) if err != nil { return nil, err } @@ -40737,12 +40571,11 @@ func (c *ProjectsLocationsDataStoresServingConfigsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40863,12 +40696,11 @@ func (c *ProjectsLocationsDataStoresServingConfigsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -40993,8 +40825,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsPatchCall) Header() http.Heade func (c *ProjectsLocationsDataStoresServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaservingconfig) if err != nil { return nil, err } @@ -41103,8 +40934,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.H func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betarecommendrequest) if err != nil { return nil, err } @@ -41211,8 +41041,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Header() http.Head func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } @@ -41347,8 +41176,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsSearchLiteCall) Header() http. func (c *ProjectsLocationsDataStoresServingConfigsSearchLiteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } @@ -41477,8 +41305,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsStreamAnswerCall) Header() htt func (c *ProjectsLocationsDataStoresServingConfigsStreamAnswerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaanswerqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaanswerqueryrequest) if err != nil { return nil, err } @@ -41582,8 +41409,7 @@ func (c *ProjectsLocationsDataStoresSessionsCreateCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasession) if err != nil { return nil, err } @@ -41685,12 +41511,11 @@ func (c *ProjectsLocationsDataStoresSessionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -41802,12 +41627,11 @@ func (c *ProjectsLocationsDataStoresSessionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -41946,12 +41770,11 @@ func (c *ProjectsLocationsDataStoresSessionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42076,8 +41899,7 @@ func (c *ProjectsLocationsDataStoresSessionsPatchCall) Header() http.Header { func (c *ProjectsLocationsDataStoresSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasession) if err != nil { return nil, err } @@ -42190,12 +42012,11 @@ func (c *ProjectsLocationsDataStoresSessionsAnswersGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42291,8 +42112,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCal func (c *ProjectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadisableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betadisableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -42396,8 +42216,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall func (c *ProjectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaenableadvancedsitesearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaenableadvancedsitesearchrequest) if err != nil { return nil, err } @@ -42499,8 +42318,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineRecrawlUrisCall) Header() ht func (c *ProjectsLocationsDataStoresSiteSearchEngineRecrawlUrisCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecrawlurisrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betarecrawlurisrequest) if err != nil { return nil, err } @@ -42602,8 +42420,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsCreateCall) Header() func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasitemap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasitemap) if err != nil { return nil, err } @@ -42707,12 +42524,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsDeleteCall) Header() func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -42823,12 +42639,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineSitemapsFetchCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sitemaps:fetch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -42924,8 +42739,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betabatchcreatetargetsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betabatchcreatetargetsitesrequest) if err != nil { return nil, err } @@ -43028,8 +42842,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesCreateCall) Heade func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betatargetsite) if err != nil { return nil, err } @@ -43133,12 +42946,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesDeleteCall) Heade func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -43246,12 +43058,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43377,12 +43188,11 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/targetSites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43499,8 +43309,7 @@ func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesPatchCall) Header func (c *ProjectsLocationsDataStoresSiteSearchEngineTargetSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betatargetsite) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betatargetsite) if err != nil { return nil, err } @@ -43603,8 +43412,7 @@ func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesImportCall) Header( func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportsuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportsuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -43707,8 +43515,7 @@ func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesPurgeCall) Header() func (c *ProjectsLocationsDataStoresSuggestionDenyListEntriesPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgesuggestiondenylistentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgesuggestiondenylistentriesrequest) if err != nil { return nil, err } @@ -43851,12 +43658,11 @@ func (c *ProjectsLocationsDataStoresUserEventsCollectCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -43955,8 +43761,7 @@ func (c *ProjectsLocationsDataStoresUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportusereventsrequest) if err != nil { return nil, err } @@ -44063,8 +43868,7 @@ func (c *ProjectsLocationsDataStoresUserEventsPurgeCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betapurgeusereventsrequest) if err != nil { return nil, err } @@ -44178,8 +43982,7 @@ func (c *ProjectsLocationsDataStoresUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betauserevent) if err != nil { return nil, err } @@ -44282,8 +44085,7 @@ func (c *ProjectsLocationsEvaluationsCreateCall) Header() http.Header { func (c *ProjectsLocationsEvaluationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaevaluation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaevaluation) if err != nil { return nil, err } @@ -44398,12 +44200,11 @@ func (c *ProjectsLocationsEvaluationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44529,12 +44330,11 @@ func (c *ProjectsLocationsEvaluationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44682,12 +44482,11 @@ func (c *ProjectsLocationsEvaluationsListResultsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+evaluation}:listResults") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44813,12 +44612,11 @@ func (c *ProjectsLocationsEvaluationsOperationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -44912,8 +44710,7 @@ func (c *ProjectsLocationsGroundingConfigsCheckCall) Header() http.Header { func (c *ProjectsLocationsGroundingConfigsCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betacheckgroundingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betacheckgroundingrequest) if err != nil { return nil, err } @@ -45028,12 +44825,11 @@ func (c *ProjectsLocationsIdentityMappingStoresOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45157,12 +44953,11 @@ func (c *ProjectsLocationsIdentityMappingStoresOperationsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45288,12 +45083,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45417,12 +45211,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -45538,8 +45331,7 @@ func (c *ProjectsLocationsRankingConfigsRankCall) Header() http.Header { func (c *ProjectsLocationsRankingConfigsRankCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarankrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betarankrequest) if err != nil { return nil, err } @@ -45655,8 +45447,7 @@ func (c *ProjectsLocationsSampleQuerySetsCreateCall) Header() http.Header { func (c *ProjectsLocationsSampleQuerySetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasamplequeryset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasamplequeryset) if err != nil { return nil, err } @@ -45760,12 +45551,11 @@ func (c *ProjectsLocationsSampleQuerySetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSampleQuerySetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -45873,12 +45663,11 @@ func (c *ProjectsLocationsSampleQuerySetsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46005,12 +45794,11 @@ func (c *ProjectsLocationsSampleQuerySetsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sampleQuerySets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46136,8 +45924,7 @@ func (c *ProjectsLocationsSampleQuerySetsPatchCall) Header() http.Header { func (c *ProjectsLocationsSampleQuerySetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasamplequeryset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasamplequeryset) if err != nil { return nil, err } @@ -46250,12 +46037,11 @@ func (c *ProjectsLocationsSampleQuerySetsOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46363,8 +46149,7 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesCreateCall) Header() http. func (c *ProjectsLocationsSampleQuerySetsSampleQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasamplequery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasamplequery) if err != nil { return nil, err } @@ -46468,12 +46253,11 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesDeleteCall) Header() http. func (c *ProjectsLocationsSampleQuerySetsSampleQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -46581,12 +46365,11 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46685,8 +46468,7 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesImportCall) Header() http. func (c *ProjectsLocationsSampleQuerySetsSampleQueriesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportsamplequeriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportsamplequeriesrequest) if err != nil { return nil, err } @@ -46821,12 +46603,11 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sampleQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -46952,8 +46733,7 @@ func (c *ProjectsLocationsSampleQuerySetsSampleQueriesPatchCall) Header() http.H func (c *ProjectsLocationsSampleQuerySetsSampleQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasamplequery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betasamplequery) if err != nil { return nil, err } @@ -47096,12 +46876,11 @@ func (c *ProjectsLocationsUserEventsCollectCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47200,8 +46979,7 @@ func (c *ProjectsLocationsUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betaimportusereventsrequest) if err != nil { return nil, err } @@ -47315,8 +47093,7 @@ func (c *ProjectsLocationsUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddiscoveryenginev1betauserevent) if err != nil { return nil, err } @@ -47429,12 +47206,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -47558,12 +47334,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/displayvideo/v2/displayvideo-gen.go b/displayvideo/v2/displayvideo-gen.go index cc5d34eb0bc..6facf8e1c4f 100644 --- a/displayvideo/v2/displayvideo-gen.go +++ b/displayvideo/v2/displayvideo-gen.go @@ -134,7 +134,22 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Advertisers = NewAdvertisersService(s) + s.CombinedAudiences = NewCombinedAudiencesService(s) + s.CustomBiddingAlgorithms = NewCustomBiddingAlgorithmsService(s) + s.CustomLists = NewCustomListsService(s) + s.FirstAndThirdPartyAudiences = NewFirstAndThirdPartyAudiencesService(s) + s.FloodlightGroups = NewFloodlightGroupsService(s) + s.GoogleAudiences = NewGoogleAudiencesService(s) + s.GuaranteedOrders = NewGuaranteedOrdersService(s) + s.InventorySourceGroups = NewInventorySourceGroupsService(s) + s.InventorySources = NewInventorySourcesService(s) + s.Media = NewMediaService(s) + s.Partners = NewPartnersService(s) + s.Sdfdownloadtasks = NewSdfdownloadtasksService(s) + s.TargetingTypes = NewTargetingTypesService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -153,23 +168,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Advertisers = NewAdvertisersService(s) - s.CombinedAudiences = NewCombinedAudiencesService(s) - s.CustomBiddingAlgorithms = NewCustomBiddingAlgorithmsService(s) - s.CustomLists = NewCustomListsService(s) - s.FirstAndThirdPartyAudiences = NewFirstAndThirdPartyAudiencesService(s) - s.FloodlightGroups = NewFloodlightGroupsService(s) - s.GoogleAudiences = NewGoogleAudiencesService(s) - s.GuaranteedOrders = NewGuaranteedOrdersService(s) - s.InventorySourceGroups = NewInventorySourceGroupsService(s) - s.InventorySources = NewInventorySourcesService(s) - s.Media = NewMediaService(s) - s.Partners = NewPartnersService(s) - s.Sdfdownloadtasks = NewSdfdownloadtasksService(s) - s.TargetingTypes = NewTargetingTypesService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -15365,12 +15364,11 @@ func (c *AdvertisersAuditCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}:audit") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15463,8 +15461,7 @@ func (c *AdvertisersCreateCall) Header() http.Header { func (c *AdvertisersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -15561,12 +15558,11 @@ func (c *AdvertisersDeleteCall) Header() http.Header { func (c *AdvertisersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15663,8 +15659,7 @@ func (c *AdvertisersEditAssignedTargetingOptionsCall) Header() http.Header { func (c *AdvertisersEditAssignedTargetingOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditadvertiserassignedtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditadvertiserassignedtargetingoptionsrequest) if err != nil { return nil, err } @@ -15775,12 +15770,11 @@ func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15935,12 +15929,11 @@ func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16105,12 +16098,11 @@ func (c *AdvertisersListAssignedTargetingOptionsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}:listAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16233,8 +16225,7 @@ func (c *AdvertisersPatchCall) Header() http.Header { func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -16379,8 +16370,7 @@ func (c *AdvertisersAssetsUploadCall) Header() http.Header { func (c *AdvertisersAssetsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createassetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createassetrequest) if err != nil { return nil, err } @@ -16391,14 +16381,10 @@ func (c *AdvertisersAssetsUploadCall) doRequest(alt string) (*http.Response, err urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v2/advertisers/{+advertiserId}/assets") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -16511,8 +16497,7 @@ func (c *AdvertisersCampaignsCreateCall) Header() http.Header { func (c *AdvertisersCampaignsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -16618,12 +16603,11 @@ func (c *AdvertisersCampaignsDeleteCall) Header() http.Header { func (c *AdvertisersCampaignsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/campaigns/{+campaignId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16729,12 +16713,11 @@ func (c *AdvertisersCampaignsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/campaigns/{+campaignId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16888,12 +16871,11 @@ func (c *AdvertisersCampaignsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/campaigns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17068,12 +17050,11 @@ func (c *AdvertisersCampaignsListAssignedTargetingOptionsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/campaigns/{+campaignId}:listAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17201,8 +17182,7 @@ func (c *AdvertisersCampaignsPatchCall) Header() http.Header { func (c *AdvertisersCampaignsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -17338,12 +17318,11 @@ func (c *AdvertisersCampaignsTargetingTypesAssignedTargetingOptionsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/campaigns/{+campaignId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17515,12 +17494,11 @@ func (c *AdvertisersCampaignsTargetingTypesAssignedTargetingOptionsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/campaigns/{+campaignId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17644,8 +17622,7 @@ func (c *AdvertisersChannelsCreateCall) Header() http.Header { func (c *AdvertisersChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -17765,12 +17742,11 @@ func (c *AdvertisersChannelsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/channels/{+channelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17920,12 +17896,11 @@ func (c *AdvertisersChannelsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18057,8 +18032,7 @@ func (c *AdvertisersChannelsPatchCall) Header() http.Header { func (c *AdvertisersChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -18164,8 +18138,7 @@ func (c *AdvertisersChannelsSitesBulkEditCall) Header() http.Header { func (c *AdvertisersChannelsSitesBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditsitesrequest) if err != nil { return nil, err } @@ -18277,8 +18250,7 @@ func (c *AdvertisersChannelsSitesCreateCall) Header() http.Header { func (c *AdvertisersChannelsSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -18390,12 +18362,11 @@ func (c *AdvertisersChannelsSitesDeleteCall) Header() http.Header { func (c *AdvertisersChannelsSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{advertiserId}/channels/{+channelId}/sites/{+urlOrAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18549,12 +18520,11 @@ func (c *AdvertisersChannelsSitesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/channels/{+channelId}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18677,8 +18647,7 @@ func (c *AdvertisersChannelsSitesReplaceCall) Header() http.Header { func (c *AdvertisersChannelsSitesReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replacesitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replacesitesrequest) if err != nil { return nil, err } @@ -18784,8 +18753,7 @@ func (c *AdvertisersCreativesCreateCall) Header() http.Header { func (c *AdvertisersCreativesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -18891,12 +18859,11 @@ func (c *AdvertisersCreativesDeleteCall) Header() http.Header { func (c *AdvertisersCreativesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/creatives/{+creativeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19002,12 +18969,11 @@ func (c *AdvertisersCreativesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/creatives/{+creativeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19180,12 +19146,11 @@ func (c *AdvertisersCreativesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19314,8 +19279,7 @@ func (c *AdvertisersCreativesPatchCall) Header() http.Header { func (c *AdvertisersCreativesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -19418,8 +19382,7 @@ func (c *AdvertisersInsertionOrdersCreateCall) Header() http.Header { func (c *AdvertisersInsertionOrdersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertionorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.insertionorder) if err != nil { return nil, err } @@ -19523,12 +19486,11 @@ func (c *AdvertisersInsertionOrdersDeleteCall) Header() http.Header { func (c *AdvertisersInsertionOrdersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19635,12 +19597,11 @@ func (c *AdvertisersInsertionOrdersGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19796,12 +19757,11 @@ func (c *AdvertisersInsertionOrdersListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19978,12 +19938,11 @@ func (c *AdvertisersInsertionOrdersListAssignedTargetingOptionsCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}:listAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20113,8 +20072,7 @@ func (c *AdvertisersInsertionOrdersPatchCall) Header() http.Header { func (c *AdvertisersInsertionOrdersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertionorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.insertionorder) if err != nil { return nil, err } @@ -20242,8 +20200,7 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsCreateC func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -20374,12 +20331,11 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsDeleteC func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20522,12 +20478,11 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20712,12 +20667,11 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20884,12 +20838,11 @@ func (c *AdvertisersInvoicesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/invoices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21022,12 +20975,11 @@ func (c *AdvertisersInvoicesLookupInvoiceCurrencyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/invoices:lookupInvoiceCurrency") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21128,8 +21080,7 @@ func (c *AdvertisersLineItemsBulkEditAssignedTargetingOptionsCall) Header() http func (c *AdvertisersLineItemsBulkEditAssignedTargetingOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassignedtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassignedtargetingoptionsrequest) if err != nil { return nil, err } @@ -21301,12 +21252,11 @@ func (c *AdvertisersLineItemsBulkListAssignedTargetingOptionsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems:bulkListAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21424,8 +21374,7 @@ func (c *AdvertisersLineItemsBulkUpdateCall) Header() http.Header { func (c *AdvertisersLineItemsBulkUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkupdatelineitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkupdatelineitemsrequest) if err != nil { return nil, err } @@ -21529,8 +21478,7 @@ func (c *AdvertisersLineItemsCreateCall) Header() http.Header { func (c *AdvertisersLineItemsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lineitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lineitem) if err != nil { return nil, err } @@ -21634,12 +21582,11 @@ func (c *AdvertisersLineItemsDeleteCall) Header() http.Header { func (c *AdvertisersLineItemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems/{+lineItemId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21740,8 +21687,7 @@ func (c *AdvertisersLineItemsDuplicateCall) Header() http.Header { func (c *AdvertisersLineItemsDuplicateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.duplicatelineitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.duplicatelineitemrequest) if err != nil { return nil, err } @@ -21849,8 +21795,7 @@ func (c *AdvertisersLineItemsGenerateDefaultCall) Header() http.Header { func (c *AdvertisersLineItemsGenerateDefaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedefaultlineitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatedefaultlineitemrequest) if err != nil { return nil, err } @@ -21963,12 +21908,11 @@ func (c *AdvertisersLineItemsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems/{+lineItemId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22126,12 +22070,11 @@ func (c *AdvertisersLineItemsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22266,8 +22209,7 @@ func (c *AdvertisersLineItemsPatchCall) Header() http.Header { func (c *AdvertisersLineItemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lineitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lineitem) if err != nil { return nil, err } @@ -22406,8 +22348,7 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsCreateCall) H func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -22550,12 +22491,11 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsDeleteCall) H func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems/{+lineItemId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22702,12 +22642,11 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems/{+lineItemId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22896,12 +22835,11 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/lineItems/{+lineItemId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23019,8 +22957,7 @@ func (c *AdvertisersLocationListsCreateCall) Header() http.Header { func (c *AdvertisersLocationListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.locationlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.locationlist) if err != nil { return nil, err } @@ -23134,12 +23071,11 @@ func (c *AdvertisersLocationListsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/locationLists/{+locationListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23286,12 +23222,11 @@ func (c *AdvertisersLocationListsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/locationLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23418,8 +23353,7 @@ func (c *AdvertisersLocationListsPatchCall) Header() http.Header { func (c *AdvertisersLocationListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.locationlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.locationlist) if err != nil { return nil, err } @@ -23528,8 +23462,7 @@ func (c *AdvertisersLocationListsAssignedLocationsBulkEditCall) Header() http.He func (c *AdvertisersLocationListsAssignedLocationsBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassignedlocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassignedlocationsrequest) if err != nil { return nil, err } @@ -23636,8 +23569,7 @@ func (c *AdvertisersLocationListsAssignedLocationsCreateCall) Header() http.Head func (c *AdvertisersLocationListsAssignedLocationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedlocation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedlocation) if err != nil { return nil, err } @@ -23745,12 +23677,11 @@ func (c *AdvertisersLocationListsAssignedLocationsDeleteCall) Header() http.Head func (c *AdvertisersLocationListsAssignedLocationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{advertiserId}/locationLists/{locationListId}/assignedLocations/{+assignedLocationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23899,12 +23830,11 @@ func (c *AdvertisersLocationListsAssignedLocationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{advertiserId}/locationLists/{locationListId}/assignedLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24028,8 +23958,7 @@ func (c *AdvertisersManualTriggersActivateCall) Header() http.Header { func (c *AdvertisersManualTriggersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatemanualtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatemanualtriggerrequest) if err != nil { return nil, err } @@ -24136,8 +24065,7 @@ func (c *AdvertisersManualTriggersCreateCall) Header() http.Header { func (c *AdvertisersManualTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.manualtrigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.manualtrigger) if err != nil { return nil, err } @@ -24244,8 +24172,7 @@ func (c *AdvertisersManualTriggersDeactivateCall) Header() http.Header { func (c *AdvertisersManualTriggersDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatemanualtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatemanualtriggerrequest) if err != nil { return nil, err } @@ -24363,12 +24290,11 @@ func (c *AdvertisersManualTriggersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/manualTriggers/{+triggerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24519,12 +24445,11 @@ func (c *AdvertisersManualTriggersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/manualTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24654,8 +24579,7 @@ func (c *AdvertisersManualTriggersPatchCall) Header() http.Header { func (c *AdvertisersManualTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.manualtrigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.manualtrigger) if err != nil { return nil, err } @@ -24758,8 +24682,7 @@ func (c *AdvertisersNegativeKeywordListsCreateCall) Header() http.Header { func (c *AdvertisersNegativeKeywordListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.negativekeywordlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.negativekeywordlist) if err != nil { return nil, err } @@ -24863,12 +24786,11 @@ func (c *AdvertisersNegativeKeywordListsDeleteCall) Header() http.Header { func (c *AdvertisersNegativeKeywordListsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/negativeKeywordLists/{+negativeKeywordListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24976,12 +24898,11 @@ func (c *AdvertisersNegativeKeywordListsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/negativeKeywordLists/{+negativeKeywordListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25104,12 +25025,11 @@ func (c *AdvertisersNegativeKeywordListsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/negativeKeywordLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25236,8 +25156,7 @@ func (c *AdvertisersNegativeKeywordListsPatchCall) Header() http.Header { func (c *AdvertisersNegativeKeywordListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.negativekeywordlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.negativekeywordlist) if err != nil { return nil, err } @@ -25350,8 +25269,7 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsBulkEditCall) Header() h func (c *AdvertisersNegativeKeywordListsNegativeKeywordsBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditnegativekeywordsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditnegativekeywordsrequest) if err != nil { return nil, err } @@ -25458,8 +25376,7 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsCreateCall) Header() htt func (c *AdvertisersNegativeKeywordListsNegativeKeywordsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.negativekeyword) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.negativekeyword) if err != nil { return nil, err } @@ -25567,12 +25484,11 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsDeleteCall) Header() htt func (c *AdvertisersNegativeKeywordListsNegativeKeywordsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{advertiserId}/negativeKeywordLists/{+negativeKeywordListId}/negativeKeywords/{+keywordValue}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25721,12 +25637,11 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/negativeKeywordLists/{+negativeKeywordListId}/negativeKeywords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25848,8 +25763,7 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsReplaceCall) Header() ht func (c *AdvertisersNegativeKeywordListsNegativeKeywordsReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replacenegativekeywordsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replacenegativekeywordsrequest) if err != nil { return nil, err } @@ -25958,8 +25872,7 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsCreateCall) Header() h func (c *AdvertisersTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -26069,12 +25982,11 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsDeleteCall) Header() h func (c *AdvertisersTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26191,12 +26103,11 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26351,12 +26262,11 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26484,12 +26394,11 @@ func (c *AdvertisersYoutubeAdGroupAdsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroupAds/{+youtubeAdGroupAdId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26639,12 +26548,11 @@ func (c *AdvertisersYoutubeAdGroupAdsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroupAds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26826,12 +26734,11 @@ func (c *AdvertisersYoutubeAdGroupsBulkListAdGroupAssignedTargetingOptionsCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroups:bulkListAdGroupAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26958,12 +26865,11 @@ func (c *AdvertisersYoutubeAdGroupsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroups/{+youtubeAdGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27113,12 +27019,11 @@ func (c *AdvertisersYoutubeAdGroupsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27262,12 +27167,11 @@ func (c *AdvertisersYoutubeAdGroupsTargetingTypesAssignedTargetingOptionsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroups/{+youtubeAdGroupId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27431,12 +27335,11 @@ func (c *AdvertisersYoutubeAdGroupsTargetingTypesAssignedTargetingOptionsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/advertisers/{+advertiserId}/youtubeAdGroups/{+youtubeAdGroupId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27576,12 +27479,11 @@ func (c *CombinedAudiencesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/combinedAudiences/{+combinedAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27736,12 +27638,11 @@ func (c *CombinedAudiencesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/combinedAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27849,8 +27750,7 @@ func (c *CustomBiddingAlgorithmsCreateCall) Header() http.Header { func (c *CustomBiddingAlgorithmsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingalgorithm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingalgorithm) if err != nil { return nil, err } @@ -27972,12 +27872,11 @@ func (c *CustomBiddingAlgorithmsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customBiddingAlgorithms/{+customBiddingAlgorithmId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28137,12 +28036,11 @@ func (c *CustomBiddingAlgorithmsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customBiddingAlgorithms") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28262,8 +28160,7 @@ func (c *CustomBiddingAlgorithmsPatchCall) Header() http.Header { func (c *CustomBiddingAlgorithmsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingalgorithm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingalgorithm) if err != nil { return nil, err } @@ -28393,12 +28290,11 @@ func (c *CustomBiddingAlgorithmsUploadScriptCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customBiddingAlgorithms/{+customBiddingAlgorithmId}:uploadScript") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28508,8 +28404,7 @@ func (c *CustomBiddingAlgorithmsScriptsCreateCall) Header() http.Header { func (c *CustomBiddingAlgorithmsScriptsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingscript) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingscript) if err != nil { return nil, err } @@ -28639,12 +28534,11 @@ func (c *CustomBiddingAlgorithmsScriptsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customBiddingAlgorithms/{+customBiddingAlgorithmId}/scripts/{+customBiddingScriptId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28792,12 +28686,11 @@ func (c *CustomBiddingAlgorithmsScriptsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customBiddingAlgorithms/{+customBiddingAlgorithmId}/scripts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28928,12 +28821,11 @@ func (c *CustomListsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customLists/{+customListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29078,12 +28970,11 @@ func (c *CustomListsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/customLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29199,8 +29090,7 @@ func (c *FirstAndThirdPartyAudiencesCreateCall) Header() http.Header { func (c *FirstAndThirdPartyAudiencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firstandthirdpartyaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firstandthirdpartyaudience) if err != nil { return nil, err } @@ -29301,8 +29191,7 @@ func (c *FirstAndThirdPartyAudiencesEditCustomerMatchMembersCall) Header() http. func (c *FirstAndThirdPartyAudiencesEditCustomerMatchMembersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.editcustomermatchmembersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.editcustomermatchmembersrequest) if err != nil { return nil, err } @@ -29428,12 +29317,11 @@ func (c *FirstAndThirdPartyAudiencesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/firstAndThirdPartyAudiences/{+firstAndThirdPartyAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29589,12 +29477,11 @@ func (c *FirstAndThirdPartyAudiencesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/firstAndThirdPartyAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29723,8 +29610,7 @@ func (c *FirstAndThirdPartyAudiencesPatchCall) Header() http.Header { func (c *FirstAndThirdPartyAudiencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firstandthirdpartyaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firstandthirdpartyaudience) if err != nil { return nil, err } @@ -29842,12 +29728,11 @@ func (c *FloodlightGroupsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/floodlightGroups/{+floodlightGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29956,8 +29841,7 @@ func (c *FloodlightGroupsPatchCall) Header() http.Header { func (c *FloodlightGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightgroup) if err != nil { return nil, err } @@ -30079,12 +29963,11 @@ func (c *FloodlightGroupsFloodlightActivitiesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/floodlightGroups/{+floodlightGroupId}/floodlightActivities/{+floodlightActivityId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30224,12 +30107,11 @@ func (c *FloodlightGroupsFloodlightActivitiesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/floodlightGroups/{+floodlightGroupId}/floodlightActivities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30367,12 +30249,11 @@ func (c *GoogleAudiencesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/googleAudiences/{+googleAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30526,12 +30407,11 @@ func (c *GoogleAudiencesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/googleAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30653,8 +30533,7 @@ func (c *GuaranteedOrdersCreateCall) Header() http.Header { func (c *GuaranteedOrdersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guaranteedorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guaranteedorder) if err != nil { return nil, err } @@ -30754,8 +30633,7 @@ func (c *GuaranteedOrdersEditGuaranteedOrderReadAccessorsCall) Header() http.Hea func (c *GuaranteedOrdersEditGuaranteedOrderReadAccessorsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.editguaranteedorderreadaccessorsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.editguaranteedorderreadaccessorsrequest) if err != nil { return nil, err } @@ -30881,12 +30759,11 @@ func (c *GuaranteedOrdersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/guaranteedOrders/{+guaranteedOrderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31045,12 +30922,11 @@ func (c *GuaranteedOrdersListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/guaranteedOrders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31185,8 +31061,7 @@ func (c *GuaranteedOrdersPatchCall) Header() http.Header { func (c *GuaranteedOrdersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guaranteedorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guaranteedorder) if err != nil { return nil, err } @@ -31301,8 +31176,7 @@ func (c *InventorySourceGroupsCreateCall) Header() http.Header { func (c *InventorySourceGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysourcegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysourcegroup) if err != nil { return nil, err } @@ -31414,12 +31288,11 @@ func (c *InventorySourceGroupsDeleteCall) Header() http.Header { func (c *InventorySourceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySourceGroups/{+inventorySourceGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31538,12 +31411,11 @@ func (c *InventorySourceGroupsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySourceGroups/{+inventorySourceGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31699,12 +31571,11 @@ func (c *InventorySourceGroupsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySourceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31840,8 +31711,7 @@ func (c *InventorySourceGroupsPatchCall) Header() http.Header { func (c *InventorySourceGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysourcegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysourcegroup) if err != nil { return nil, err } @@ -31948,8 +31818,7 @@ func (c *InventorySourceGroupsAssignedInventorySourcesBulkEditCall) Header() htt func (c *InventorySourceGroupsAssignedInventorySourcesBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassignedinventorysourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassignedinventorysourcesrequest) if err != nil { return nil, err } @@ -32068,8 +31937,7 @@ func (c *InventorySourceGroupsAssignedInventorySourcesCreateCall) Header() http. func (c *InventorySourceGroupsAssignedInventorySourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedinventorysource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedinventorysource) if err != nil { return nil, err } @@ -32190,12 +32058,11 @@ func (c *InventorySourceGroupsAssignedInventorySourcesDeleteCall) Header() http. func (c *InventorySourceGroupsAssignedInventorySourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySourceGroups/{+inventorySourceGroupId}/assignedInventorySources/{+assignedInventorySourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32357,12 +32224,11 @@ func (c *InventorySourceGroupsAssignedInventorySourcesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySourceGroups/{+inventorySourceGroupId}/assignedInventorySources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32487,8 +32353,7 @@ func (c *InventorySourcesCreateCall) Header() http.Header { func (c *InventorySourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysource) if err != nil { return nil, err } @@ -32588,8 +32453,7 @@ func (c *InventorySourcesEditInventorySourceReadWriteAccessorsCall) Header() htt func (c *InventorySourcesEditInventorySourceReadWriteAccessorsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.editinventorysourcereadwriteaccessorsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.editinventorysourcereadwriteaccessorsrequest) if err != nil { return nil, err } @@ -32707,12 +32571,11 @@ func (c *InventorySourcesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySources/{+inventorySourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32872,12 +32735,11 @@ func (c *InventorySourcesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/inventorySources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33011,8 +32873,7 @@ func (c *InventorySourcesPatchCall) Header() http.Header { func (c *InventorySourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysource) if err != nil { return nil, err } @@ -33126,12 +32987,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "download/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33283,8 +33143,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlebytestreammedia) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlebytestreammedia) if err != nil { return nil, err } @@ -33295,14 +33154,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/media/{+resourceName}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -33417,8 +33272,7 @@ func (c *PartnersEditAssignedTargetingOptionsCall) Header() http.Header { func (c *PartnersEditAssignedTargetingOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditpartnerassignedtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditpartnerassignedtargetingoptionsrequest) if err != nil { return nil, err } @@ -33529,12 +33383,11 @@ func (c *PartnersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33673,12 +33526,11 @@ func (c *PartnersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33797,8 +33649,7 @@ func (c *PartnersChannelsCreateCall) Header() http.Header { func (c *PartnersChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -33918,12 +33769,11 @@ func (c *PartnersChannelsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}/channels/{+channelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34073,12 +33923,11 @@ func (c *PartnersChannelsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34210,8 +34059,7 @@ func (c *PartnersChannelsPatchCall) Header() http.Header { func (c *PartnersChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -34317,8 +34165,7 @@ func (c *PartnersChannelsSitesBulkEditCall) Header() http.Header { func (c *PartnersChannelsSitesBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditsitesrequest) if err != nil { return nil, err } @@ -34430,8 +34277,7 @@ func (c *PartnersChannelsSitesCreateCall) Header() http.Header { func (c *PartnersChannelsSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -34543,12 +34389,11 @@ func (c *PartnersChannelsSitesDeleteCall) Header() http.Header { func (c *PartnersChannelsSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{partnerId}/channels/{+channelId}/sites/{+urlOrAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34702,12 +34547,11 @@ func (c *PartnersChannelsSitesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}/channels/{+channelId}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34830,8 +34674,7 @@ func (c *PartnersChannelsSitesReplaceCall) Header() http.Header { func (c *PartnersChannelsSitesReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replacesitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replacesitesrequest) if err != nil { return nil, err } @@ -34938,8 +34781,7 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsCreateCall) Header() http func (c *PartnersTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -35047,12 +34889,11 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsDeleteCall) Header() http func (c *PartnersTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35165,12 +35006,11 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35322,12 +35162,11 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partners/{+partnerId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35445,8 +35284,7 @@ func (c *SdfdownloadtasksCreateCall) Header() http.Header { func (c *SdfdownloadtasksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createsdfdownloadtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createsdfdownloadtaskrequest) if err != nil { return nil, err } @@ -35554,12 +35392,11 @@ func (c *SdfdownloadtasksOperationsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35686,12 +35523,11 @@ func (c *TargetingTypesTargetingOptionsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/targetingTypes/{+targetingType}/targetingOptions/{+targetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35865,12 +35701,11 @@ func (c *TargetingTypesTargetingOptionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/targetingTypes/{+targetingType}/targetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35987,8 +35822,7 @@ func (c *TargetingTypesTargetingOptionsSearchCall) Header() http.Header { func (c *TargetingTypesTargetingOptionsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchtargetingoptionsrequest) if err != nil { return nil, err } @@ -36118,8 +35952,7 @@ func (c *UsersBulkEditAssignedUserRolesCall) Header() http.Header { func (c *UsersBulkEditAssignedUserRolesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassigneduserrolesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassigneduserrolesrequest) if err != nil { return nil, err } @@ -36220,8 +36053,7 @@ func (c *UsersCreateCall) Header() http.Header { func (c *UsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -36319,12 +36151,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{+userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -36429,12 +36260,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{+userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36595,12 +36425,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36722,8 +36551,7 @@ func (c *UsersPatchCall) Header() http.Header { func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } diff --git a/displayvideo/v3/displayvideo-gen.go b/displayvideo/v3/displayvideo-gen.go index a0f344163d1..87f7ad5e7ec 100644 --- a/displayvideo/v3/displayvideo-gen.go +++ b/displayvideo/v3/displayvideo-gen.go @@ -134,7 +134,22 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Advertisers = NewAdvertisersService(s) + s.CombinedAudiences = NewCombinedAudiencesService(s) + s.CustomBiddingAlgorithms = NewCustomBiddingAlgorithmsService(s) + s.CustomLists = NewCustomListsService(s) + s.FirstAndThirdPartyAudiences = NewFirstAndThirdPartyAudiencesService(s) + s.FloodlightGroups = NewFloodlightGroupsService(s) + s.GoogleAudiences = NewGoogleAudiencesService(s) + s.GuaranteedOrders = NewGuaranteedOrdersService(s) + s.InventorySourceGroups = NewInventorySourceGroupsService(s) + s.InventorySources = NewInventorySourcesService(s) + s.Media = NewMediaService(s) + s.Partners = NewPartnersService(s) + s.Sdfdownloadtasks = NewSdfdownloadtasksService(s) + s.TargetingTypes = NewTargetingTypesService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -153,23 +168,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Advertisers = NewAdvertisersService(s) - s.CombinedAudiences = NewCombinedAudiencesService(s) - s.CustomBiddingAlgorithms = NewCustomBiddingAlgorithmsService(s) - s.CustomLists = NewCustomListsService(s) - s.FirstAndThirdPartyAudiences = NewFirstAndThirdPartyAudiencesService(s) - s.FloodlightGroups = NewFloodlightGroupsService(s) - s.GoogleAudiences = NewGoogleAudiencesService(s) - s.GuaranteedOrders = NewGuaranteedOrdersService(s) - s.InventorySourceGroups = NewInventorySourceGroupsService(s) - s.InventorySources = NewInventorySourcesService(s) - s.Media = NewMediaService(s) - s.Partners = NewPartnersService(s) - s.Sdfdownloadtasks = NewSdfdownloadtasksService(s) - s.TargetingTypes = NewTargetingTypesService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -16191,12 +16190,11 @@ func (c *AdvertisersAuditCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}:audit") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16289,8 +16287,7 @@ func (c *AdvertisersCreateCall) Header() http.Header { func (c *AdvertisersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -16387,12 +16384,11 @@ func (c *AdvertisersDeleteCall) Header() http.Header { func (c *AdvertisersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16489,8 +16485,7 @@ func (c *AdvertisersEditAssignedTargetingOptionsCall) Header() http.Header { func (c *AdvertisersEditAssignedTargetingOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditadvertiserassignedtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditadvertiserassignedtargetingoptionsrequest) if err != nil { return nil, err } @@ -16601,12 +16596,11 @@ func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16761,12 +16755,11 @@ func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16931,12 +16924,11 @@ func (c *AdvertisersListAssignedTargetingOptionsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}:listAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17059,8 +17051,7 @@ func (c *AdvertisersPatchCall) Header() http.Header { func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advertiser) if err != nil { return nil, err } @@ -17173,12 +17164,11 @@ func (c *AdvertisersAdGroupAdsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroupAds/{+adGroupAdId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17327,12 +17317,11 @@ func (c *AdvertisersAdGroupAdsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroupAds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17514,12 +17503,11 @@ func (c *AdvertisersAdGroupsBulkListAdGroupAssignedTargetingOptionsCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroups:bulkListAdGroupAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17646,12 +17634,11 @@ func (c *AdvertisersAdGroupsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroups/{+adGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17800,12 +17787,11 @@ func (c *AdvertisersAdGroupsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17949,12 +17935,11 @@ func (c *AdvertisersAdGroupsTargetingTypesAssignedTargetingOptionsGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroups/{+adGroupId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18117,12 +18102,11 @@ func (c *AdvertisersAdGroupsTargetingTypesAssignedTargetingOptionsListCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/adGroups/{+adGroupId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18283,8 +18267,7 @@ func (c *AdvertisersAssetsUploadCall) Header() http.Header { func (c *AdvertisersAssetsUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createassetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createassetrequest) if err != nil { return nil, err } @@ -18295,14 +18278,10 @@ func (c *AdvertisersAssetsUploadCall) doRequest(alt string) (*http.Response, err urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v3/advertisers/{+advertiserId}/assets") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -18415,8 +18394,7 @@ func (c *AdvertisersCampaignsCreateCall) Header() http.Header { func (c *AdvertisersCampaignsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -18522,12 +18500,11 @@ func (c *AdvertisersCampaignsDeleteCall) Header() http.Header { func (c *AdvertisersCampaignsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/campaigns/{+campaignId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18633,12 +18610,11 @@ func (c *AdvertisersCampaignsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/campaigns/{+campaignId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18792,12 +18768,11 @@ func (c *AdvertisersCampaignsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/campaigns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18972,12 +18947,11 @@ func (c *AdvertisersCampaignsListAssignedTargetingOptionsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/campaigns/{+campaignId}:listAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19105,8 +19079,7 @@ func (c *AdvertisersCampaignsPatchCall) Header() http.Header { func (c *AdvertisersCampaignsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.campaign) if err != nil { return nil, err } @@ -19242,12 +19215,11 @@ func (c *AdvertisersCampaignsTargetingTypesAssignedTargetingOptionsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/campaigns/{+campaignId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19419,12 +19391,11 @@ func (c *AdvertisersCampaignsTargetingTypesAssignedTargetingOptionsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/campaigns/{+campaignId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19548,8 +19519,7 @@ func (c *AdvertisersChannelsCreateCall) Header() http.Header { func (c *AdvertisersChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -19669,12 +19639,11 @@ func (c *AdvertisersChannelsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/channels/{+channelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19824,12 +19793,11 @@ func (c *AdvertisersChannelsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19961,8 +19929,7 @@ func (c *AdvertisersChannelsPatchCall) Header() http.Header { func (c *AdvertisersChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -20068,8 +20035,7 @@ func (c *AdvertisersChannelsSitesBulkEditCall) Header() http.Header { func (c *AdvertisersChannelsSitesBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditsitesrequest) if err != nil { return nil, err } @@ -20181,8 +20147,7 @@ func (c *AdvertisersChannelsSitesCreateCall) Header() http.Header { func (c *AdvertisersChannelsSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -20294,12 +20259,11 @@ func (c *AdvertisersChannelsSitesDeleteCall) Header() http.Header { func (c *AdvertisersChannelsSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{advertiserId}/channels/{+channelId}/sites/{+urlOrAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20453,12 +20417,11 @@ func (c *AdvertisersChannelsSitesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/channels/{+channelId}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20581,8 +20544,7 @@ func (c *AdvertisersChannelsSitesReplaceCall) Header() http.Header { func (c *AdvertisersChannelsSitesReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replacesitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replacesitesrequest) if err != nil { return nil, err } @@ -20688,8 +20650,7 @@ func (c *AdvertisersCreativesCreateCall) Header() http.Header { func (c *AdvertisersCreativesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -20795,12 +20756,11 @@ func (c *AdvertisersCreativesDeleteCall) Header() http.Header { func (c *AdvertisersCreativesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/creatives/{+creativeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20906,12 +20866,11 @@ func (c *AdvertisersCreativesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/creatives/{+creativeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21084,12 +21043,11 @@ func (c *AdvertisersCreativesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21218,8 +21176,7 @@ func (c *AdvertisersCreativesPatchCall) Header() http.Header { func (c *AdvertisersCreativesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -21322,8 +21279,7 @@ func (c *AdvertisersInsertionOrdersCreateCall) Header() http.Header { func (c *AdvertisersInsertionOrdersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertionorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.insertionorder) if err != nil { return nil, err } @@ -21427,12 +21383,11 @@ func (c *AdvertisersInsertionOrdersDeleteCall) Header() http.Header { func (c *AdvertisersInsertionOrdersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21539,12 +21494,11 @@ func (c *AdvertisersInsertionOrdersGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21700,12 +21654,11 @@ func (c *AdvertisersInsertionOrdersListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21882,12 +21835,11 @@ func (c *AdvertisersInsertionOrdersListAssignedTargetingOptionsCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}:listAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22017,8 +21969,7 @@ func (c *AdvertisersInsertionOrdersPatchCall) Header() http.Header { func (c *AdvertisersInsertionOrdersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertionorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.insertionorder) if err != nil { return nil, err } @@ -22146,8 +22097,7 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsCreateC func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -22278,12 +22228,11 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsDeleteC func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22426,12 +22375,11 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsGetCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22616,12 +22564,11 @@ func (c *AdvertisersInsertionOrdersTargetingTypesAssignedTargetingOptionsListCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/insertionOrders/{+insertionOrderId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22788,12 +22735,11 @@ func (c *AdvertisersInvoicesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/invoices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22926,12 +22872,11 @@ func (c *AdvertisersInvoicesLookupInvoiceCurrencyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/invoices:lookupInvoiceCurrency") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23032,8 +22977,7 @@ func (c *AdvertisersLineItemsBulkEditAssignedTargetingOptionsCall) Header() http func (c *AdvertisersLineItemsBulkEditAssignedTargetingOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassignedtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassignedtargetingoptionsrequest) if err != nil { return nil, err } @@ -23205,12 +23149,11 @@ func (c *AdvertisersLineItemsBulkListAssignedTargetingOptionsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems:bulkListAssignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23328,8 +23271,7 @@ func (c *AdvertisersLineItemsBulkUpdateCall) Header() http.Header { func (c *AdvertisersLineItemsBulkUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkupdatelineitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkupdatelineitemsrequest) if err != nil { return nil, err } @@ -23433,8 +23375,7 @@ func (c *AdvertisersLineItemsCreateCall) Header() http.Header { func (c *AdvertisersLineItemsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lineitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lineitem) if err != nil { return nil, err } @@ -23538,12 +23479,11 @@ func (c *AdvertisersLineItemsDeleteCall) Header() http.Header { func (c *AdvertisersLineItemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems/{+lineItemId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23644,8 +23584,7 @@ func (c *AdvertisersLineItemsDuplicateCall) Header() http.Header { func (c *AdvertisersLineItemsDuplicateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.duplicatelineitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.duplicatelineitemrequest) if err != nil { return nil, err } @@ -23753,8 +23692,7 @@ func (c *AdvertisersLineItemsGenerateDefaultCall) Header() http.Header { func (c *AdvertisersLineItemsGenerateDefaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedefaultlineitemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generatedefaultlineitemrequest) if err != nil { return nil, err } @@ -23867,12 +23805,11 @@ func (c *AdvertisersLineItemsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems/{+lineItemId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24030,12 +23967,11 @@ func (c *AdvertisersLineItemsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24170,8 +24106,7 @@ func (c *AdvertisersLineItemsPatchCall) Header() http.Header { func (c *AdvertisersLineItemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lineitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lineitem) if err != nil { return nil, err } @@ -24310,8 +24245,7 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsCreateCall) H func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -24454,12 +24388,11 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsDeleteCall) H func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems/{+lineItemId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24606,12 +24539,11 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems/{+lineItemId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24800,12 +24732,11 @@ func (c *AdvertisersLineItemsTargetingTypesAssignedTargetingOptionsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/lineItems/{+lineItemId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24923,8 +24854,7 @@ func (c *AdvertisersLocationListsCreateCall) Header() http.Header { func (c *AdvertisersLocationListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.locationlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.locationlist) if err != nil { return nil, err } @@ -25038,12 +24968,11 @@ func (c *AdvertisersLocationListsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/locationLists/{+locationListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25190,12 +25119,11 @@ func (c *AdvertisersLocationListsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/locationLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25322,8 +25250,7 @@ func (c *AdvertisersLocationListsPatchCall) Header() http.Header { func (c *AdvertisersLocationListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.locationlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.locationlist) if err != nil { return nil, err } @@ -25432,8 +25359,7 @@ func (c *AdvertisersLocationListsAssignedLocationsBulkEditCall) Header() http.He func (c *AdvertisersLocationListsAssignedLocationsBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassignedlocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassignedlocationsrequest) if err != nil { return nil, err } @@ -25540,8 +25466,7 @@ func (c *AdvertisersLocationListsAssignedLocationsCreateCall) Header() http.Head func (c *AdvertisersLocationListsAssignedLocationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedlocation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedlocation) if err != nil { return nil, err } @@ -25649,12 +25574,11 @@ func (c *AdvertisersLocationListsAssignedLocationsDeleteCall) Header() http.Head func (c *AdvertisersLocationListsAssignedLocationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{advertiserId}/locationLists/{locationListId}/assignedLocations/{+assignedLocationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25803,12 +25727,11 @@ func (c *AdvertisersLocationListsAssignedLocationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{advertiserId}/locationLists/{locationListId}/assignedLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25925,8 +25848,7 @@ func (c *AdvertisersNegativeKeywordListsCreateCall) Header() http.Header { func (c *AdvertisersNegativeKeywordListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.negativekeywordlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.negativekeywordlist) if err != nil { return nil, err } @@ -26030,12 +25952,11 @@ func (c *AdvertisersNegativeKeywordListsDeleteCall) Header() http.Header { func (c *AdvertisersNegativeKeywordListsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/negativeKeywordLists/{+negativeKeywordListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26143,12 +26064,11 @@ func (c *AdvertisersNegativeKeywordListsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/negativeKeywordLists/{+negativeKeywordListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26271,12 +26191,11 @@ func (c *AdvertisersNegativeKeywordListsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/negativeKeywordLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26403,8 +26322,7 @@ func (c *AdvertisersNegativeKeywordListsPatchCall) Header() http.Header { func (c *AdvertisersNegativeKeywordListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.negativekeywordlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.negativekeywordlist) if err != nil { return nil, err } @@ -26517,8 +26435,7 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsBulkEditCall) Header() h func (c *AdvertisersNegativeKeywordListsNegativeKeywordsBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditnegativekeywordsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditnegativekeywordsrequest) if err != nil { return nil, err } @@ -26625,8 +26542,7 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsCreateCall) Header() htt func (c *AdvertisersNegativeKeywordListsNegativeKeywordsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.negativekeyword) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.negativekeyword) if err != nil { return nil, err } @@ -26734,12 +26650,11 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsDeleteCall) Header() htt func (c *AdvertisersNegativeKeywordListsNegativeKeywordsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{advertiserId}/negativeKeywordLists/{+negativeKeywordListId}/negativeKeywords/{+keywordValue}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26888,12 +26803,11 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/negativeKeywordLists/{+negativeKeywordListId}/negativeKeywords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27015,8 +26929,7 @@ func (c *AdvertisersNegativeKeywordListsNegativeKeywordsReplaceCall) Header() ht func (c *AdvertisersNegativeKeywordListsNegativeKeywordsReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replacenegativekeywordsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replacenegativekeywordsrequest) if err != nil { return nil, err } @@ -27125,8 +27038,7 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsCreateCall) Header() h func (c *AdvertisersTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -27236,12 +27148,11 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsDeleteCall) Header() h func (c *AdvertisersTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27358,12 +27269,11 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27518,12 +27428,11 @@ func (c *AdvertisersTargetingTypesAssignedTargetingOptionsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/advertisers/{+advertiserId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27662,12 +27571,11 @@ func (c *CombinedAudiencesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/combinedAudiences/{+combinedAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27822,12 +27730,11 @@ func (c *CombinedAudiencesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/combinedAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27935,8 +27842,7 @@ func (c *CustomBiddingAlgorithmsCreateCall) Header() http.Header { func (c *CustomBiddingAlgorithmsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingalgorithm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingalgorithm) if err != nil { return nil, err } @@ -28058,12 +27964,11 @@ func (c *CustomBiddingAlgorithmsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28223,12 +28128,11 @@ func (c *CustomBiddingAlgorithmsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28348,8 +28252,7 @@ func (c *CustomBiddingAlgorithmsPatchCall) Header() http.Header { func (c *CustomBiddingAlgorithmsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingalgorithm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingalgorithm) if err != nil { return nil, err } @@ -28478,12 +28381,11 @@ func (c *CustomBiddingAlgorithmsUploadRulesCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}:uploadRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28605,12 +28507,11 @@ func (c *CustomBiddingAlgorithmsUploadScriptCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}:uploadScript") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28720,8 +28621,7 @@ func (c *CustomBiddingAlgorithmsRulesCreateCall) Header() http.Header { func (c *CustomBiddingAlgorithmsRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingalgorithmrules) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingalgorithmrules) if err != nil { return nil, err } @@ -28850,12 +28750,11 @@ func (c *CustomBiddingAlgorithmsRulesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}/rules/{+customBiddingAlgorithmRulesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29002,12 +28901,11 @@ func (c *CustomBiddingAlgorithmsRulesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29138,8 +29036,7 @@ func (c *CustomBiddingAlgorithmsScriptsCreateCall) Header() http.Header { func (c *CustomBiddingAlgorithmsScriptsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.custombiddingscript) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.custombiddingscript) if err != nil { return nil, err } @@ -29269,12 +29166,11 @@ func (c *CustomBiddingAlgorithmsScriptsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}/scripts/{+customBiddingScriptId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29422,12 +29318,11 @@ func (c *CustomBiddingAlgorithmsScriptsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customBiddingAlgorithms/{+customBiddingAlgorithmId}/scripts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29558,12 +29453,11 @@ func (c *CustomListsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customLists/{+customListId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29708,12 +29602,11 @@ func (c *CustomListsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/customLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29829,8 +29722,7 @@ func (c *FirstAndThirdPartyAudiencesCreateCall) Header() http.Header { func (c *FirstAndThirdPartyAudiencesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firstandthirdpartyaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firstandthirdpartyaudience) if err != nil { return nil, err } @@ -29931,8 +29823,7 @@ func (c *FirstAndThirdPartyAudiencesEditCustomerMatchMembersCall) Header() http. func (c *FirstAndThirdPartyAudiencesEditCustomerMatchMembersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.editcustomermatchmembersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.editcustomermatchmembersrequest) if err != nil { return nil, err } @@ -30058,12 +29949,11 @@ func (c *FirstAndThirdPartyAudiencesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/firstAndThirdPartyAudiences/{+firstAndThirdPartyAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30219,12 +30109,11 @@ func (c *FirstAndThirdPartyAudiencesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/firstAndThirdPartyAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30353,8 +30242,7 @@ func (c *FirstAndThirdPartyAudiencesPatchCall) Header() http.Header { func (c *FirstAndThirdPartyAudiencesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firstandthirdpartyaudience) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firstandthirdpartyaudience) if err != nil { return nil, err } @@ -30472,12 +30360,11 @@ func (c *FloodlightGroupsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/floodlightGroups/{+floodlightGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30586,8 +30473,7 @@ func (c *FloodlightGroupsPatchCall) Header() http.Header { func (c *FloodlightGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.floodlightgroup) if err != nil { return nil, err } @@ -30709,12 +30595,11 @@ func (c *FloodlightGroupsFloodlightActivitiesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/floodlightGroups/{+floodlightGroupId}/floodlightActivities/{+floodlightActivityId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30854,12 +30739,11 @@ func (c *FloodlightGroupsFloodlightActivitiesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/floodlightGroups/{+floodlightGroupId}/floodlightActivities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30997,12 +30881,11 @@ func (c *GoogleAudiencesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/googleAudiences/{+googleAudienceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31156,12 +31039,11 @@ func (c *GoogleAudiencesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/googleAudiences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31283,8 +31165,7 @@ func (c *GuaranteedOrdersCreateCall) Header() http.Header { func (c *GuaranteedOrdersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guaranteedorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guaranteedorder) if err != nil { return nil, err } @@ -31384,8 +31265,7 @@ func (c *GuaranteedOrdersEditGuaranteedOrderReadAccessorsCall) Header() http.Hea func (c *GuaranteedOrdersEditGuaranteedOrderReadAccessorsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.editguaranteedorderreadaccessorsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.editguaranteedorderreadaccessorsrequest) if err != nil { return nil, err } @@ -31511,12 +31391,11 @@ func (c *GuaranteedOrdersGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/guaranteedOrders/{+guaranteedOrderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31675,12 +31554,11 @@ func (c *GuaranteedOrdersListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/guaranteedOrders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31815,8 +31693,7 @@ func (c *GuaranteedOrdersPatchCall) Header() http.Header { func (c *GuaranteedOrdersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guaranteedorder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guaranteedorder) if err != nil { return nil, err } @@ -31931,8 +31808,7 @@ func (c *InventorySourceGroupsCreateCall) Header() http.Header { func (c *InventorySourceGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysourcegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysourcegroup) if err != nil { return nil, err } @@ -32044,12 +31920,11 @@ func (c *InventorySourceGroupsDeleteCall) Header() http.Header { func (c *InventorySourceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySourceGroups/{+inventorySourceGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32168,12 +32043,11 @@ func (c *InventorySourceGroupsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySourceGroups/{+inventorySourceGroupId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32329,12 +32203,11 @@ func (c *InventorySourceGroupsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySourceGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32470,8 +32343,7 @@ func (c *InventorySourceGroupsPatchCall) Header() http.Header { func (c *InventorySourceGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysourcegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysourcegroup) if err != nil { return nil, err } @@ -32578,8 +32450,7 @@ func (c *InventorySourceGroupsAssignedInventorySourcesBulkEditCall) Header() htt func (c *InventorySourceGroupsAssignedInventorySourcesBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassignedinventorysourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassignedinventorysourcesrequest) if err != nil { return nil, err } @@ -32698,8 +32569,7 @@ func (c *InventorySourceGroupsAssignedInventorySourcesCreateCall) Header() http. func (c *InventorySourceGroupsAssignedInventorySourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedinventorysource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedinventorysource) if err != nil { return nil, err } @@ -32820,12 +32690,11 @@ func (c *InventorySourceGroupsAssignedInventorySourcesDeleteCall) Header() http. func (c *InventorySourceGroupsAssignedInventorySourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySourceGroups/{+inventorySourceGroupId}/assignedInventorySources/{+assignedInventorySourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32987,12 +32856,11 @@ func (c *InventorySourceGroupsAssignedInventorySourcesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySourceGroups/{+inventorySourceGroupId}/assignedInventorySources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33117,8 +32985,7 @@ func (c *InventorySourcesCreateCall) Header() http.Header { func (c *InventorySourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysource) if err != nil { return nil, err } @@ -33218,8 +33085,7 @@ func (c *InventorySourcesEditInventorySourceReadWriteAccessorsCall) Header() htt func (c *InventorySourcesEditInventorySourceReadWriteAccessorsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.editinventorysourcereadwriteaccessorsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.editinventorysourcereadwriteaccessorsrequest) if err != nil { return nil, err } @@ -33346,12 +33212,11 @@ func (c *InventorySourcesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySources/{+inventorySourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33511,12 +33376,11 @@ func (c *InventorySourcesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/inventorySources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33650,8 +33514,7 @@ func (c *InventorySourcesPatchCall) Header() http.Header { func (c *InventorySourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inventorysource) if err != nil { return nil, err } @@ -33765,12 +33628,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "download/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33922,8 +33784,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlebytestreammedia) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlebytestreammedia) if err != nil { return nil, err } @@ -33934,14 +33795,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/media/{+resourceName}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -34056,8 +33913,7 @@ func (c *PartnersEditAssignedTargetingOptionsCall) Header() http.Header { func (c *PartnersEditAssignedTargetingOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditpartnerassignedtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditpartnerassignedtargetingoptionsrequest) if err != nil { return nil, err } @@ -34168,12 +34024,11 @@ func (c *PartnersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34312,12 +34167,11 @@ func (c *PartnersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34436,8 +34290,7 @@ func (c *PartnersChannelsCreateCall) Header() http.Header { func (c *PartnersChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -34557,12 +34410,11 @@ func (c *PartnersChannelsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}/channels/{+channelId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34712,12 +34564,11 @@ func (c *PartnersChannelsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34849,8 +34700,7 @@ func (c *PartnersChannelsPatchCall) Header() http.Header { func (c *PartnersChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -34956,8 +34806,7 @@ func (c *PartnersChannelsSitesBulkEditCall) Header() http.Header { func (c *PartnersChannelsSitesBulkEditCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditsitesrequest) if err != nil { return nil, err } @@ -35069,8 +34918,7 @@ func (c *PartnersChannelsSitesCreateCall) Header() http.Header { func (c *PartnersChannelsSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -35182,12 +35030,11 @@ func (c *PartnersChannelsSitesDeleteCall) Header() http.Header { func (c *PartnersChannelsSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{partnerId}/channels/{+channelId}/sites/{+urlOrAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35341,12 +35188,11 @@ func (c *PartnersChannelsSitesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}/channels/{+channelId}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35469,8 +35315,7 @@ func (c *PartnersChannelsSitesReplaceCall) Header() http.Header { func (c *PartnersChannelsSitesReplaceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.replacesitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.replacesitesrequest) if err != nil { return nil, err } @@ -35577,8 +35422,7 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsCreateCall) Header() http func (c *PartnersTargetingTypesAssignedTargetingOptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assignedtargetingoption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assignedtargetingoption) if err != nil { return nil, err } @@ -35686,12 +35530,11 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsDeleteCall) Header() http func (c *PartnersTargetingTypesAssignedTargetingOptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35804,12 +35647,11 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}/targetingTypes/{+targetingType}/assignedTargetingOptions/{+assignedTargetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35961,12 +35803,11 @@ func (c *PartnersTargetingTypesAssignedTargetingOptionsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/partners/{+partnerId}/targetingTypes/{+targetingType}/assignedTargetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36084,8 +35925,7 @@ func (c *SdfdownloadtasksCreateCall) Header() http.Header { func (c *SdfdownloadtasksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createsdfdownloadtaskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createsdfdownloadtaskrequest) if err != nil { return nil, err } @@ -36193,12 +36033,11 @@ func (c *SdfdownloadtasksOperationsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36325,12 +36164,11 @@ func (c *TargetingTypesTargetingOptionsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/targetingTypes/{+targetingType}/targetingOptions/{+targetingOptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36504,12 +36342,11 @@ func (c *TargetingTypesTargetingOptionsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/targetingTypes/{+targetingType}/targetingOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -36626,8 +36463,7 @@ func (c *TargetingTypesTargetingOptionsSearchCall) Header() http.Header { func (c *TargetingTypesTargetingOptionsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchtargetingoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchtargetingoptionsrequest) if err != nil { return nil, err } @@ -36757,8 +36593,7 @@ func (c *UsersBulkEditAssignedUserRolesCall) Header() http.Header { func (c *UsersBulkEditAssignedUserRolesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkeditassigneduserrolesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkeditassigneduserrolesrequest) if err != nil { return nil, err } @@ -36859,8 +36694,7 @@ func (c *UsersCreateCall) Header() http.Header { func (c *UsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -36958,12 +36792,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{+userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -37068,12 +36901,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{+userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37234,12 +37066,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -37361,8 +37192,7 @@ func (c *UsersPatchCall) Header() http.Header { func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } diff --git a/dlp/v2/dlp-gen.go b/dlp/v2/dlp-gen.go index 57fcf20a3a9..2ac80d38cd0 100644 --- a/dlp/v2/dlp-gen.go +++ b/dlp/v2/dlp-gen.go @@ -117,7 +117,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.InfoTypes = NewInfoTypesService(s) + s.Locations = NewLocationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,12 +140,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.InfoTypes = NewInfoTypesService(s) - s.Locations = NewLocationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -11029,12 +11028,11 @@ func (c *InfoTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/infoTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11160,12 +11158,11 @@ func (c *LocationsInfoTypesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/infoTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11274,8 +11271,7 @@ func (c *OrganizationsDeidentifyTemplatesCreateCall) Header() http.Header { func (c *OrganizationsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createdeidentifytemplaterequest) if err != nil { return nil, err } @@ -11379,12 +11375,11 @@ func (c *OrganizationsDeidentifyTemplatesDeleteCall) Header() http.Header { func (c *OrganizationsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11491,12 +11486,11 @@ func (c *OrganizationsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11649,12 +11643,11 @@ func (c *OrganizationsDeidentifyTemplatesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11772,8 +11765,7 @@ func (c *OrganizationsDeidentifyTemplatesPatchCall) Header() http.Header { func (c *OrganizationsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatedeidentifytemplaterequest) if err != nil { return nil, err } @@ -11890,8 +11882,7 @@ func (c *OrganizationsInspectTemplatesCreateCall) Header() http.Header { func (c *OrganizationsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createinspecttemplaterequest) if err != nil { return nil, err } @@ -11994,12 +11985,11 @@ func (c *OrganizationsInspectTemplatesDeleteCall) Header() http.Header { func (c *OrganizationsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12106,12 +12096,11 @@ func (c *OrganizationsInspectTemplatesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12264,12 +12253,11 @@ func (c *OrganizationsInspectTemplatesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12387,8 +12375,7 @@ func (c *OrganizationsInspectTemplatesPatchCall) Header() http.Header { func (c *OrganizationsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updateinspecttemplaterequest) if err != nil { return nil, err } @@ -12500,12 +12487,11 @@ func (c *OrganizationsLocationsColumnDataProfilesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12664,12 +12650,11 @@ func (c *OrganizationsLocationsColumnDataProfilesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/columnDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12786,8 +12771,7 @@ func (c *OrganizationsLocationsConnectionsCreateCall) Header() http.Header { func (c *OrganizationsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createconnectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createconnectionrequest) if err != nil { return nil, err } @@ -12887,12 +12871,11 @@ func (c *OrganizationsLocationsConnectionsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12996,12 +12979,11 @@ func (c *OrganizationsLocationsConnectionsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13129,12 +13111,11 @@ func (c *OrganizationsLocationsConnectionsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13249,8 +13230,7 @@ func (c *OrganizationsLocationsConnectionsPatchCall) Header() http.Header { func (c *OrganizationsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateconnectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updateconnectionrequest) if err != nil { return nil, err } @@ -13385,12 +13365,11 @@ func (c *OrganizationsLocationsConnectionsSearchCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13520,8 +13499,7 @@ func (c *OrganizationsLocationsDeidentifyTemplatesCreateCall) Header() http.Head func (c *OrganizationsLocationsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createdeidentifytemplaterequest) if err != nil { return nil, err } @@ -13625,12 +13603,11 @@ func (c *OrganizationsLocationsDeidentifyTemplatesDeleteCall) Header() http.Head func (c *OrganizationsLocationsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13737,12 +13714,11 @@ func (c *OrganizationsLocationsDeidentifyTemplatesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13895,12 +13871,11 @@ func (c *OrganizationsLocationsDeidentifyTemplatesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14018,8 +13993,7 @@ func (c *OrganizationsLocationsDeidentifyTemplatesPatchCall) Header() http.Heade func (c *OrganizationsLocationsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatedeidentifytemplaterequest) if err != nil { return nil, err } @@ -14126,8 +14100,7 @@ func (c *OrganizationsLocationsDiscoveryConfigsCreateCall) Header() http.Header func (c *OrganizationsLocationsDiscoveryConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2creatediscoveryconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2creatediscoveryconfigrequest) if err != nil { return nil, err } @@ -14227,12 +14200,11 @@ func (c *OrganizationsLocationsDiscoveryConfigsDeleteCall) Header() http.Header func (c *OrganizationsLocationsDiscoveryConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14336,12 +14308,11 @@ func (c *OrganizationsLocationsDiscoveryConfigsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14475,12 +14446,11 @@ func (c *OrganizationsLocationsDiscoveryConfigsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/discoveryConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14595,8 +14565,7 @@ func (c *OrganizationsLocationsDiscoveryConfigsPatchCall) Header() http.Header { func (c *OrganizationsLocationsDiscoveryConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatediscoveryconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatediscoveryconfigrequest) if err != nil { return nil, err } @@ -14788,12 +14757,11 @@ func (c *OrganizationsLocationsDlpJobsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14907,12 +14875,11 @@ func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) Header() http.He func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15016,12 +14983,11 @@ func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15182,12 +15148,11 @@ func (c *OrganizationsLocationsFileStoreDataProfilesListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/fileStoreDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15317,8 +15282,7 @@ func (c *OrganizationsLocationsInspectTemplatesCreateCall) Header() http.Header func (c *OrganizationsLocationsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createinspecttemplaterequest) if err != nil { return nil, err } @@ -15421,12 +15385,11 @@ func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Header() http.Header func (c *OrganizationsLocationsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15533,12 +15496,11 @@ func (c *OrganizationsLocationsInspectTemplatesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15691,12 +15653,11 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15814,8 +15775,7 @@ func (c *OrganizationsLocationsInspectTemplatesPatchCall) Header() http.Header { func (c *OrganizationsLocationsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updateinspecttemplaterequest) if err != nil { return nil, err } @@ -15928,8 +15888,7 @@ func (c *OrganizationsLocationsJobTriggersCreateCall) Header() http.Header { func (c *OrganizationsLocationsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createjobtriggerrequest) if err != nil { return nil, err } @@ -16031,12 +15990,11 @@ func (c *OrganizationsLocationsJobTriggersDeleteCall) Header() http.Header { func (c *OrganizationsLocationsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16142,12 +16100,11 @@ func (c *OrganizationsLocationsJobTriggersGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16331,12 +16288,11 @@ func (c *OrganizationsLocationsJobTriggersListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16453,8 +16409,7 @@ func (c *OrganizationsLocationsJobTriggersPatchCall) Header() http.Header { func (c *OrganizationsLocationsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatejobtriggerrequest) if err != nil { return nil, err } @@ -16566,12 +16521,11 @@ func (c *OrganizationsLocationsProjectDataProfilesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16719,12 +16673,11 @@ func (c *OrganizationsLocationsProjectDataProfilesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/projectDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16853,8 +16806,7 @@ func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Header() http.Header { func (c *OrganizationsLocationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createstoredinfotyperequest) if err != nil { return nil, err } @@ -16957,12 +16909,11 @@ func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Header() http.Header { func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17069,12 +17020,11 @@ func (c *OrganizationsLocationsStoredInfoTypesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17224,12 +17174,11 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17348,8 +17297,7 @@ func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Header() http.Header { func (c *OrganizationsLocationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatestoredinfotyperequest) if err != nil { return nil, err } @@ -17449,12 +17397,11 @@ func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Header() http.Header func (c *OrganizationsLocationsTableDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17558,12 +17505,11 @@ func (c *OrganizationsLocationsTableDataProfilesGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17721,12 +17667,11 @@ func (c *OrganizationsLocationsTableDataProfilesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tableDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17855,8 +17800,7 @@ func (c *OrganizationsStoredInfoTypesCreateCall) Header() http.Header { func (c *OrganizationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createstoredinfotyperequest) if err != nil { return nil, err } @@ -17959,12 +17903,11 @@ func (c *OrganizationsStoredInfoTypesDeleteCall) Header() http.Header { func (c *OrganizationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18071,12 +18014,11 @@ func (c *OrganizationsStoredInfoTypesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18226,12 +18168,11 @@ func (c *OrganizationsStoredInfoTypesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18350,8 +18291,7 @@ func (c *OrganizationsStoredInfoTypesPatchCall) Header() http.Header { func (c *OrganizationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatestoredinfotyperequest) if err != nil { return nil, err } @@ -18467,8 +18407,7 @@ func (c *ProjectsContentDeidentifyCall) Header() http.Header { func (c *ProjectsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2deidentifycontentrequest) if err != nil { return nil, err } @@ -18584,8 +18523,7 @@ func (c *ProjectsContentInspectCall) Header() http.Header { func (c *ProjectsContentInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2inspectcontentrequest) if err != nil { return nil, err } @@ -18697,8 +18635,7 @@ func (c *ProjectsContentReidentifyCall) Header() http.Header { func (c *ProjectsContentReidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2reidentifycontentrequest) if err != nil { return nil, err } @@ -18815,8 +18752,7 @@ func (c *ProjectsDeidentifyTemplatesCreateCall) Header() http.Header { func (c *ProjectsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createdeidentifytemplaterequest) if err != nil { return nil, err } @@ -18920,12 +18856,11 @@ func (c *ProjectsDeidentifyTemplatesDeleteCall) Header() http.Header { func (c *ProjectsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19032,12 +18967,11 @@ func (c *ProjectsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19190,12 +19124,11 @@ func (c *ProjectsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19313,8 +19246,7 @@ func (c *ProjectsDeidentifyTemplatesPatchCall) Header() http.Header { func (c *ProjectsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatedeidentifytemplaterequest) if err != nil { return nil, err } @@ -19421,8 +19353,7 @@ func (c *ProjectsDlpJobsCancelCall) Header() http.Header { func (c *ProjectsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2canceldlpjobrequest) if err != nil { return nil, err } @@ -19538,8 +19469,7 @@ func (c *ProjectsDlpJobsCreateCall) Header() http.Header { func (c *ProjectsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createdlpjobrequest) if err != nil { return nil, err } @@ -19644,12 +19574,11 @@ func (c *ProjectsDlpJobsDeleteCall) Header() http.Header { func (c *ProjectsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19756,12 +19685,11 @@ func (c *ProjectsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19945,12 +19873,11 @@ func (c *ProjectsDlpJobsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20079,8 +20006,7 @@ func (c *ProjectsImageRedactCall) Header() http.Header { func (c *ProjectsImageRedactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2redactimagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2redactimagerequest) if err != nil { return nil, err } @@ -20197,8 +20123,7 @@ func (c *ProjectsInspectTemplatesCreateCall) Header() http.Header { func (c *ProjectsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createinspecttemplaterequest) if err != nil { return nil, err } @@ -20301,12 +20226,11 @@ func (c *ProjectsInspectTemplatesDeleteCall) Header() http.Header { func (c *ProjectsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20413,12 +20337,11 @@ func (c *ProjectsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20571,12 +20494,11 @@ func (c *ProjectsInspectTemplatesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20694,8 +20616,7 @@ func (c *ProjectsInspectTemplatesPatchCall) Header() http.Header { func (c *ProjectsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updateinspecttemplaterequest) if err != nil { return nil, err } @@ -20798,8 +20719,7 @@ func (c *ProjectsJobTriggersActivateCall) Header() http.Header { func (c *ProjectsJobTriggersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2activatejobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2activatejobtriggerrequest) if err != nil { return nil, err } @@ -20912,8 +20832,7 @@ func (c *ProjectsJobTriggersCreateCall) Header() http.Header { func (c *ProjectsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createjobtriggerrequest) if err != nil { return nil, err } @@ -21015,12 +20934,11 @@ func (c *ProjectsJobTriggersDeleteCall) Header() http.Header { func (c *ProjectsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21126,12 +21044,11 @@ func (c *ProjectsJobTriggersGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21315,12 +21232,11 @@ func (c *ProjectsJobTriggersListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21437,8 +21353,7 @@ func (c *ProjectsJobTriggersPatchCall) Header() http.Header { func (c *ProjectsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatejobtriggerrequest) if err != nil { return nil, err } @@ -21550,12 +21465,11 @@ func (c *ProjectsLocationsColumnDataProfilesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21714,12 +21628,11 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/columnDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21836,8 +21749,7 @@ func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createconnectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createconnectionrequest) if err != nil { return nil, err } @@ -21937,12 +21849,11 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22046,12 +21957,11 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22179,12 +22089,11 @@ func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22299,8 +22208,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateconnectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updateconnectionrequest) if err != nil { return nil, err } @@ -22435,12 +22343,11 @@ func (c *ProjectsLocationsConnectionsSearchCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22569,8 +22476,7 @@ func (c *ProjectsLocationsContentDeidentifyCall) Header() http.Header { func (c *ProjectsLocationsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2deidentifycontentrequest) if err != nil { return nil, err } @@ -22686,8 +22592,7 @@ func (c *ProjectsLocationsContentInspectCall) Header() http.Header { func (c *ProjectsLocationsContentInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2inspectcontentrequest) if err != nil { return nil, err } @@ -22799,8 +22704,7 @@ func (c *ProjectsLocationsContentReidentifyCall) Header() http.Header { func (c *ProjectsLocationsContentReidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2reidentifycontentrequest) if err != nil { return nil, err } @@ -22917,8 +22821,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createdeidentifytemplaterequest) if err != nil { return nil, err } @@ -23022,12 +22925,11 @@ func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23134,12 +23036,11 @@ func (c *ProjectsLocationsDeidentifyTemplatesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23292,12 +23193,11 @@ func (c *ProjectsLocationsDeidentifyTemplatesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23415,8 +23315,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Header() http.Header { func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatedeidentifytemplaterequest) if err != nil { return nil, err } @@ -23523,8 +23422,7 @@ func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2creatediscoveryconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2creatediscoveryconfigrequest) if err != nil { return nil, err } @@ -23624,12 +23522,11 @@ func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23733,12 +23630,11 @@ func (c *ProjectsLocationsDiscoveryConfigsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23872,12 +23768,11 @@ func (c *ProjectsLocationsDiscoveryConfigsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/discoveryConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23992,8 +23887,7 @@ func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatediscoveryconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatediscoveryconfigrequest) if err != nil { return nil, err } @@ -24100,8 +23994,7 @@ func (c *ProjectsLocationsDlpJobsCancelCall) Header() http.Header { func (c *ProjectsLocationsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2canceldlpjobrequest) if err != nil { return nil, err } @@ -24217,8 +24110,7 @@ func (c *ProjectsLocationsDlpJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createdlpjobrequest) if err != nil { return nil, err } @@ -24323,12 +24215,11 @@ func (c *ProjectsLocationsDlpJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24422,8 +24313,7 @@ func (c *ProjectsLocationsDlpJobsFinishCall) Header() http.Header { func (c *ProjectsLocationsDlpJobsFinishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2finishdlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2finishdlpjobrequest) if err != nil { return nil, err } @@ -24538,12 +24428,11 @@ func (c *ProjectsLocationsDlpJobsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24638,8 +24527,7 @@ func (c *ProjectsLocationsDlpJobsHybridInspectCall) Header() http.Header { func (c *ProjectsLocationsDlpJobsHybridInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2hybridinspectdlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2hybridinspectdlpjobrequest) if err != nil { return nil, err } @@ -24831,12 +24719,11 @@ func (c *ProjectsLocationsDlpJobsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24950,12 +24837,11 @@ func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) Header() http.Header func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25059,12 +24945,11 @@ func (c *ProjectsLocationsFileStoreDataProfilesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25225,12 +25110,11 @@ func (c *ProjectsLocationsFileStoreDataProfilesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/fileStoreDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25359,8 +25243,7 @@ func (c *ProjectsLocationsImageRedactCall) Header() http.Header { func (c *ProjectsLocationsImageRedactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2redactimagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2redactimagerequest) if err != nil { return nil, err } @@ -25477,8 +25360,7 @@ func (c *ProjectsLocationsInspectTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createinspecttemplaterequest) if err != nil { return nil, err } @@ -25581,12 +25463,11 @@ func (c *ProjectsLocationsInspectTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25693,12 +25574,11 @@ func (c *ProjectsLocationsInspectTemplatesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25851,12 +25731,11 @@ func (c *ProjectsLocationsInspectTemplatesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25974,8 +25853,7 @@ func (c *ProjectsLocationsInspectTemplatesPatchCall) Header() http.Header { func (c *ProjectsLocationsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updateinspecttemplaterequest) if err != nil { return nil, err } @@ -26078,8 +25956,7 @@ func (c *ProjectsLocationsJobTriggersActivateCall) Header() http.Header { func (c *ProjectsLocationsJobTriggersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2activatejobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2activatejobtriggerrequest) if err != nil { return nil, err } @@ -26192,8 +26069,7 @@ func (c *ProjectsLocationsJobTriggersCreateCall) Header() http.Header { func (c *ProjectsLocationsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createjobtriggerrequest) if err != nil { return nil, err } @@ -26295,12 +26171,11 @@ func (c *ProjectsLocationsJobTriggersDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26406,12 +26281,11 @@ func (c *ProjectsLocationsJobTriggersGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26507,8 +26381,7 @@ func (c *ProjectsLocationsJobTriggersHybridInspectCall) Header() http.Header { func (c *ProjectsLocationsJobTriggersHybridInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2hybridinspectjobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2hybridinspectjobtriggerrequest) if err != nil { return nil, err } @@ -26700,12 +26573,11 @@ func (c *ProjectsLocationsJobTriggersListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26822,8 +26694,7 @@ func (c *ProjectsLocationsJobTriggersPatchCall) Header() http.Header { func (c *ProjectsLocationsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatejobtriggerrequest) if err != nil { return nil, err } @@ -26935,12 +26806,11 @@ func (c *ProjectsLocationsProjectDataProfilesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27088,12 +26958,11 @@ func (c *ProjectsLocationsProjectDataProfilesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/projectDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27222,8 +27091,7 @@ func (c *ProjectsLocationsStoredInfoTypesCreateCall) Header() http.Header { func (c *ProjectsLocationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createstoredinfotyperequest) if err != nil { return nil, err } @@ -27326,12 +27194,11 @@ func (c *ProjectsLocationsStoredInfoTypesDeleteCall) Header() http.Header { func (c *ProjectsLocationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27438,12 +27305,11 @@ func (c *ProjectsLocationsStoredInfoTypesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27593,12 +27459,11 @@ func (c *ProjectsLocationsStoredInfoTypesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27717,8 +27582,7 @@ func (c *ProjectsLocationsStoredInfoTypesPatchCall) Header() http.Header { func (c *ProjectsLocationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatestoredinfotyperequest) if err != nil { return nil, err } @@ -27818,12 +27682,11 @@ func (c *ProjectsLocationsTableDataProfilesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTableDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27927,12 +27790,11 @@ func (c *ProjectsLocationsTableDataProfilesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28090,12 +27952,11 @@ func (c *ProjectsLocationsTableDataProfilesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tableDataProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28224,8 +28085,7 @@ func (c *ProjectsStoredInfoTypesCreateCall) Header() http.Header { func (c *ProjectsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2createstoredinfotyperequest) if err != nil { return nil, err } @@ -28328,12 +28188,11 @@ func (c *ProjectsStoredInfoTypesDeleteCall) Header() http.Header { func (c *ProjectsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28440,12 +28299,11 @@ func (c *ProjectsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28595,12 +28453,11 @@ func (c *ProjectsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28719,8 +28576,7 @@ func (c *ProjectsStoredInfoTypesPatchCall) Header() http.Header { func (c *ProjectsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleprivacydlpv2updatestoredinfotyperequest) if err != nil { return nil, err } diff --git a/dns/v1/dns-gen.go b/dns/v1/dns-gen.go index 6068a09d91d..a8c1572820f 100644 --- a/dns/v1/dns-gen.go +++ b/dns/v1/dns-gen.go @@ -133,7 +133,16 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Changes = NewChangesService(s) + s.DnsKeys = NewDnsKeysService(s) + s.ManagedZoneOperations = NewManagedZoneOperationsService(s) + s.ManagedZones = NewManagedZonesService(s) + s.Policies = NewPoliciesService(s) + s.Projects = NewProjectsService(s) + s.ResourceRecordSets = NewResourceRecordSetsService(s) + s.ResponsePolicies = NewResponsePoliciesService(s) + s.ResponsePolicyRules = NewResponsePolicyRulesService(s) if err != nil { return nil, err } @@ -152,17 +161,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Changes = NewChangesService(s) - s.DnsKeys = NewDnsKeysService(s) - s.ManagedZoneOperations = NewManagedZoneOperationsService(s) - s.ManagedZones = NewManagedZonesService(s) - s.Policies = NewPoliciesService(s) - s.Projects = NewProjectsService(s) - s.ResourceRecordSets = NewResourceRecordSetsService(s) - s.ResponsePolicies = NewResponsePoliciesService(s) - s.ResponsePolicyRules = NewResponsePolicyRulesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2695,8 +2694,7 @@ func (c *ChangesCreateCall) Header() http.Header { func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.change) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.change) if err != nil { return nil, err } @@ -2823,12 +2821,11 @@ func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/changes/{changeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2970,12 +2967,11 @@ func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/changes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3123,12 +3119,11 @@ func (c *DnsKeysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3260,12 +3255,11 @@ func (c *DnsKeysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/dnsKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3405,12 +3399,11 @@ func (c *ManagedZoneOperationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3545,12 +3538,11 @@ func (c *ManagedZoneOperationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3673,8 +3665,7 @@ func (c *ManagedZonesCreateCall) Header() http.Header { func (c *ManagedZonesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -3784,12 +3775,11 @@ func (c *ManagedZonesDeleteCall) Header() http.Header { func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3881,12 +3871,11 @@ func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3982,8 +3971,7 @@ func (c *ManagedZonesGetIamPolicyCall) Header() http.Header { func (c *ManagedZonesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1getiampolicyrequest) if err != nil { return nil, err } @@ -4117,12 +4105,11 @@ func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4248,8 +4235,7 @@ func (c *ManagedZonesPatchCall) Header() http.Header { func (c *ManagedZonesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -4354,8 +4340,7 @@ func (c *ManagedZonesSetIamPolicyCall) Header() http.Header { func (c *ManagedZonesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -4463,8 +4448,7 @@ func (c *ManagedZonesTestIamPermissionsCall) Header() http.Header { func (c *ManagedZonesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -4577,8 +4561,7 @@ func (c *ManagedZonesUpdateCall) Header() http.Header { func (c *ManagedZonesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -4687,8 +4670,7 @@ func (c *PoliciesCreateCall) Header() http.Header { func (c *PoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -4798,12 +4780,11 @@ func (c *PoliciesDeleteCall) Header() http.Header { func (c *PoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/policies/{policy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4894,12 +4875,11 @@ func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/policies/{policy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5018,12 +4998,11 @@ func (c *PoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5148,8 +5127,7 @@ func (c *PoliciesPatchCall) Header() http.Header { func (c *PoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy2) if err != nil { return nil, err } @@ -5262,8 +5240,7 @@ func (c *PoliciesUpdateCall) Header() http.Header { func (c *PoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy2) if err != nil { return nil, err } @@ -5383,12 +5360,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5492,8 +5468,7 @@ func (c *ResourceRecordSetsCreateCall) Header() http.Header { func (c *ResourceRecordSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcerecordset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcerecordset) if err != nil { return nil, err } @@ -5611,12 +5586,11 @@ func (c *ResourceRecordSetsDeleteCall) Header() http.Header { func (c *ResourceRecordSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/rrsets/{name}/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5740,12 +5714,11 @@ func (c *ResourceRecordSetsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/rrsets/{name}/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5886,12 +5859,11 @@ func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/managedZones/{managedZone}/rrsets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6024,8 +5996,7 @@ func (c *ResourceRecordSetsPatchCall) Header() http.Header { func (c *ResourceRecordSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcerecordset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcerecordset) if err != nil { return nil, err } @@ -6137,8 +6108,7 @@ func (c *ResponsePoliciesCreateCall) Header() http.Header { func (c *ResponsePoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicy) if err != nil { return nil, err } @@ -6249,12 +6219,11 @@ func (c *ResponsePoliciesDeleteCall) Header() http.Header { func (c *ResponsePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/responsePolicies/{responsePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6346,12 +6315,11 @@ func (c *ResponsePoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/responsePolicies/{responsePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6470,12 +6438,11 @@ func (c *ResponsePoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/responsePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6601,8 +6568,7 @@ func (c *ResponsePoliciesPatchCall) Header() http.Header { func (c *ResponsePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicy) if err != nil { return nil, err } @@ -6716,8 +6682,7 @@ func (c *ResponsePoliciesUpdateCall) Header() http.Header { func (c *ResponsePoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicy) if err != nil { return nil, err } @@ -6831,8 +6796,7 @@ func (c *ResponsePolicyRulesCreateCall) Header() http.Header { func (c *ResponsePolicyRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicyrule) if err != nil { return nil, err } @@ -6948,12 +6912,11 @@ func (c *ResponsePolicyRulesDeleteCall) Header() http.Header { func (c *ResponsePolicyRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/responsePolicies/{responsePolicy}/rules/{responsePolicyRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7050,12 +7013,11 @@ func (c *ResponsePolicyRulesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/responsePolicies/{responsePolicy}/rules/{responsePolicyRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7179,12 +7141,11 @@ func (c *ResponsePolicyRulesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1/projects/{project}/responsePolicies/{responsePolicy}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7315,8 +7276,7 @@ func (c *ResponsePolicyRulesPatchCall) Header() http.Header { func (c *ResponsePolicyRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicyrule) if err != nil { return nil, err } @@ -7435,8 +7395,7 @@ func (c *ResponsePolicyRulesUpdateCall) Header() http.Header { func (c *ResponsePolicyRulesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicyrule) if err != nil { return nil, err } diff --git a/dns/v1beta2/dns-gen.go b/dns/v1beta2/dns-gen.go index 082a6a15d9f..12fb12f0afd 100644 --- a/dns/v1beta2/dns-gen.go +++ b/dns/v1beta2/dns-gen.go @@ -133,7 +133,16 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Changes = NewChangesService(s) + s.DnsKeys = NewDnsKeysService(s) + s.ManagedZoneOperations = NewManagedZoneOperationsService(s) + s.ManagedZones = NewManagedZonesService(s) + s.Policies = NewPoliciesService(s) + s.Projects = NewProjectsService(s) + s.ResourceRecordSets = NewResourceRecordSetsService(s) + s.ResponsePolicies = NewResponsePoliciesService(s) + s.ResponsePolicyRules = NewResponsePolicyRulesService(s) if err != nil { return nil, err } @@ -152,17 +161,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Changes = NewChangesService(s) - s.DnsKeys = NewDnsKeysService(s) - s.ManagedZoneOperations = NewManagedZoneOperationsService(s) - s.ManagedZones = NewManagedZonesService(s) - s.Policies = NewPoliciesService(s) - s.Projects = NewProjectsService(s) - s.ResourceRecordSets = NewResourceRecordSetsService(s) - s.ResponsePolicies = NewResponsePoliciesService(s) - s.ResponsePolicyRules = NewResponsePolicyRulesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2692,8 +2691,7 @@ func (c *ChangesCreateCall) Header() http.Header { func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.change) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.change) if err != nil { return nil, err } @@ -2820,12 +2818,11 @@ func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes/{changeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2967,12 +2964,11 @@ func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3120,12 +3116,11 @@ func (c *DnsKeysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3257,12 +3252,11 @@ func (c *DnsKeysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/dnsKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3402,12 +3396,11 @@ func (c *ManagedZoneOperationsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3542,12 +3535,11 @@ func (c *ManagedZoneOperationsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3670,8 +3662,7 @@ func (c *ManagedZonesCreateCall) Header() http.Header { func (c *ManagedZonesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -3781,12 +3772,11 @@ func (c *ManagedZonesDeleteCall) Header() http.Header { func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3878,12 +3868,11 @@ func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3979,8 +3968,7 @@ func (c *ManagedZonesGetIamPolicyCall) Header() http.Header { func (c *ManagedZonesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1getiampolicyrequest) if err != nil { return nil, err } @@ -4114,12 +4102,11 @@ func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4245,8 +4232,7 @@ func (c *ManagedZonesPatchCall) Header() http.Header { func (c *ManagedZonesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -4351,8 +4337,7 @@ func (c *ManagedZonesSetIamPolicyCall) Header() http.Header { func (c *ManagedZonesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -4460,8 +4445,7 @@ func (c *ManagedZonesTestIamPermissionsCall) Header() http.Header { func (c *ManagedZonesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -4574,8 +4558,7 @@ func (c *ManagedZonesUpdateCall) Header() http.Header { func (c *ManagedZonesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedzone) if err != nil { return nil, err } @@ -4684,8 +4667,7 @@ func (c *PoliciesCreateCall) Header() http.Header { func (c *PoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -4795,12 +4777,11 @@ func (c *PoliciesDeleteCall) Header() http.Header { func (c *PoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/policies/{policy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4891,12 +4872,11 @@ func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/policies/{policy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5015,12 +4995,11 @@ func (c *PoliciesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5145,8 +5124,7 @@ func (c *PoliciesPatchCall) Header() http.Header { func (c *PoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy2) if err != nil { return nil, err } @@ -5259,8 +5237,7 @@ func (c *PoliciesUpdateCall) Header() http.Header { func (c *PoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy2) if err != nil { return nil, err } @@ -5380,12 +5357,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5489,8 +5465,7 @@ func (c *ResourceRecordSetsCreateCall) Header() http.Header { func (c *ResourceRecordSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcerecordset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcerecordset) if err != nil { return nil, err } @@ -5608,12 +5583,11 @@ func (c *ResourceRecordSetsDeleteCall) Header() http.Header { func (c *ResourceRecordSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/rrsets/{name}/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5713,12 +5687,11 @@ func (c *ResourceRecordSetsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/rrsets/{name}/{type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5859,12 +5832,11 @@ func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/managedZones/{managedZone}/rrsets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5997,8 +5969,7 @@ func (c *ResourceRecordSetsPatchCall) Header() http.Header { func (c *ResourceRecordSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcerecordset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resourcerecordset) if err != nil { return nil, err } @@ -6110,8 +6081,7 @@ func (c *ResponsePoliciesCreateCall) Header() http.Header { func (c *ResponsePoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicy) if err != nil { return nil, err } @@ -6222,12 +6192,11 @@ func (c *ResponsePoliciesDeleteCall) Header() http.Header { func (c *ResponsePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/responsePolicies/{responsePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6319,12 +6288,11 @@ func (c *ResponsePoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/responsePolicies/{responsePolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6443,12 +6411,11 @@ func (c *ResponsePoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/responsePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6574,8 +6541,7 @@ func (c *ResponsePoliciesPatchCall) Header() http.Header { func (c *ResponsePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicy) if err != nil { return nil, err } @@ -6689,8 +6655,7 @@ func (c *ResponsePoliciesUpdateCall) Header() http.Header { func (c *ResponsePoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicy) if err != nil { return nil, err } @@ -6804,8 +6769,7 @@ func (c *ResponsePolicyRulesCreateCall) Header() http.Header { func (c *ResponsePolicyRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicyrule) if err != nil { return nil, err } @@ -6921,12 +6885,11 @@ func (c *ResponsePolicyRulesDeleteCall) Header() http.Header { func (c *ResponsePolicyRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/responsePolicies/{responsePolicy}/rules/{responsePolicyRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7023,12 +6986,11 @@ func (c *ResponsePolicyRulesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/responsePolicies/{responsePolicy}/rules/{responsePolicyRule}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7152,12 +7114,11 @@ func (c *ResponsePolicyRulesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "dns/v1beta2/projects/{project}/responsePolicies/{responsePolicy}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7288,8 +7249,7 @@ func (c *ResponsePolicyRulesPatchCall) Header() http.Header { func (c *ResponsePolicyRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicyrule) if err != nil { return nil, err } @@ -7408,8 +7368,7 @@ func (c *ResponsePolicyRulesUpdateCall) Header() http.Header { func (c *ResponsePolicyRulesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.responsepolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.responsepolicyrule) if err != nil { return nil, err } diff --git a/docs/v1/docs-gen.go b/docs/v1/docs-gen.go index 8759d86ceb7..eab8c0aa0c2 100644 --- a/docs/v1/docs-gen.go +++ b/docs/v1/docs-gen.go @@ -136,7 +136,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Documents = NewDocumentsService(s) if err != nil { return nil, err } @@ -155,9 +156,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Documents = NewDocumentsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6025,8 +6024,7 @@ func (c *DocumentsBatchUpdateCall) Header() http.Header { func (c *DocumentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatedocumentrequest) if err != nil { return nil, err } @@ -6125,8 +6123,7 @@ func (c *DocumentsCreateCall) Header() http.Header { func (c *DocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.document) if err != nil { return nil, err } @@ -6279,12 +6276,11 @@ func (c *DocumentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/documents/{documentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/documentai/v1/documentai-gen.go b/documentai/v1/documentai-gen.go index 7df745d5287..6fe62b6a77d 100644 --- a/documentai/v1/documentai-gen.go +++ b/documentai/v1/documentai-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7368,12 +7367,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7478,12 +7476,11 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:fetchProcessorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7586,12 +7583,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7718,12 +7714,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7843,12 +7838,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7953,12 +7947,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8082,12 +8075,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8211,12 +8203,11 @@ func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8336,12 +8327,11 @@ func (c *ProjectsLocationsProcessorTypesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8459,8 +8449,7 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) Header() http.Header { func (c *ProjectsLocationsProcessorsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1batchprocessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1batchprocessrequest) if err != nil { return nil, err } @@ -8567,8 +8556,7 @@ func (c *ProjectsLocationsProcessorsCreateCall) Header() http.Header { func (c *ProjectsLocationsProcessorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1processor) if err != nil { return nil, err } @@ -8668,12 +8656,11 @@ func (c *ProjectsLocationsProcessorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsProcessorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8766,8 +8753,7 @@ func (c *ProjectsLocationsProcessorsDisableCall) Header() http.Header { func (c *ProjectsLocationsProcessorsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1disableprocessorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1disableprocessorrequest) if err != nil { return nil, err } @@ -8868,8 +8854,7 @@ func (c *ProjectsLocationsProcessorsEnableCall) Header() http.Header { func (c *ProjectsLocationsProcessorsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1enableprocessorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1enableprocessorrequest) if err != nil { return nil, err } @@ -8980,12 +8965,11 @@ func (c *ProjectsLocationsProcessorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9106,12 +9090,11 @@ func (c *ProjectsLocationsProcessorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9230,8 +9213,7 @@ func (c *ProjectsLocationsProcessorsProcessCall) Header() http.Header { func (c *ProjectsLocationsProcessorsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1processrequest) if err != nil { return nil, err } @@ -9333,8 +9315,7 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Header() htt func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1setdefaultprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1setdefaultprocessorversionrequest) if err != nil { return nil, err } @@ -9437,8 +9418,7 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Header( func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1reviewdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1reviewdocumentrequest) if err != nil { return nil, err } @@ -9543,8 +9523,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Header() func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1batchprocessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1batchprocessrequest) if err != nil { return nil, err } @@ -9644,12 +9623,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Header() http.H func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9742,8 +9720,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Header() http.H func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1deployprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1deployprocessorversionrequest) if err != nil { return nil, err } @@ -9847,8 +9824,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCal func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1evaluateprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1evaluateprocessorversionrequest) if err != nil { return nil, err } @@ -9959,12 +9935,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10085,12 +10060,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10209,8 +10183,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Header() http. func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1processrequest) if err != nil { return nil, err } @@ -10314,8 +10287,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) Header() http.He func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1trainprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1trainprocessorversionrequest) if err != nil { return nil, err } @@ -10416,8 +10388,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Header() http func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1undeployprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1undeployprocessorversionrequest) if err != nil { return nil, err } @@ -10530,12 +10501,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10656,12 +10626,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10787,12 +10756,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/documentai/v1beta2/documentai-gen.go b/documentai/v1beta2/documentai-gen.go index 76a5feaac8d..363b8cd39fe 100644 --- a/documentai/v1beta2/documentai-gen.go +++ b/documentai/v1beta2/documentai-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -8117,8 +8116,7 @@ func (c *ProjectsDocumentsBatchProcessCall) Header() http.Header { func (c *ProjectsDocumentsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta2batchprocessdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta2batchprocessdocumentsrequest) if err != nil { return nil, err } @@ -8222,8 +8220,7 @@ func (c *ProjectsDocumentsProcessCall) Header() http.Header { func (c *ProjectsDocumentsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta2processdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta2processdocumentrequest) if err != nil { return nil, err } @@ -8327,8 +8324,7 @@ func (c *ProjectsLocationsDocumentsBatchProcessCall) Header() http.Header { func (c *ProjectsLocationsDocumentsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta2batchprocessdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta2batchprocessdocumentsrequest) if err != nil { return nil, err } @@ -8432,8 +8428,7 @@ func (c *ProjectsLocationsDocumentsProcessCall) Header() http.Header { func (c *ProjectsLocationsDocumentsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta2processdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta2processdocumentrequest) if err != nil { return nil, err } @@ -8546,12 +8541,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8656,12 +8650,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/documentai/v1beta3/documentai-gen.go b/documentai/v1beta3/documentai-gen.go index 5017cb47537..cef7853bc52 100644 --- a/documentai/v1beta3/documentai-gen.go +++ b/documentai/v1beta3/documentai-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7955,12 +7954,11 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+parent}:fetchProcessorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8063,12 +8061,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8195,12 +8192,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8320,12 +8316,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8430,12 +8425,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8559,12 +8553,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8688,12 +8681,11 @@ func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8813,12 +8805,11 @@ func (c *ProjectsLocationsProcessorTypesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+parent}/processorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8938,8 +8929,7 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) Header() http.Header { func (c *ProjectsLocationsProcessorsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3batchprocessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3batchprocessrequest) if err != nil { return nil, err } @@ -9046,8 +9036,7 @@ func (c *ProjectsLocationsProcessorsCreateCall) Header() http.Header { func (c *ProjectsLocationsProcessorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3processor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3processor) if err != nil { return nil, err } @@ -9147,12 +9136,11 @@ func (c *ProjectsLocationsProcessorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsProcessorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9245,8 +9233,7 @@ func (c *ProjectsLocationsProcessorsDisableCall) Header() http.Header { func (c *ProjectsLocationsProcessorsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3disableprocessorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3disableprocessorrequest) if err != nil { return nil, err } @@ -9347,8 +9334,7 @@ func (c *ProjectsLocationsProcessorsEnableCall) Header() http.Header { func (c *ProjectsLocationsProcessorsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3enableprocessorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3enableprocessorrequest) if err != nil { return nil, err } @@ -9459,12 +9445,11 @@ func (c *ProjectsLocationsProcessorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9585,12 +9570,11 @@ func (c *ProjectsLocationsProcessorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+parent}/processors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9709,8 +9693,7 @@ func (c *ProjectsLocationsProcessorsProcessCall) Header() http.Header { func (c *ProjectsLocationsProcessorsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3processrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3processrequest) if err != nil { return nil, err } @@ -9812,8 +9795,7 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Header() htt func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3setdefaultprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3setdefaultprocessorversionrequest) if err != nil { return nil, err } @@ -9926,8 +9908,7 @@ func (c *ProjectsLocationsProcessorsUpdateDatasetCall) Header() http.Header { func (c *ProjectsLocationsProcessorsUpdateDatasetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3dataset) if err != nil { return nil, err } @@ -10029,8 +10010,7 @@ func (c *ProjectsLocationsProcessorsDatasetBatchDeleteDocumentsCall) Header() ht func (c *ProjectsLocationsProcessorsDatasetBatchDeleteDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3batchdeletedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3batchdeletedocumentsrequest) if err != nil { return nil, err } @@ -10150,12 +10130,11 @@ func (c *ProjectsLocationsProcessorsDatasetGetDatasetSchemaCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10340,12 +10319,11 @@ func (c *ProjectsLocationsProcessorsDatasetGetDocumentCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+dataset}:getDocument") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10439,8 +10417,7 @@ func (c *ProjectsLocationsProcessorsDatasetImportDocumentsCall) Header() http.He func (c *ProjectsLocationsProcessorsDatasetImportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3importdocumentsrequest) if err != nil { return nil, err } @@ -10542,8 +10519,7 @@ func (c *ProjectsLocationsProcessorsDatasetListDocumentsCall) Header() http.Head func (c *ProjectsLocationsProcessorsDatasetListDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3listdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3listdocumentsrequest) if err != nil { return nil, err } @@ -10674,8 +10650,7 @@ func (c *ProjectsLocationsProcessorsDatasetUpdateDatasetSchemaCall) Header() htt func (c *ProjectsLocationsProcessorsDatasetUpdateDatasetSchemaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3datasetschema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3datasetschema) if err != nil { return nil, err } @@ -10778,8 +10753,7 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Header( func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3reviewdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3reviewdocumentrequest) if err != nil { return nil, err } @@ -10884,8 +10858,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Header() func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3batchprocessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3batchprocessrequest) if err != nil { return nil, err } @@ -10985,12 +10958,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Header() http.H func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11083,8 +11055,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Header() http.H func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3deployprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3deployprocessorversionrequest) if err != nil { return nil, err } @@ -11188,8 +11159,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCal func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3evaluateprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3evaluateprocessorversionrequest) if err != nil { return nil, err } @@ -11300,12 +11270,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11400,8 +11369,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsImportProcessorVersionCall) func (c *ProjectsLocationsProcessorsProcessorVersionsImportProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3importprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3importprocessorversionrequest) if err != nil { return nil, err } @@ -11530,12 +11498,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+parent}/processorVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11654,8 +11621,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Header() http. func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3processrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3processrequest) if err != nil { return nil, err } @@ -11759,8 +11725,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) Header() http.He func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3trainprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3trainprocessorversionrequest) if err != nil { return nil, err } @@ -11861,8 +11826,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Header() http func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1beta3undeployprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleclouddocumentaiv1beta3undeployprocessorversionrequest) if err != nil { return nil, err } @@ -11975,12 +11939,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12101,12 +12064,11 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/domains/v1/domains-gen.go b/domains/v1/domains-gen.go index 9c529cbe23f..24797619f24 100644 --- a/domains/v1/domains-gen.go +++ b/domains/v1/domains-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2703,12 +2702,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2834,12 +2832,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2965,12 +2962,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3093,12 +3089,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3224,8 +3219,7 @@ func (c *ProjectsLocationsRegistrationsConfigureContactSettingsCall) Header() ht func (c *ProjectsLocationsRegistrationsConfigureContactSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configurecontactsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configurecontactsettingsrequest) if err != nil { return nil, err } @@ -3326,8 +3320,7 @@ func (c *ProjectsLocationsRegistrationsConfigureDnsSettingsCall) Header() http.H func (c *ProjectsLocationsRegistrationsConfigureDnsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configurednssettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configurednssettingsrequest) if err != nil { return nil, err } @@ -3428,8 +3421,7 @@ func (c *ProjectsLocationsRegistrationsConfigureManagementSettingsCall) Header() func (c *ProjectsLocationsRegistrationsConfigureManagementSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuremanagementsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configuremanagementsettingsrequest) if err != nil { return nil, err } @@ -3541,12 +3533,11 @@ func (c *ProjectsLocationsRegistrationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3648,8 +3639,7 @@ func (c *ProjectsLocationsRegistrationsExportCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportregistrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportregistrationrequest) if err != nil { return nil, err } @@ -3760,12 +3750,11 @@ func (c *ProjectsLocationsRegistrationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3887,12 +3876,11 @@ func (c *ProjectsLocationsRegistrationsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3992,8 +3980,7 @@ func (c *ProjectsLocationsRegistrationsImportCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdomainrequest) if err != nil { return nil, err } @@ -4103,8 +4090,7 @@ func (c *ProjectsLocationsRegistrationsInitiatePushTransferCall) Header() http.H func (c *ProjectsLocationsRegistrationsInitiatePushTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiatepushtransferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initiatepushtransferrequest) if err != nil { return nil, err } @@ -4246,12 +4232,11 @@ func (c *ProjectsLocationsRegistrationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/registrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4379,8 +4364,7 @@ func (c *ProjectsLocationsRegistrationsPatchCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registration) if err != nil { return nil, err } @@ -4489,8 +4473,7 @@ func (c *ProjectsLocationsRegistrationsRegisterCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registerdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registerdomainrequest) if err != nil { return nil, err } @@ -4594,8 +4577,7 @@ func (c *ProjectsLocationsRegistrationsRenewDomainCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsRenewDomainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renewdomainrequest) if err != nil { return nil, err } @@ -4701,8 +4683,7 @@ func (c *ProjectsLocationsRegistrationsResetAuthorizationCodeCall) Header() http func (c *ProjectsLocationsRegistrationsResetAuthorizationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetauthorizationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetauthorizationcoderequest) if err != nil { return nil, err } @@ -4820,12 +4801,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveAuthorizationCodeCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+registration}:retrieveAuthorizationCode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4946,12 +4926,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+registration}:retrieveGoogleDomainsDnsRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5083,12 +5062,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+registration}:retrieveGoogleDomainsForwardingConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5212,12 +5190,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveImportableDomainsCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/registrations:retrieveImportableDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5350,12 +5327,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveRegisterParametersCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/registrations:retrieveRegisterParameters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5471,12 +5447,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveTransferParametersCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/registrations:retrieveTransferParameters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5589,12 +5564,11 @@ func (c *ProjectsLocationsRegistrationsSearchDomainsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/registrations:searchDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5691,8 +5665,7 @@ func (c *ProjectsLocationsRegistrationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5799,8 +5772,7 @@ func (c *ProjectsLocationsRegistrationsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsRegistrationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5920,8 +5892,7 @@ func (c *ProjectsLocationsRegistrationsTransferCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferdomainrequest) if err != nil { return nil, err } diff --git a/domains/v1alpha2/domains-gen.go b/domains/v1alpha2/domains-gen.go index 88e4228ba20..955f1bcb1a9 100644 --- a/domains/v1alpha2/domains-gen.go +++ b/domains/v1alpha2/domains-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2710,12 +2709,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2841,12 +2839,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2972,12 +2969,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3100,12 +3096,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3231,8 +3226,7 @@ func (c *ProjectsLocationsRegistrationsConfigureContactSettingsCall) Header() ht func (c *ProjectsLocationsRegistrationsConfigureContactSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configurecontactsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configurecontactsettingsrequest) if err != nil { return nil, err } @@ -3333,8 +3327,7 @@ func (c *ProjectsLocationsRegistrationsConfigureDnsSettingsCall) Header() http.H func (c *ProjectsLocationsRegistrationsConfigureDnsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configurednssettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configurednssettingsrequest) if err != nil { return nil, err } @@ -3435,8 +3428,7 @@ func (c *ProjectsLocationsRegistrationsConfigureManagementSettingsCall) Header() func (c *ProjectsLocationsRegistrationsConfigureManagementSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuremanagementsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configuremanagementsettingsrequest) if err != nil { return nil, err } @@ -3548,12 +3540,11 @@ func (c *ProjectsLocationsRegistrationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3655,8 +3646,7 @@ func (c *ProjectsLocationsRegistrationsExportCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportregistrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportregistrationrequest) if err != nil { return nil, err } @@ -3767,12 +3757,11 @@ func (c *ProjectsLocationsRegistrationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3894,12 +3883,11 @@ func (c *ProjectsLocationsRegistrationsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3999,8 +3987,7 @@ func (c *ProjectsLocationsRegistrationsImportCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdomainrequest) if err != nil { return nil, err } @@ -4110,8 +4097,7 @@ func (c *ProjectsLocationsRegistrationsInitiatePushTransferCall) Header() http.H func (c *ProjectsLocationsRegistrationsInitiatePushTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiatepushtransferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initiatepushtransferrequest) if err != nil { return nil, err } @@ -4253,12 +4239,11 @@ func (c *ProjectsLocationsRegistrationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}/registrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4386,8 +4371,7 @@ func (c *ProjectsLocationsRegistrationsPatchCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registration) if err != nil { return nil, err } @@ -4496,8 +4480,7 @@ func (c *ProjectsLocationsRegistrationsRegisterCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registerdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registerdomainrequest) if err != nil { return nil, err } @@ -4601,8 +4584,7 @@ func (c *ProjectsLocationsRegistrationsRenewDomainCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsRenewDomainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renewdomainrequest) if err != nil { return nil, err } @@ -4708,8 +4690,7 @@ func (c *ProjectsLocationsRegistrationsResetAuthorizationCodeCall) Header() http func (c *ProjectsLocationsRegistrationsResetAuthorizationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetauthorizationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetauthorizationcoderequest) if err != nil { return nil, err } @@ -4827,12 +4808,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveAuthorizationCodeCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+registration}:retrieveAuthorizationCode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4953,12 +4933,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+registration}:retrieveGoogleDomainsDnsRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5090,12 +5069,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+registration}:retrieveGoogleDomainsForwardingConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5219,12 +5197,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveImportableDomainsCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+location}/registrations:retrieveImportableDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5357,12 +5334,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveRegisterParametersCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+location}/registrations:retrieveRegisterParameters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5478,12 +5454,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveTransferParametersCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+location}/registrations:retrieveTransferParameters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5596,12 +5571,11 @@ func (c *ProjectsLocationsRegistrationsSearchDomainsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+location}/registrations:searchDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5698,8 +5672,7 @@ func (c *ProjectsLocationsRegistrationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5806,8 +5779,7 @@ func (c *ProjectsLocationsRegistrationsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsRegistrationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5927,8 +5899,7 @@ func (c *ProjectsLocationsRegistrationsTransferCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferdomainrequest) if err != nil { return nil, err } diff --git a/domains/v1beta1/domains-gen.go b/domains/v1beta1/domains-gen.go index d09085e69a0..137a2b127de 100644 --- a/domains/v1beta1/domains-gen.go +++ b/domains/v1beta1/domains-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2703,12 +2702,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2834,12 +2832,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2965,12 +2962,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3093,12 +3089,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3224,8 +3219,7 @@ func (c *ProjectsLocationsRegistrationsConfigureContactSettingsCall) Header() ht func (c *ProjectsLocationsRegistrationsConfigureContactSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configurecontactsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configurecontactsettingsrequest) if err != nil { return nil, err } @@ -3326,8 +3320,7 @@ func (c *ProjectsLocationsRegistrationsConfigureDnsSettingsCall) Header() http.H func (c *ProjectsLocationsRegistrationsConfigureDnsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configurednssettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configurednssettingsrequest) if err != nil { return nil, err } @@ -3428,8 +3421,7 @@ func (c *ProjectsLocationsRegistrationsConfigureManagementSettingsCall) Header() func (c *ProjectsLocationsRegistrationsConfigureManagementSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuremanagementsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configuremanagementsettingsrequest) if err != nil { return nil, err } @@ -3541,12 +3533,11 @@ func (c *ProjectsLocationsRegistrationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3648,8 +3639,7 @@ func (c *ProjectsLocationsRegistrationsExportCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportregistrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportregistrationrequest) if err != nil { return nil, err } @@ -3760,12 +3750,11 @@ func (c *ProjectsLocationsRegistrationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3887,12 +3876,11 @@ func (c *ProjectsLocationsRegistrationsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3992,8 +3980,7 @@ func (c *ProjectsLocationsRegistrationsImportCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdomainrequest) if err != nil { return nil, err } @@ -4103,8 +4090,7 @@ func (c *ProjectsLocationsRegistrationsInitiatePushTransferCall) Header() http.H func (c *ProjectsLocationsRegistrationsInitiatePushTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiatepushtransferrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.initiatepushtransferrequest) if err != nil { return nil, err } @@ -4246,12 +4232,11 @@ func (c *ProjectsLocationsRegistrationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/registrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4379,8 +4364,7 @@ func (c *ProjectsLocationsRegistrationsPatchCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registration) if err != nil { return nil, err } @@ -4489,8 +4473,7 @@ func (c *ProjectsLocationsRegistrationsRegisterCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registerdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registerdomainrequest) if err != nil { return nil, err } @@ -4594,8 +4577,7 @@ func (c *ProjectsLocationsRegistrationsRenewDomainCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsRenewDomainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renewdomainrequest) if err != nil { return nil, err } @@ -4701,8 +4683,7 @@ func (c *ProjectsLocationsRegistrationsResetAuthorizationCodeCall) Header() http func (c *ProjectsLocationsRegistrationsResetAuthorizationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetauthorizationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetauthorizationcoderequest) if err != nil { return nil, err } @@ -4820,12 +4801,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveAuthorizationCodeCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+registration}:retrieveAuthorizationCode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4946,12 +4926,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+registration}:retrieveGoogleDomainsDnsRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5083,12 +5062,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+registration}:retrieveGoogleDomainsForwardingConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5212,12 +5190,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveImportableDomainsCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+location}/registrations:retrieveImportableDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5350,12 +5327,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveRegisterParametersCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+location}/registrations:retrieveRegisterParameters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5471,12 +5447,11 @@ func (c *ProjectsLocationsRegistrationsRetrieveTransferParametersCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+location}/registrations:retrieveTransferParameters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5589,12 +5564,11 @@ func (c *ProjectsLocationsRegistrationsSearchDomainsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+location}/registrations:searchDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5691,8 +5665,7 @@ func (c *ProjectsLocationsRegistrationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5799,8 +5772,7 @@ func (c *ProjectsLocationsRegistrationsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsRegistrationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5920,8 +5892,7 @@ func (c *ProjectsLocationsRegistrationsTransferCall) Header() http.Header { func (c *ProjectsLocationsRegistrationsTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferdomainrequest) if err != nil { return nil, err } diff --git a/domainsrdap/v1/domainsrdap-gen.go b/domainsrdap/v1/domainsrdap-gen.go index aecb77621d0..3406bdcfeb9 100644 --- a/domainsrdap/v1/domainsrdap-gen.go +++ b/domainsrdap/v1/domainsrdap-gen.go @@ -103,7 +103,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Autnum = NewAutnumService(s) + s.Domain = NewDomainService(s) + s.Entity = NewEntityService(s) + s.Ip = NewIpService(s) + s.Nameserver = NewNameserverService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -122,14 +128,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Autnum = NewAutnumService(s) - s.Domain = NewDomainService(s) - s.Entity = NewEntityService(s) - s.Ip = NewIpService(s) - s.Nameserver = NewNameserverService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -420,12 +419,11 @@ func (c *AutnumGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/autnum/{autnumId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -527,12 +525,11 @@ func (c *DomainGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domain/{+domainName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -635,12 +632,11 @@ func (c *EntityGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entity/{entityId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -746,12 +742,11 @@ func (c *IpGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip/{ipId}/{ipId1}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -855,12 +850,11 @@ func (c *NameserverGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameserver/{nameserverId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -959,12 +953,11 @@ func (c *V1GetDomainsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1061,12 +1054,11 @@ func (c *V1GetEntitiesCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1162,12 +1154,11 @@ func (c *V1GetHelpCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/help") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1263,12 +1254,11 @@ func (c *V1GetIpCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1365,12 +1355,11 @@ func (c *V1GetNameserversCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameservers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/doubleclickbidmanager/v2/doubleclickbidmanager-gen.go b/doubleclickbidmanager/v2/doubleclickbidmanager-gen.go index 7da311ab382..ebfc4b0af19 100644 --- a/doubleclickbidmanager/v2/doubleclickbidmanager-gen.go +++ b/doubleclickbidmanager/v2/doubleclickbidmanager-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Queries = NewQueriesService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Queries = NewQueriesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -736,8 +735,7 @@ func (c *QueriesCreateCall) Header() http.Header { func (c *QueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.query) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.query) if err != nil { return nil, err } @@ -832,12 +830,11 @@ func (c *QueriesDeleteCall) Header() http.Header { func (c *QueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -916,12 +913,11 @@ func (c *QueriesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1044,12 +1040,11 @@ func (c *QueriesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "queries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1169,8 +1164,7 @@ func (c *QueriesRunCall) Header() http.Header { func (c *QueriesRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runqueryrequest) if err != nil { return nil, err } @@ -1283,12 +1277,11 @@ func (c *QueriesReportsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}/reports/{reportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1416,12 +1409,11 @@ func (c *QueriesReportsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/doubleclicksearch/v2/doubleclicksearch-gen.go b/doubleclicksearch/v2/doubleclicksearch-gen.go index 3832f6f224e..3490745f70d 100644 --- a/doubleclicksearch/v2/doubleclicksearch-gen.go +++ b/doubleclicksearch/v2/doubleclicksearch-gen.go @@ -114,7 +114,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Conversion = NewConversionService(s) + s.Reports = NewReportsService(s) + s.SavedColumns = NewSavedColumnsService(s) if err != nil { return nil, err } @@ -133,11 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Conversion = NewConversionService(s) - s.Reports = NewReportsService(s) - s.SavedColumns = NewSavedColumnsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -999,12 +998,11 @@ func (c *ConversionGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1167,12 +1165,11 @@ func (c *ConversionGetByCustomerIdCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/customer/{customerId}/conversion") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1260,8 +1257,7 @@ func (c *ConversionInsertCall) Header() http.Header { func (c *ConversionInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionlist) if err != nil { return nil, err } @@ -1354,8 +1350,7 @@ func (c *ConversionUpdateCall) Header() http.Header { func (c *ConversionUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionlist) if err != nil { return nil, err } @@ -1449,8 +1444,7 @@ func (c *ConversionUpdateAvailabilityCall) Header() http.Header { func (c *ConversionUpdateAvailabilityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateavailabilityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateavailabilityrequest) if err != nil { return nil, err } @@ -1544,8 +1538,7 @@ func (c *ReportsGenerateCall) Header() http.Header { func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportrequest) if err != nil { return nil, err } @@ -1652,12 +1645,11 @@ func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/{reportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1762,12 +1754,11 @@ func (c *ReportsGetFileCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1869,12 +1860,11 @@ func (c *ReportsGetIdMappingFileCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/idmapping") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1979,8 +1969,7 @@ func (c *ReportsRequestCall) Header() http.Header { func (c *ReportsRequestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportrequest) if err != nil { return nil, err } @@ -2090,12 +2079,11 @@ func (c *SavedColumnsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/drive/v2/drive-gen.go b/drive/v2/drive-gen.go index f997a7fdff7..ebbd8a6256a 100644 --- a/drive/v2/drive-gen.go +++ b/drive/v2/drive-gen.go @@ -157,7 +157,21 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.About = NewAboutService(s) + s.Apps = NewAppsService(s) + s.Changes = NewChangesService(s) + s.Channels = NewChannelsService(s) + s.Children = NewChildrenService(s) + s.Comments = NewCommentsService(s) + s.Drives = NewDrivesService(s) + s.Files = NewFilesService(s) + s.Parents = NewParentsService(s) + s.Permissions = NewPermissionsService(s) + s.Properties = NewPropertiesService(s) + s.Replies = NewRepliesService(s) + s.Revisions = NewRevisionsService(s) + s.Teamdrives = NewTeamdrivesService(s) if err != nil { return nil, err } @@ -176,22 +190,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.About = NewAboutService(s) - s.Apps = NewAppsService(s) - s.Changes = NewChangesService(s) - s.Channels = NewChannelsService(s) - s.Children = NewChildrenService(s) - s.Comments = NewCommentsService(s) - s.Drives = NewDrivesService(s) - s.Files = NewFilesService(s) - s.Parents = NewParentsService(s) - s.Permissions = NewPermissionsService(s) - s.Properties = NewPropertiesService(s) - s.Replies = NewRepliesService(s) - s.Revisions = NewRevisionsService(s) - s.Teamdrives = NewTeamdrivesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3570,12 +3569,11 @@ func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "about") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3674,12 +3672,11 @@ func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3805,12 +3802,11 @@ func (c *AppsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3938,12 +3934,11 @@ func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "changes/{changeId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4070,12 +4065,11 @@ func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4287,12 +4281,11 @@ func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "changes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4515,8 +4508,7 @@ func (c *ChangesWatchCall) Header() http.Header { func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4609,8 +4601,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4693,12 +4684,11 @@ func (c *ChildrenDeleteCall) Header() http.Header { func (c *ChildrenDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4781,12 +4771,11 @@ func (c *ChildrenGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4901,8 +4890,7 @@ func (c *ChildrenInsertCall) Header() http.Header { func (c *ChildrenInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.childreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.childreference) if err != nil { return nil, err } @@ -5044,12 +5032,11 @@ func (c *ChildrenListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5163,12 +5150,11 @@ func (c *CommentsDeleteCall) Header() http.Header { func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5259,12 +5245,11 @@ func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5357,8 +5342,7 @@ func (c *CommentsInsertCall) Header() http.Header { func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -5499,12 +5483,11 @@ func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5620,8 +5603,7 @@ func (c *CommentsPatchCall) Header() http.Header { func (c *CommentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -5725,8 +5707,7 @@ func (c *CommentsUpdateCall) Header() http.Header { func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -5843,12 +5824,11 @@ func (c *DrivesDeleteCall) Header() http.Header { func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5936,12 +5916,11 @@ func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6031,12 +6010,11 @@ func (c *DrivesHideCall) Header() http.Header { func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6131,8 +6109,7 @@ func (c *DrivesInsertCall) Header() http.Header { func (c *DrivesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.drive) if err != nil { return nil, err } @@ -6267,12 +6244,11 @@ func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6380,12 +6356,11 @@ func (c *DrivesUnhideCall) Header() http.Header { func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6486,8 +6461,7 @@ func (c *DrivesUpdateCall) Header() http.Header { func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.drive) if err != nil { return nil, err } @@ -6682,8 +6656,7 @@ func (c *FilesCopyCall) Header() http.Header { func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -6807,12 +6780,11 @@ func (c *FilesDeleteCall) Header() http.Header { func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6891,12 +6863,11 @@ func (c *FilesEmptyTrashCall) Header() http.Header { func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6976,12 +6947,11 @@ func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7096,12 +7066,11 @@ func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7272,12 +7241,11 @@ func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7538,8 +7506,7 @@ func (c *FilesInsertCall) Header() http.Header { func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -7550,14 +7517,10 @@ func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v2/files") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -7815,12 +7778,11 @@ func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7955,12 +7917,11 @@ func (c *FilesListLabelsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/listLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8074,8 +8035,7 @@ func (c *FilesModifyLabelsCall) Header() http.Header { func (c *FilesModifyLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifylabelsrequest) if err != nil { return nil, err } @@ -8339,8 +8299,7 @@ func (c *FilesPatchCall) Header() http.Header { func (c *FilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -8467,12 +8426,11 @@ func (c *FilesTouchCall) Header() http.Header { func (c *FilesTouchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/touch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8593,12 +8551,11 @@ func (c *FilesTrashCall) Header() http.Header { func (c *FilesTrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/trash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8719,12 +8676,11 @@ func (c *FilesUntrashCall) Header() http.Header { func (c *FilesUntrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/untrash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9022,8 +8978,7 @@ func (c *FilesUpdateCall) Header() http.Header { func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -9034,14 +8989,10 @@ func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v2/files/{fileId}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, newBody) if err != nil { return nil, err } @@ -9217,8 +9168,7 @@ func (c *FilesWatchCall) Header() http.Header { func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -9327,12 +9277,11 @@ func (c *ParentsDeleteCall) Header() http.Header { func (c *ParentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9415,12 +9364,11 @@ func (c *ParentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9536,8 +9484,7 @@ func (c *ParentsInsertCall) Header() http.Header { func (c *ParentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.parentreference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.parentreference) if err != nil { return nil, err } @@ -9648,12 +9595,11 @@ func (c *ParentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9772,12 +9718,11 @@ func (c *PermissionsDeleteCall) Header() http.Header { func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9884,12 +9829,11 @@ func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9992,12 +9936,11 @@ func (c *PermissionsGetIdForEmailCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "permissionIds/{email}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10147,8 +10090,7 @@ func (c *PermissionsInsertCall) Header() http.Header { func (c *PermissionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.permission) if err != nil { return nil, err } @@ -10307,12 +10249,11 @@ func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10469,8 +10410,7 @@ func (c *PermissionsPatchCall) Header() http.Header { func (c *PermissionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.permission) if err != nil { return nil, err } @@ -10614,8 +10554,7 @@ func (c *PermissionsUpdateCall) Header() http.Header { func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.permission) if err != nil { return nil, err } @@ -10724,12 +10663,11 @@ func (c *PropertiesDeleteCall) Header() http.Header { func (c *PropertiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10819,12 +10757,11 @@ func (c *PropertiesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10917,8 +10854,7 @@ func (c *PropertiesInsertCall) Header() http.Header { func (c *PropertiesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.property) if err != nil { return nil, err } @@ -11028,12 +10964,11 @@ func (c *PropertiesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11135,8 +11070,7 @@ func (c *PropertiesPatchCall) Header() http.Header { func (c *PropertiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.property) if err != nil { return nil, err } @@ -11247,8 +11181,7 @@ func (c *PropertiesUpdateCall) Header() http.Header { func (c *PropertiesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.property) if err != nil { return nil, err } @@ -11353,12 +11286,11 @@ func (c *RepliesDeleteCall) Header() http.Header { func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11452,12 +11384,11 @@ func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11554,8 +11485,7 @@ func (c *RepliesInsertCall) Header() http.Header { func (c *RepliesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentreply) if err != nil { return nil, err } @@ -11691,12 +11621,11 @@ func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11817,8 +11746,7 @@ func (c *RepliesPatchCall) Header() http.Header { func (c *RepliesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentreply) if err != nil { return nil, err } @@ -11926,8 +11854,7 @@ func (c *RepliesUpdateCall) Header() http.Header { func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentreply) if err != nil { return nil, err } @@ -12033,12 +11960,11 @@ func (c *RevisionsDeleteCall) Header() http.Header { func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12121,12 +12047,11 @@ func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12244,12 +12169,11 @@ func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12365,8 +12289,7 @@ func (c *RevisionsPatchCall) Header() http.Header { func (c *RevisionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revision) if err != nil { return nil, err } @@ -12470,8 +12393,7 @@ func (c *RevisionsUpdateCall) Header() http.Header { func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revision) if err != nil { return nil, err } @@ -12570,12 +12492,11 @@ func (c *TeamdrivesDeleteCall) Header() http.Header { func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12663,12 +12584,11 @@ func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12763,8 +12683,7 @@ func (c *TeamdrivesInsertCall) Header() http.Header { func (c *TeamdrivesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.teamdrive) if err != nil { return nil, err } @@ -12896,12 +12815,11 @@ func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13020,8 +12938,7 @@ func (c *TeamdrivesUpdateCall) Header() http.Header { func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.teamdrive) if err != nil { return nil, err } diff --git a/drive/v3/drive-gen.go b/drive/v3/drive-gen.go index 41bdc8477f5..bc6474ae1b6 100644 --- a/drive/v3/drive-gen.go +++ b/drive/v3/drive-gen.go @@ -157,7 +157,21 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.About = NewAboutService(s) + s.Accessproposals = NewAccessproposalsService(s) + s.Apps = NewAppsService(s) + s.Changes = NewChangesService(s) + s.Channels = NewChannelsService(s) + s.Comments = NewCommentsService(s) + s.Drives = NewDrivesService(s) + s.Files = NewFilesService(s) + s.Operation = NewOperationService(s) + s.Operations = NewOperationsService(s) + s.Permissions = NewPermissionsService(s) + s.Replies = NewRepliesService(s) + s.Revisions = NewRevisionsService(s) + s.Teamdrives = NewTeamdrivesService(s) if err != nil { return nil, err } @@ -176,22 +190,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.About = NewAboutService(s) - s.Accessproposals = NewAccessproposalsService(s) - s.Apps = NewAppsService(s) - s.Changes = NewChangesService(s) - s.Channels = NewChannelsService(s) - s.Comments = NewCommentsService(s) - s.Drives = NewDrivesService(s) - s.Files = NewFilesService(s) - s.Operation = NewOperationService(s) - s.Operations = NewOperationsService(s) - s.Permissions = NewPermissionsService(s) - s.Replies = NewRepliesService(s) - s.Revisions = NewRevisionsService(s) - s.Teamdrives = NewTeamdrivesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3264,12 +3263,11 @@ func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "about") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3371,12 +3369,11 @@ func (c *AccessproposalsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/accessproposals/{proposalId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3495,12 +3492,11 @@ func (c *AccessproposalsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/accessproposals") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3617,8 +3613,7 @@ func (c *AccessproposalsResolveCall) Header() http.Header { func (c *AccessproposalsResolveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resolveaccessproposalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resolveaccessproposalrequest) if err != nil { return nil, err } @@ -3707,12 +3702,11 @@ func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3839,12 +3833,11 @@ func (c *AppsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3970,12 +3963,11 @@ func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4178,12 +4170,11 @@ func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "changes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4376,8 +4367,7 @@ func (c *ChangesWatchCall) Header() http.Header { func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4472,8 +4462,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4552,8 +4541,7 @@ func (c *CommentsCreateCall) Header() http.Header { func (c *CommentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -4658,12 +4646,11 @@ func (c *CommentsDeleteCall) Header() http.Header { func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4758,12 +4745,11 @@ func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4901,12 +4887,11 @@ func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5027,8 +5012,7 @@ func (c *CommentsUpdateCall) Header() http.Header { func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -5132,8 +5116,7 @@ func (c *DrivesCreateCall) Header() http.Header { func (c *DrivesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.drive) if err != nil { return nil, err } @@ -5246,12 +5229,11 @@ func (c *DrivesDeleteCall) Header() http.Header { func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5339,12 +5321,11 @@ func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5434,12 +5415,11 @@ func (c *DrivesHideCall) Header() http.Header { func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5569,12 +5549,11 @@ func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5682,12 +5661,11 @@ func (c *DrivesUnhideCall) Header() http.Header { func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5788,8 +5766,7 @@ func (c *DrivesUpdateCall) Header() http.Header { func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.drive) if err != nil { return nil, err } @@ -5955,8 +5932,7 @@ func (c *FilesCopyCall) Header() http.Header { func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -6180,8 +6156,7 @@ func (c *FilesCreateCall) Header() http.Header { func (c *FilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -6192,14 +6167,10 @@ func (c *FilesCreateCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -6330,12 +6301,11 @@ func (c *FilesDeleteCall) Header() http.Header { func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6423,12 +6393,11 @@ func (c *FilesDownloadCall) Header() http.Header { func (c *FilesDownloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6530,12 +6499,11 @@ func (c *FilesEmptyTrashCall) Header() http.Header { func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6615,12 +6583,11 @@ func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6734,12 +6701,11 @@ func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6883,12 +6849,11 @@ func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7138,12 +7103,11 @@ func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7278,12 +7242,11 @@ func (c *FilesListLabelsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/listLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7397,8 +7360,7 @@ func (c *FilesModifyLabelsCall) Header() http.Header { func (c *FilesModifyLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifylabelsrequest) if err != nil { return nil, err } @@ -7623,8 +7585,7 @@ func (c *FilesUpdateCall) Header() http.Header { func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.file) if err != nil { return nil, err } @@ -7635,14 +7596,10 @@ func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files/{fileId}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("PATCH", urls, newBody) if err != nil { return nil, err } @@ -7791,8 +7748,7 @@ func (c *FilesWatchCall) Header() http.Header { func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -7898,12 +7854,11 @@ func (c *OperationCancelCall) Header() http.Header { func (c *OperationCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "operation/{name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7973,12 +7928,11 @@ func (c *OperationDeleteCall) Header() http.Header { func (c *OperationDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "operation/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8059,12 +8013,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "operations/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8190,12 +8143,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8374,8 +8326,7 @@ func (c *PermissionsCreateCall) Header() http.Header { func (c *PermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.permission) if err != nil { return nil, err } @@ -8501,12 +8452,11 @@ func (c *PermissionsDeleteCall) Header() http.Header { func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8613,12 +8563,11 @@ func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8770,12 +8719,11 @@ func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8933,8 +8881,7 @@ func (c *PermissionsUpdateCall) Header() http.Header { func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.permission) if err != nil { return nil, err } @@ -9038,8 +8985,7 @@ func (c *RepliesCreateCall) Header() http.Header { func (c *RepliesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reply) if err != nil { return nil, err } @@ -9144,12 +9090,11 @@ func (c *RepliesDeleteCall) Header() http.Header { func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9244,12 +9189,11 @@ func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9379,12 +9323,11 @@ func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9504,8 +9447,7 @@ func (c *RepliesUpdateCall) Header() http.Header { func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reply) if err != nil { return nil, err } @@ -9611,12 +9553,11 @@ func (c *RevisionsDeleteCall) Header() http.Header { func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9709,12 +9650,11 @@ func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9848,12 +9788,11 @@ func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9969,8 +9908,7 @@ func (c *RevisionsUpdateCall) Header() http.Header { func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revision) if err != nil { return nil, err } @@ -10074,8 +10012,7 @@ func (c *TeamdrivesCreateCall) Header() http.Header { func (c *TeamdrivesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.teamdrive) if err != nil { return nil, err } @@ -10170,12 +10107,11 @@ func (c *TeamdrivesDeleteCall) Header() http.Header { func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10263,12 +10199,11 @@ func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10395,12 +10330,11 @@ func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10519,8 +10453,7 @@ func (c *TeamdrivesUpdateCall) Header() http.Header { func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.teamdrive) if err != nil { return nil, err } diff --git a/driveactivity/v2/driveactivity-gen.go b/driveactivity/v2/driveactivity-gen.go index 1aafc06b564..7e62a9fadd8 100644 --- a/driveactivity/v2/driveactivity-gen.go +++ b/driveactivity/v2/driveactivity-gen.go @@ -123,7 +123,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Activity = NewActivityService(s) if err != nil { return nil, err } @@ -142,9 +143,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Activity = NewActivityService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1842,8 +1841,7 @@ func (c *ActivityQueryCall) Header() http.Header { func (c *ActivityQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querydriveactivityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querydriveactivityrequest) if err != nil { return nil, err } diff --git a/drivelabels/v2/drivelabels-gen.go b/drivelabels/v2/drivelabels-gen.go index ae304052e68..bddaeb81ae1 100644 --- a/drivelabels/v2/drivelabels-gen.go +++ b/drivelabels/v2/drivelabels-gen.go @@ -133,7 +133,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Labels = NewLabelsService(s) + s.Limits = NewLimitsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -152,11 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Labels = NewLabelsService(s) - s.Limits = NewLimitsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2888,8 +2887,7 @@ func (c *LabelsCreateCall) Header() http.Header { func (c *LabelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2label) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2label) if err != nil { return nil, err } @@ -3005,12 +3003,11 @@ func (c *LabelsDeleteCall) Header() http.Header { func (c *LabelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3106,8 +3103,7 @@ func (c *LabelsDeltaCall) Header() http.Header { func (c *LabelsDeltaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2deltaupdatelabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2deltaupdatelabelrequest) if err != nil { return nil, err } @@ -3212,8 +3208,7 @@ func (c *LabelsDisableCall) Header() http.Header { func (c *LabelsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2disablelabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2disablelabelrequest) if err != nil { return nil, err } @@ -3317,8 +3312,7 @@ func (c *LabelsEnableCall) Header() http.Header { func (c *LabelsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2enablelabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2enablelabelrequest) if err != nil { return nil, err } @@ -3466,12 +3460,11 @@ func (c *LabelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3662,12 +3655,11 @@ func (c *LabelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/labels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3790,8 +3782,7 @@ func (c *LabelsPublishCall) Header() http.Header { func (c *LabelsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2publishlabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2publishlabelrequest) if err != nil { return nil, err } @@ -3893,8 +3884,7 @@ func (c *LabelsUpdateLabelCopyModeCall) Header() http.Header { func (c *LabelsUpdateLabelCopyModeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2updatelabelcopymoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2updatelabelcopymoderequest) if err != nil { return nil, err } @@ -4006,8 +3996,7 @@ func (c *LabelsUpdatePermissionsCall) Header() http.Header { func (c *LabelsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2labelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission) if err != nil { return nil, err } @@ -4132,12 +4121,11 @@ func (c *LabelsLocksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/locks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4255,8 +4243,7 @@ func (c *LabelsPermissionsBatchDeleteCall) Header() http.Header { func (c *LabelsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest) if err != nil { return nil, err } @@ -4363,8 +4350,7 @@ func (c *LabelsPermissionsBatchUpdateCall) Header() http.Header { func (c *LabelsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest) if err != nil { return nil, err } @@ -4477,8 +4463,7 @@ func (c *LabelsPermissionsCreateCall) Header() http.Header { func (c *LabelsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2labelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission) if err != nil { return nil, err } @@ -4586,12 +4571,11 @@ func (c *LabelsPermissionsDeleteCall) Header() http.Header { func (c *LabelsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4717,12 +4701,11 @@ func (c *LabelsPermissionsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4847,8 +4830,7 @@ func (c *LabelsRevisionsUpdatePermissionsCall) Header() http.Header { func (c *LabelsRevisionsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2labelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission) if err != nil { return nil, err } @@ -4973,12 +4955,11 @@ func (c *LabelsRevisionsLocksListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/locks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5096,8 +5077,7 @@ func (c *LabelsRevisionsPermissionsBatchDeleteCall) Header() http.Header { func (c *LabelsRevisionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest) if err != nil { return nil, err } @@ -5204,8 +5184,7 @@ func (c *LabelsRevisionsPermissionsBatchUpdateCall) Header() http.Header { func (c *LabelsRevisionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest) if err != nil { return nil, err } @@ -5318,8 +5297,7 @@ func (c *LabelsRevisionsPermissionsCreateCall) Header() http.Header { func (c *LabelsRevisionsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2labelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission) if err != nil { return nil, err } @@ -5427,12 +5405,11 @@ func (c *LabelsRevisionsPermissionsDeleteCall) Header() http.Header { func (c *LabelsRevisionsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5558,12 +5535,11 @@ func (c *LabelsRevisionsPermissionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5691,12 +5667,11 @@ func (c *LimitsGetLabelCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/limits/label") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5805,12 +5780,11 @@ func (c *UsersGetCapabilitiesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/drivelabels/v2beta/drivelabels-gen.go b/drivelabels/v2beta/drivelabels-gen.go index f03ef683dc7..9175af262a2 100644 --- a/drivelabels/v2beta/drivelabels-gen.go +++ b/drivelabels/v2beta/drivelabels-gen.go @@ -133,7 +133,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Labels = NewLabelsService(s) + s.Limits = NewLimitsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -152,11 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Labels = NewLabelsService(s) - s.Limits = NewLimitsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2891,8 +2890,7 @@ func (c *LabelsCreateCall) Header() http.Header { func (c *LabelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betalabel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betalabel) if err != nil { return nil, err } @@ -3008,12 +3006,11 @@ func (c *LabelsDeleteCall) Header() http.Header { func (c *LabelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3109,8 +3106,7 @@ func (c *LabelsDeltaCall) Header() http.Header { func (c *LabelsDeltaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betadeltaupdatelabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betadeltaupdatelabelrequest) if err != nil { return nil, err } @@ -3215,8 +3211,7 @@ func (c *LabelsDisableCall) Header() http.Header { func (c *LabelsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betadisablelabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betadisablelabelrequest) if err != nil { return nil, err } @@ -3320,8 +3315,7 @@ func (c *LabelsEnableCall) Header() http.Header { func (c *LabelsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betaenablelabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betaenablelabelrequest) if err != nil { return nil, err } @@ -3469,12 +3463,11 @@ func (c *LabelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3665,12 +3658,11 @@ func (c *LabelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/labels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3793,8 +3785,7 @@ func (c *LabelsPublishCall) Header() http.Header { func (c *LabelsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betapublishlabelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betapublishlabelrequest) if err != nil { return nil, err } @@ -3896,8 +3887,7 @@ func (c *LabelsUpdateLabelCopyModeCall) Header() http.Header { func (c *LabelsUpdateLabelCopyModeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betaupdatelabelcopymoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betaupdatelabelcopymoderequest) if err != nil { return nil, err } @@ -4009,8 +3999,7 @@ func (c *LabelsUpdatePermissionsCall) Header() http.Header { func (c *LabelsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betalabelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betalabelpermission) if err != nil { return nil, err } @@ -4135,12 +4124,11 @@ func (c *LabelsLocksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/locks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4258,8 +4246,7 @@ func (c *LabelsPermissionsBatchDeleteCall) Header() http.Header { func (c *LabelsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betabatchdeletelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betabatchdeletelabelpermissionsrequest) if err != nil { return nil, err } @@ -4366,8 +4353,7 @@ func (c *LabelsPermissionsBatchUpdateCall) Header() http.Header { func (c *LabelsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betabatchupdatelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betabatchupdatelabelpermissionsrequest) if err != nil { return nil, err } @@ -4480,8 +4466,7 @@ func (c *LabelsPermissionsCreateCall) Header() http.Header { func (c *LabelsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betalabelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betalabelpermission) if err != nil { return nil, err } @@ -4589,12 +4574,11 @@ func (c *LabelsPermissionsDeleteCall) Header() http.Header { func (c *LabelsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4720,12 +4704,11 @@ func (c *LabelsPermissionsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4850,8 +4833,7 @@ func (c *LabelsRevisionsUpdatePermissionsCall) Header() http.Header { func (c *LabelsRevisionsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betalabelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betalabelpermission) if err != nil { return nil, err } @@ -4976,12 +4958,11 @@ func (c *LabelsRevisionsLocksListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/locks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5099,8 +5080,7 @@ func (c *LabelsRevisionsPermissionsBatchDeleteCall) Header() http.Header { func (c *LabelsRevisionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betabatchdeletelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betabatchdeletelabelpermissionsrequest) if err != nil { return nil, err } @@ -5207,8 +5187,7 @@ func (c *LabelsRevisionsPermissionsBatchUpdateCall) Header() http.Header { func (c *LabelsRevisionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betabatchupdatelabelpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betabatchupdatelabelpermissionsrequest) if err != nil { return nil, err } @@ -5321,8 +5300,7 @@ func (c *LabelsRevisionsPermissionsCreateCall) Header() http.Header { func (c *LabelsRevisionsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleappsdrivelabelsv2betalabelpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2betalabelpermission) if err != nil { return nil, err } @@ -5430,12 +5408,11 @@ func (c *LabelsRevisionsPermissionsDeleteCall) Header() http.Header { func (c *LabelsRevisionsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5561,12 +5538,11 @@ func (c *LabelsRevisionsPermissionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5694,12 +5670,11 @@ func (c *LimitsGetLabelCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/limits/label") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5808,12 +5783,11 @@ func (c *UsersGetCapabilitiesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/essentialcontacts/v1/essentialcontacts-gen.go b/essentialcontacts/v1/essentialcontacts-gen.go index 6dc6e4f7a7c..c7267af64a1 100644 --- a/essentialcontacts/v1/essentialcontacts-gen.go +++ b/essentialcontacts/v1/essentialcontacts-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -544,12 +543,11 @@ func (c *FoldersContactsComputeCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contacts:compute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -665,8 +663,7 @@ func (c *FoldersContactsCreateCall) Header() http.Header { func (c *FoldersContactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1contact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1contact) if err != nil { return nil, err } @@ -768,12 +765,11 @@ func (c *FoldersContactsDeleteCall) Header() http.Header { func (c *FoldersContactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -879,12 +875,11 @@ func (c *FoldersContactsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1007,12 +1002,11 @@ func (c *FoldersContactsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1135,8 +1129,7 @@ func (c *FoldersContactsPatchCall) Header() http.Header { func (c *FoldersContactsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1contact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1contact) if err != nil { return nil, err } @@ -1242,8 +1235,7 @@ func (c *FoldersContactsSendTestMessageCall) Header() http.Header { func (c *FoldersContactsSendTestMessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1sendtestmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1sendtestmessagerequest) if err != nil { return nil, err } @@ -1422,12 +1414,11 @@ func (c *OrganizationsContactsComputeCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contacts:compute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1543,8 +1534,7 @@ func (c *OrganizationsContactsCreateCall) Header() http.Header { func (c *OrganizationsContactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1contact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1contact) if err != nil { return nil, err } @@ -1646,12 +1636,11 @@ func (c *OrganizationsContactsDeleteCall) Header() http.Header { func (c *OrganizationsContactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1757,12 +1746,11 @@ func (c *OrganizationsContactsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1885,12 +1873,11 @@ func (c *OrganizationsContactsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2013,8 +2000,7 @@ func (c *OrganizationsContactsPatchCall) Header() http.Header { func (c *OrganizationsContactsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1contact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1contact) if err != nil { return nil, err } @@ -2120,8 +2106,7 @@ func (c *OrganizationsContactsSendTestMessageCall) Header() http.Header { func (c *OrganizationsContactsSendTestMessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1sendtestmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1sendtestmessagerequest) if err != nil { return nil, err } @@ -2300,12 +2285,11 @@ func (c *ProjectsContactsComputeCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contacts:compute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2421,8 +2405,7 @@ func (c *ProjectsContactsCreateCall) Header() http.Header { func (c *ProjectsContactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1contact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1contact) if err != nil { return nil, err } @@ -2524,12 +2507,11 @@ func (c *ProjectsContactsDeleteCall) Header() http.Header { func (c *ProjectsContactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2635,12 +2617,11 @@ func (c *ProjectsContactsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2763,12 +2744,11 @@ func (c *ProjectsContactsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/contacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2891,8 +2871,7 @@ func (c *ProjectsContactsPatchCall) Header() http.Header { func (c *ProjectsContactsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1contact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1contact) if err != nil { return nil, err } @@ -2998,8 +2977,7 @@ func (c *ProjectsContactsSendTestMessageCall) Header() http.Header { func (c *ProjectsContactsSendTestMessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudessentialcontactsv1sendtestmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudessentialcontactsv1sendtestmessagerequest) if err != nil { return nil, err } diff --git a/eventarc/v1/eventarc-gen.go b/eventarc/v1/eventarc-gen.go index 9e86e19c9f8..7f4dc5cf889 100644 --- a/eventarc/v1/eventarc-gen.go +++ b/eventarc/v1/eventarc-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2734,12 +2733,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2841,12 +2839,11 @@ func (c *ProjectsLocationsGetGoogleChannelConfigCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2973,12 +2970,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3102,8 +3098,7 @@ func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) Header() http.Header { func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechannelconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlechannelconfig) if err != nil { return nil, err } @@ -3211,8 +3206,7 @@ func (c *ProjectsLocationsChannelConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsChannelConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelconnection) if err != nil { return nil, err } @@ -3311,12 +3305,11 @@ func (c *ProjectsLocationsChannelConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsChannelConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3419,12 +3412,11 @@ func (c *ProjectsLocationsChannelConnectionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3547,12 +3539,11 @@ func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3672,12 +3663,11 @@ func (c *ProjectsLocationsChannelConnectionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channelConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3795,8 +3785,7 @@ func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3903,8 +3892,7 @@ func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4019,8 +4007,7 @@ func (c *ProjectsLocationsChannelsCreateCall) Header() http.Header { func (c *ProjectsLocationsChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4126,12 +4113,11 @@ func (c *ProjectsLocationsChannelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsChannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4234,12 +4220,11 @@ func (c *ProjectsLocationsChannelsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4361,12 +4346,11 @@ func (c *ProjectsLocationsChannelsGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4493,12 +4477,11 @@ func (c *ProjectsLocationsChannelsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4630,8 +4613,7 @@ func (c *ProjectsLocationsChannelsPatchCall) Header() http.Header { func (c *ProjectsLocationsChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -4736,8 +4718,7 @@ func (c *ProjectsLocationsChannelsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsChannelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4844,8 +4825,7 @@ func (c *ProjectsLocationsChannelsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsChannelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4961,8 +4941,7 @@ func (c *ProjectsLocationsEnrollmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsEnrollmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollment) if err != nil { return nil, err } @@ -5083,12 +5062,11 @@ func (c *ProjectsLocationsEnrollmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEnrollmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5191,12 +5169,11 @@ func (c *ProjectsLocationsEnrollmentsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5318,12 +5295,11 @@ func (c *ProjectsLocationsEnrollmentsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5458,12 +5434,11 @@ func (c *ProjectsLocationsEnrollmentsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/enrollments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5602,8 +5577,7 @@ func (c *ProjectsLocationsEnrollmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsEnrollmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollment) if err != nil { return nil, err } @@ -5708,8 +5682,7 @@ func (c *ProjectsLocationsEnrollmentsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEnrollmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5816,8 +5789,7 @@ func (c *ProjectsLocationsEnrollmentsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsEnrollmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5933,8 +5905,7 @@ func (c *ProjectsLocationsGoogleApiSourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsGoogleApiSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapisource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapisource) if err != nil { return nil, err } @@ -6055,12 +6026,11 @@ func (c *ProjectsLocationsGoogleApiSourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsGoogleApiSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6163,12 +6133,11 @@ func (c *ProjectsLocationsGoogleApiSourcesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6291,12 +6260,11 @@ func (c *ProjectsLocationsGoogleApiSourcesGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6431,12 +6399,11 @@ func (c *ProjectsLocationsGoogleApiSourcesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/googleApiSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6576,8 +6543,7 @@ func (c *ProjectsLocationsGoogleApiSourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsGoogleApiSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleapisource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleapisource) if err != nil { return nil, err } @@ -6682,8 +6648,7 @@ func (c *ProjectsLocationsGoogleApiSourcesSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsGoogleApiSourcesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6790,8 +6755,7 @@ func (c *ProjectsLocationsGoogleApiSourcesTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsGoogleApiSourcesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6907,8 +6871,7 @@ func (c *ProjectsLocationsMessageBusesCreateCall) Header() http.Header { func (c *ProjectsLocationsMessageBusesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.messagebus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.messagebus) if err != nil { return nil, err } @@ -7029,12 +6992,11 @@ func (c *ProjectsLocationsMessageBusesDeleteCall) Header() http.Header { func (c *ProjectsLocationsMessageBusesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7137,12 +7099,11 @@ func (c *ProjectsLocationsMessageBusesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7264,12 +7225,11 @@ func (c *ProjectsLocationsMessageBusesGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7404,12 +7364,11 @@ func (c *ProjectsLocationsMessageBusesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/messageBuses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7549,12 +7508,11 @@ func (c *ProjectsLocationsMessageBusesListEnrollmentsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:listEnrollments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7693,8 +7651,7 @@ func (c *ProjectsLocationsMessageBusesPatchCall) Header() http.Header { func (c *ProjectsLocationsMessageBusesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.messagebus) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.messagebus) if err != nil { return nil, err } @@ -7799,8 +7756,7 @@ func (c *ProjectsLocationsMessageBusesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMessageBusesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7907,8 +7863,7 @@ func (c *ProjectsLocationsMessageBusesTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsMessageBusesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8017,8 +7972,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -8119,12 +8073,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8228,12 +8181,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8357,12 +8309,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8491,8 +8442,7 @@ func (c *ProjectsLocationsPipelinesCreateCall) Header() http.Header { func (c *ProjectsLocationsPipelinesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pipeline) if err != nil { return nil, err } @@ -8613,12 +8563,11 @@ func (c *ProjectsLocationsPipelinesDeleteCall) Header() http.Header { func (c *ProjectsLocationsPipelinesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8721,12 +8670,11 @@ func (c *ProjectsLocationsPipelinesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8848,12 +8796,11 @@ func (c *ProjectsLocationsPipelinesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8988,12 +8935,11 @@ func (c *ProjectsLocationsPipelinesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pipelines") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9133,8 +9079,7 @@ func (c *ProjectsLocationsPipelinesPatchCall) Header() http.Header { func (c *ProjectsLocationsPipelinesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pipeline) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pipeline) if err != nil { return nil, err } @@ -9239,8 +9184,7 @@ func (c *ProjectsLocationsPipelinesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsPipelinesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9347,8 +9291,7 @@ func (c *ProjectsLocationsPipelinesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsPipelinesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9459,12 +9402,11 @@ func (c *ProjectsLocationsProvidersGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9599,12 +9541,11 @@ func (c *ProjectsLocationsProvidersListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/providers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9732,8 +9673,7 @@ func (c *ProjectsLocationsTriggersCreateCall) Header() http.Header { func (c *ProjectsLocationsTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trigger) if err != nil { return nil, err } @@ -9854,12 +9794,11 @@ func (c *ProjectsLocationsTriggersDeleteCall) Header() http.Header { func (c *ProjectsLocationsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9962,12 +9901,11 @@ func (c *ProjectsLocationsTriggersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10089,12 +10027,11 @@ func (c *ProjectsLocationsTriggersGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10230,12 +10167,11 @@ func (c *ProjectsLocationsTriggersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/triggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10375,8 +10311,7 @@ func (c *ProjectsLocationsTriggersPatchCall) Header() http.Header { func (c *ProjectsLocationsTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trigger) if err != nil { return nil, err } @@ -10481,8 +10416,7 @@ func (c *ProjectsLocationsTriggersSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsTriggersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10589,8 +10523,7 @@ func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsTriggersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/factchecktools/v1alpha1/factchecktools-gen.go b/factchecktools/v1alpha1/factchecktools-gen.go index 226fde4d532..92bb29e4cb0 100644 --- a/factchecktools/v1alpha1/factchecktools-gen.go +++ b/factchecktools/v1alpha1/factchecktools-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Claims = NewClaimsService(s) + s.Pages = NewPagesService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Claims = NewClaimsService(s) - s.Pages = NewPagesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -673,12 +672,11 @@ func (c *ClaimsImageSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/claims:imageSearch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -852,12 +850,11 @@ func (c *ClaimsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/claims:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -964,8 +961,7 @@ func (c *PagesCreateCall) Header() http.Header { func (c *PagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage) if err != nil { return nil, err } @@ -1062,12 +1058,11 @@ func (c *PagesDeleteCall) Header() http.Header { func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1170,12 +1165,11 @@ func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1319,12 +1313,11 @@ func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1440,8 +1433,7 @@ func (c *PagesUpdateCall) Header() http.Header { func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage) if err != nil { return nil, err } diff --git a/fcm/v1/fcm-gen.go b/fcm/v1/fcm-gen.go index 66528b21300..ea15e1ef371 100644 --- a/fcm/v1/fcm-gen.go +++ b/fcm/v1/fcm-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -923,8 +922,7 @@ func (c *ProjectsMessagesSendCall) Header() http.Header { func (c *ProjectsMessagesSendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendmessagerequest) if err != nil { return nil, err } diff --git a/fcmdata/v1beta1/fcmdata-gen.go b/fcmdata/v1beta1/fcmdata-gen.go index 6b9456297a7..086ec808083 100644 --- a/fcmdata/v1beta1/fcmdata-gen.go +++ b/fcmdata/v1beta1/fcmdata-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -669,12 +668,11 @@ func (c *ProjectsAndroidAppsDeliveryDataListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/deliveryData") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/file/v1/file-gen.go b/file/v1/file-gen.go index 486c38d4e00..e451c0cf275 100644 --- a/file/v1/file-gen.go +++ b/file/v1/file-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1986,12 +1985,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2125,12 +2123,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2256,8 +2253,7 @@ func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -2356,12 +2352,11 @@ func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2464,12 +2459,11 @@ func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2603,12 +2597,11 @@ func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2730,8 +2723,7 @@ func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -2843,8 +2835,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2951,12 +2942,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3059,12 +3049,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3198,12 +3187,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3328,8 +3316,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3430,8 +3417,7 @@ func (c *ProjectsLocationsInstancesPromoteReplicaCall) Header() http.Header { func (c *ProjectsLocationsInstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotereplicarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promotereplicarequest) if err != nil { return nil, err } @@ -3536,8 +3522,7 @@ func (c *ProjectsLocationsInstancesRestoreCall) Header() http.Header { func (c *ProjectsLocationsInstancesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreinstancerequest) if err != nil { return nil, err } @@ -3638,8 +3623,7 @@ func (c *ProjectsLocationsInstancesRevertCall) Header() http.Header { func (c *ProjectsLocationsInstancesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revertinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revertinstancerequest) if err != nil { return nil, err } @@ -3749,8 +3733,7 @@ func (c *ProjectsLocationsInstancesSnapshotsCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -3850,12 +3833,11 @@ func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3959,12 +3941,11 @@ func (c *ProjectsLocationsInstancesSnapshotsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4096,12 +4077,11 @@ func (c *ProjectsLocationsInstancesSnapshotsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4224,8 +4204,7 @@ func (c *ProjectsLocationsInstancesSnapshotsPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesSnapshotsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -4333,8 +4312,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4435,12 +4413,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4544,12 +4521,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4672,12 +4648,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/file/v1beta1/file-gen.go b/file/v1beta1/file-gen.go index 1b775ad17e0..26d6514fb27 100644 --- a/file/v1beta1/file-gen.go +++ b/file/v1beta1/file-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2170,12 +2169,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2309,12 +2307,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2439,8 +2436,7 @@ func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -2539,12 +2535,11 @@ func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2647,12 +2642,11 @@ func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2786,12 +2780,11 @@ func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2913,8 +2906,7 @@ func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -3027,8 +3019,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3135,12 +3126,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3243,12 +3233,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3382,12 +3371,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3513,8 +3501,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3615,8 +3602,7 @@ func (c *ProjectsLocationsInstancesPromoteReplicaCall) Header() http.Header { func (c *ProjectsLocationsInstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotereplicarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.promotereplicarequest) if err != nil { return nil, err } @@ -3720,8 +3706,7 @@ func (c *ProjectsLocationsInstancesRestoreCall) Header() http.Header { func (c *ProjectsLocationsInstancesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreinstancerequest) if err != nil { return nil, err } @@ -3822,8 +3807,7 @@ func (c *ProjectsLocationsInstancesRevertCall) Header() http.Header { func (c *ProjectsLocationsInstancesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revertinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revertinstancerequest) if err != nil { return nil, err } @@ -3933,8 +3917,7 @@ func (c *ProjectsLocationsInstancesSharesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesSharesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.share) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.share) if err != nil { return nil, err } @@ -4034,12 +4017,11 @@ func (c *ProjectsLocationsInstancesSharesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesSharesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4143,12 +4125,11 @@ func (c *ProjectsLocationsInstancesSharesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4279,12 +4260,11 @@ func (c *ProjectsLocationsInstancesSharesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/shares") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4409,8 +4389,7 @@ func (c *ProjectsLocationsInstancesSharesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesSharesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.share) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.share) if err != nil { return nil, err } @@ -4520,8 +4499,7 @@ func (c *ProjectsLocationsInstancesSnapshotsCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -4621,12 +4599,11 @@ func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4730,12 +4707,11 @@ func (c *ProjectsLocationsInstancesSnapshotsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4867,12 +4843,11 @@ func (c *ProjectsLocationsInstancesSnapshotsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4995,8 +4970,7 @@ func (c *ProjectsLocationsInstancesSnapshotsPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesSnapshotsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snapshot) if err != nil { return nil, err } @@ -5104,8 +5078,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5206,12 +5179,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5315,12 +5287,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5443,12 +5414,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firebase/v1beta1/firebase-gen.go b/firebase/v1beta1/firebase-gen.go index 606bc844725..8886b2ad89d 100644 --- a/firebase/v1beta1/firebase-gen.go +++ b/firebase/v1beta1/firebase-gen.go @@ -133,7 +133,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AvailableProjects = NewAvailableProjectsService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -152,11 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AvailableProjects = NewAvailableProjectsService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1999,12 +1998,11 @@ func (c *AvailableProjectsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/availableProjects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2127,12 +2125,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2255,8 +2252,7 @@ func (c *ProjectsAddFirebaseCall) Header() http.Header { func (c *ProjectsAddFirebaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addfirebaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addfirebaserequest) if err != nil { return nil, err } @@ -2394,8 +2390,7 @@ func (c *ProjectsAddGoogleAnalyticsCall) Header() http.Header { func (c *ProjectsAddGoogleAnalyticsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addgoogleanalyticsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addgoogleanalyticsrequest) if err != nil { return nil, err } @@ -2508,12 +2503,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2623,12 +2617,11 @@ func (c *ProjectsGetAdminSdkConfigCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2736,12 +2729,11 @@ func (c *ProjectsGetAnalyticsDetailsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2873,12 +2865,11 @@ func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3009,8 +3000,7 @@ func (c *ProjectsPatchCall) Header() http.Header { func (c *ProjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firebaseproject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firebaseproject) if err != nil { return nil, err } @@ -3124,8 +3114,7 @@ func (c *ProjectsRemoveAnalyticsCall) Header() http.Header { func (c *ProjectsRemoveAnalyticsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeanalyticsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeanalyticsrequest) if err != nil { return nil, err } @@ -3293,12 +3282,11 @@ func (c *ProjectsSearchAppsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:searchApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3419,8 +3407,7 @@ func (c *ProjectsAndroidAppsCreateCall) Header() http.Header { func (c *ProjectsAndroidAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.androidapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.androidapp) if err != nil { return nil, err } @@ -3535,12 +3522,11 @@ func (c *ProjectsAndroidAppsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3649,12 +3635,11 @@ func (c *ProjectsAndroidAppsGetConfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3788,12 +3773,11 @@ func (c *ProjectsAndroidAppsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/androidApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3925,8 +3909,7 @@ func (c *ProjectsAndroidAppsPatchCall) Header() http.Header { func (c *ProjectsAndroidAppsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.androidapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.androidapp) if err != nil { return nil, err } @@ -4031,8 +4014,7 @@ func (c *ProjectsAndroidAppsRemoveCall) Header() http.Header { func (c *ProjectsAndroidAppsRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeandroidapprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeandroidapprequest) if err != nil { return nil, err } @@ -4137,8 +4119,7 @@ func (c *ProjectsAndroidAppsUndeleteCall) Header() http.Header { func (c *ProjectsAndroidAppsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteandroidapprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteandroidapprequest) if err != nil { return nil, err } @@ -4244,8 +4225,7 @@ func (c *ProjectsAndroidAppsShaCreateCall) Header() http.Header { func (c *ProjectsAndroidAppsShaCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shacertificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shacertificate) if err != nil { return nil, err } @@ -4350,12 +4330,11 @@ func (c *ProjectsAndroidAppsShaDeleteCall) Header() http.Header { func (c *ProjectsAndroidAppsShaDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4463,12 +4442,11 @@ func (c *ProjectsAndroidAppsShaListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/sha") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4617,12 +4595,11 @@ func (c *ProjectsAvailableLocationsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/availableLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4770,8 +4747,7 @@ func (c *ProjectsDefaultLocationFinalizeCall) Header() http.Header { func (c *ProjectsDefaultLocationFinalizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finalizedefaultlocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finalizedefaultlocationrequest) if err != nil { return nil, err } @@ -4877,8 +4853,7 @@ func (c *ProjectsIosAppsCreateCall) Header() http.Header { func (c *ProjectsIosAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.iosapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.iosapp) if err != nil { return nil, err } @@ -4993,12 +4968,11 @@ func (c *ProjectsIosAppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5106,12 +5080,11 @@ func (c *ProjectsIosAppsGetConfigCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5244,12 +5217,11 @@ func (c *ProjectsIosAppsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/iosApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5381,8 +5353,7 @@ func (c *ProjectsIosAppsPatchCall) Header() http.Header { func (c *ProjectsIosAppsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.iosapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.iosapp) if err != nil { return nil, err } @@ -5487,8 +5458,7 @@ func (c *ProjectsIosAppsRemoveCall) Header() http.Header { func (c *ProjectsIosAppsRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeiosapprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeiosapprequest) if err != nil { return nil, err } @@ -5593,8 +5563,7 @@ func (c *ProjectsIosAppsUndeleteCall) Header() http.Header { func (c *ProjectsIosAppsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteiosapprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteiosapprequest) if err != nil { return nil, err } @@ -5700,8 +5669,7 @@ func (c *ProjectsWebAppsCreateCall) Header() http.Header { func (c *ProjectsWebAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webapp) if err != nil { return nil, err } @@ -5816,12 +5784,11 @@ func (c *ProjectsWebAppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5929,12 +5896,11 @@ func (c *ProjectsWebAppsGetConfigCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6067,12 +6033,11 @@ func (c *ProjectsWebAppsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/webApps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6204,8 +6169,7 @@ func (c *ProjectsWebAppsPatchCall) Header() http.Header { func (c *ProjectsWebAppsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.webapp) if err != nil { return nil, err } @@ -6310,8 +6274,7 @@ func (c *ProjectsWebAppsRemoveCall) Header() http.Header { func (c *ProjectsWebAppsRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removewebapprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removewebapprequest) if err != nil { return nil, err } @@ -6416,8 +6379,7 @@ func (c *ProjectsWebAppsUndeleteCall) Header() http.Header { func (c *ProjectsWebAppsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletewebapprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletewebapprequest) if err != nil { return nil, err } diff --git a/firebaseappcheck/v1/firebaseappcheck-gen.go b/firebaseappcheck/v1/firebaseappcheck-gen.go index aba26a9c784..463beb5baa0 100644 --- a/firebaseappcheck/v1/firebaseappcheck-gen.go +++ b/firebaseappcheck/v1/firebaseappcheck-gen.go @@ -124,7 +124,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Jwks = NewJwksService(s) + s.OauthClients = NewOauthClientsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,11 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Jwks = NewJwksService(s) - s.OauthClients = NewOauthClientsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1749,12 +1748,11 @@ func (c *JwksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1853,8 +1851,7 @@ func (c *OauthClientsExchangeAppAttestAssertionCall) Header() http.Header { func (c *OauthClientsExchangeAppAttestAssertionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestassertionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangeappattestassertionrequest) if err != nil { return nil, err } @@ -1964,8 +1961,7 @@ func (c *OauthClientsExchangeAppAttestAttestationCall) Header() http.Header { func (c *OauthClientsExchangeAppAttestAttestationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestattestationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangeappattestattestationrequest) if err != nil { return nil, err } @@ -2073,8 +2069,7 @@ func (c *OauthClientsExchangeDebugTokenCall) Header() http.Header { func (c *OauthClientsExchangeDebugTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangedebugtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangedebugtokenrequest) if err != nil { return nil, err } @@ -2182,8 +2177,7 @@ func (c *OauthClientsGenerateAppAttestChallengeCall) Header() http.Header { func (c *OauthClientsGenerateAppAttestChallengeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1generateappattestchallengerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1generateappattestchallengerequest) if err != nil { return nil, err } @@ -2290,8 +2284,7 @@ func (c *ProjectsAppsExchangeAppAttestAssertionCall) Header() http.Header { func (c *ProjectsAppsExchangeAppAttestAssertionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestassertionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangeappattestassertionrequest) if err != nil { return nil, err } @@ -2401,8 +2394,7 @@ func (c *ProjectsAppsExchangeAppAttestAttestationCall) Header() http.Header { func (c *ProjectsAppsExchangeAppAttestAttestationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestattestationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangeappattestattestationrequest) if err != nil { return nil, err } @@ -2508,8 +2500,7 @@ func (c *ProjectsAppsExchangeCustomTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeCustomTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangecustomtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangecustomtokenrequest) if err != nil { return nil, err } @@ -2617,8 +2608,7 @@ func (c *ProjectsAppsExchangeDebugTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeDebugTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangedebugtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangedebugtokenrequest) if err != nil { return nil, err } @@ -2726,8 +2716,7 @@ func (c *ProjectsAppsExchangeDeviceCheckTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeDeviceCheckTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangedevicechecktokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangedevicechecktokenrequest) if err != nil { return nil, err } @@ -2835,8 +2824,7 @@ func (c *ProjectsAppsExchangePlayIntegrityTokenCall) Header() http.Header { func (c *ProjectsAppsExchangePlayIntegrityTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeplayintegritytokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangeplayintegritytokenrequest) if err != nil { return nil, err } @@ -2944,8 +2932,7 @@ func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) Header() http.Header func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest) if err != nil { return nil, err } @@ -3052,8 +3039,7 @@ func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) Header() http.Header { func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangerecaptchav3tokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangerecaptchav3tokenrequest) if err != nil { return nil, err } @@ -3160,8 +3146,7 @@ func (c *ProjectsAppsExchangeSafetyNetTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeSafetyNetTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangesafetynettokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1exchangesafetynettokenrequest) if err != nil { return nil, err } @@ -3269,8 +3254,7 @@ func (c *ProjectsAppsGenerateAppAttestChallengeCall) Header() http.Header { func (c *ProjectsAppsGenerateAppAttestChallengeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1generateappattestchallengerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1generateappattestchallengerequest) if err != nil { return nil, err } @@ -3379,8 +3363,7 @@ func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) Header() http.Header { func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1generateplayintegritychallengerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1generateplayintegritychallengerequest) if err != nil { return nil, err } @@ -3504,12 +3487,11 @@ func (c *ProjectsAppsAppAttestConfigBatchGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/appAttestConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3613,12 +3595,11 @@ func (c *ProjectsAppsAppAttestConfigGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3723,8 +3704,7 @@ func (c *ProjectsAppsAppAttestConfigPatchCall) Header() http.Header { func (c *ProjectsAppsAppAttestConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1appattestconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1appattestconfig) if err != nil { return nil, err } @@ -3830,8 +3810,7 @@ func (c *ProjectsAppsDebugTokensCreateCall) Header() http.Header { func (c *ProjectsAppsDebugTokensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1debugtoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1debugtoken) if err != nil { return nil, err } @@ -3935,12 +3914,11 @@ func (c *ProjectsAppsDebugTokensDeleteCall) Header() http.Header { func (c *ProjectsAppsDebugTokensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4045,12 +4023,11 @@ func (c *ProjectsAppsDebugTokensGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4177,12 +4154,11 @@ func (c *ProjectsAppsDebugTokensListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/debugTokens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4307,8 +4283,7 @@ func (c *ProjectsAppsDebugTokensPatchCall) Header() http.Header { func (c *ProjectsAppsDebugTokensPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1debugtoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1debugtoken) if err != nil { return nil, err } @@ -4433,12 +4408,11 @@ func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/deviceCheckConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4543,12 +4517,11 @@ func (c *ProjectsAppsDeviceCheckConfigGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4654,8 +4627,7 @@ func (c *ProjectsAppsDeviceCheckConfigPatchCall) Header() http.Header { func (c *ProjectsAppsDeviceCheckConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1devicecheckconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1devicecheckconfig) if err != nil { return nil, err } @@ -4779,12 +4751,11 @@ func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/playIntegrityConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4889,12 +4860,11 @@ func (c *ProjectsAppsPlayIntegrityConfigGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4999,8 +4969,7 @@ func (c *ProjectsAppsPlayIntegrityConfigPatchCall) Header() http.Header { func (c *ProjectsAppsPlayIntegrityConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1playintegrityconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1playintegrityconfig) if err != nil { return nil, err } @@ -5124,12 +5093,11 @@ func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/recaptchaEnterpriseConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5234,12 +5202,11 @@ func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5344,8 +5311,7 @@ func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) Header() http.Header { func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1recaptchaenterpriseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1recaptchaenterpriseconfig) if err != nil { return nil, err } @@ -5470,12 +5436,11 @@ func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/recaptchaV3Config:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5580,12 +5545,11 @@ func (c *ProjectsAppsRecaptchaV3ConfigGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5691,8 +5655,7 @@ func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) Header() http.Header { func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1recaptchav3config) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1recaptchav3config) if err != nil { return nil, err } @@ -5816,12 +5779,11 @@ func (c *ProjectsAppsSafetyNetConfigBatchGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/safetyNetConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5925,12 +5887,11 @@ func (c *ProjectsAppsSafetyNetConfigGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6035,8 +5996,7 @@ func (c *ProjectsAppsSafetyNetConfigPatchCall) Header() http.Header { func (c *ProjectsAppsSafetyNetConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1safetynetconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1safetynetconfig) if err != nil { return nil, err } @@ -6140,8 +6100,7 @@ func (c *ProjectsServicesBatchUpdateCall) Header() http.Header { func (c *ProjectsServicesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1batchupdateservicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1batchupdateservicesrequest) if err != nil { return nil, err } @@ -6258,12 +6217,11 @@ func (c *ProjectsServicesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6390,12 +6348,11 @@ func (c *ProjectsServicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6524,8 +6481,7 @@ func (c *ProjectsServicesPatchCall) Header() http.Header { func (c *ProjectsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1service) if err != nil { return nil, err } @@ -6629,8 +6585,7 @@ func (c *ProjectsServicesResourcePoliciesBatchUpdateCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1batchupdateresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1batchupdateresourcepoliciesrequest) if err != nil { return nil, err } @@ -6736,8 +6691,7 @@ func (c *ProjectsServicesResourcePoliciesCreateCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1resourcepolicy) if err != nil { return nil, err } @@ -6852,12 +6806,11 @@ func (c *ProjectsServicesResourcePoliciesDeleteCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6965,12 +6918,11 @@ func (c *ProjectsServicesResourcePoliciesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7114,12 +7066,11 @@ func (c *ProjectsServicesResourcePoliciesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7247,8 +7198,7 @@ func (c *ProjectsServicesResourcePoliciesPatchCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1resourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1resourcepolicy) if err != nil { return nil, err } diff --git a/firebaseappcheck/v1beta/firebaseappcheck-gen.go b/firebaseappcheck/v1beta/firebaseappcheck-gen.go index 01b412d47b4..9c497dffc9f 100644 --- a/firebaseappcheck/v1beta/firebaseappcheck-gen.go +++ b/firebaseappcheck/v1beta/firebaseappcheck-gen.go @@ -124,7 +124,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Jwks = NewJwksService(s) + s.OauthClients = NewOauthClientsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,11 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Jwks = NewJwksService(s) - s.OauthClients = NewOauthClientsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1966,12 +1965,11 @@ func (c *JwksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2078,8 +2076,7 @@ func (c *OauthClientsExchangeAppAttestAssertionCall) Header() http.Header { func (c *OauthClientsExchangeAppAttestAssertionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangeappattestassertionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangeappattestassertionrequest) if err != nil { return nil, err } @@ -2197,8 +2194,7 @@ func (c *OauthClientsExchangeAppAttestAttestationCall) Header() http.Header { func (c *OauthClientsExchangeAppAttestAttestationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangeappattestattestationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangeappattestattestationrequest) if err != nil { return nil, err } @@ -2314,8 +2310,7 @@ func (c *OauthClientsExchangeDebugTokenCall) Header() http.Header { func (c *OauthClientsExchangeDebugTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangedebugtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangedebugtokenrequest) if err != nil { return nil, err } @@ -2431,8 +2426,7 @@ func (c *OauthClientsGenerateAppAttestChallengeCall) Header() http.Header { func (c *OauthClientsGenerateAppAttestChallengeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betagenerateappattestchallengerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betagenerateappattestchallengerequest) if err != nil { return nil, err } @@ -2558,8 +2552,7 @@ func (c *ProjectsVerifyAppCheckTokenCall) Header() http.Header { func (c *ProjectsVerifyAppCheckTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaverifyappchecktokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaverifyappchecktokenrequest) if err != nil { return nil, err } @@ -2674,8 +2667,7 @@ func (c *ProjectsAppsExchangeAppAttestAssertionCall) Header() http.Header { func (c *ProjectsAppsExchangeAppAttestAssertionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangeappattestassertionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangeappattestassertionrequest) if err != nil { return nil, err } @@ -2793,8 +2785,7 @@ func (c *ProjectsAppsExchangeAppAttestAttestationCall) Header() http.Header { func (c *ProjectsAppsExchangeAppAttestAttestationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangeappattestattestationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangeappattestattestationrequest) if err != nil { return nil, err } @@ -2900,8 +2891,7 @@ func (c *ProjectsAppsExchangeCustomTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeCustomTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangecustomtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangecustomtokenrequest) if err != nil { return nil, err } @@ -3017,8 +3007,7 @@ func (c *ProjectsAppsExchangeDebugTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeDebugTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangedebugtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangedebugtokenrequest) if err != nil { return nil, err } @@ -3126,8 +3115,7 @@ func (c *ProjectsAppsExchangeDeviceCheckTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeDeviceCheckTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangedevicechecktokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangedevicechecktokenrequest) if err != nil { return nil, err } @@ -3235,8 +3223,7 @@ func (c *ProjectsAppsExchangePlayIntegrityTokenCall) Header() http.Header { func (c *ProjectsAppsExchangePlayIntegrityTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangeplayintegritytokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangeplayintegritytokenrequest) if err != nil { return nil, err } @@ -3344,8 +3331,7 @@ func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) Header() http.Header func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangerecaptchaenterprisetokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangerecaptchaenterprisetokenrequest) if err != nil { return nil, err } @@ -3452,8 +3438,7 @@ func (c *ProjectsAppsExchangeRecaptchaTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeRecaptchaTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangerecaptchatokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangerecaptchatokenrequest) if err != nil { return nil, err } @@ -3560,8 +3545,7 @@ func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) Header() http.Header { func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangerecaptchav3tokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangerecaptchav3tokenrequest) if err != nil { return nil, err } @@ -3668,8 +3652,7 @@ func (c *ProjectsAppsExchangeSafetyNetTokenCall) Header() http.Header { func (c *ProjectsAppsExchangeSafetyNetTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaexchangesafetynettokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaexchangesafetynettokenrequest) if err != nil { return nil, err } @@ -3785,8 +3768,7 @@ func (c *ProjectsAppsGenerateAppAttestChallengeCall) Header() http.Header { func (c *ProjectsAppsGenerateAppAttestChallengeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betagenerateappattestchallengerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betagenerateappattestchallengerequest) if err != nil { return nil, err } @@ -3895,8 +3877,7 @@ func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) Header() http.Header { func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betagenerateplayintegritychallengerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betagenerateplayintegritychallengerequest) if err != nil { return nil, err } @@ -4020,12 +4001,11 @@ func (c *ProjectsAppsAppAttestConfigBatchGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/appAttestConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4129,12 +4109,11 @@ func (c *ProjectsAppsAppAttestConfigGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4239,8 +4218,7 @@ func (c *ProjectsAppsAppAttestConfigPatchCall) Header() http.Header { func (c *ProjectsAppsAppAttestConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaappattestconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaappattestconfig) if err != nil { return nil, err } @@ -4346,8 +4324,7 @@ func (c *ProjectsAppsDebugTokensCreateCall) Header() http.Header { func (c *ProjectsAppsDebugTokensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betadebugtoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betadebugtoken) if err != nil { return nil, err } @@ -4451,12 +4428,11 @@ func (c *ProjectsAppsDebugTokensDeleteCall) Header() http.Header { func (c *ProjectsAppsDebugTokensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4561,12 +4537,11 @@ func (c *ProjectsAppsDebugTokensGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4693,12 +4668,11 @@ func (c *ProjectsAppsDebugTokensListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/debugTokens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4823,8 +4797,7 @@ func (c *ProjectsAppsDebugTokensPatchCall) Header() http.Header { func (c *ProjectsAppsDebugTokensPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betadebugtoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betadebugtoken) if err != nil { return nil, err } @@ -4949,12 +4922,11 @@ func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/deviceCheckConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5059,12 +5031,11 @@ func (c *ProjectsAppsDeviceCheckConfigGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5170,8 +5141,7 @@ func (c *ProjectsAppsDeviceCheckConfigPatchCall) Header() http.Header { func (c *ProjectsAppsDeviceCheckConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betadevicecheckconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betadevicecheckconfig) if err != nil { return nil, err } @@ -5295,12 +5265,11 @@ func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/playIntegrityConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5405,12 +5374,11 @@ func (c *ProjectsAppsPlayIntegrityConfigGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5515,8 +5483,7 @@ func (c *ProjectsAppsPlayIntegrityConfigPatchCall) Header() http.Header { func (c *ProjectsAppsPlayIntegrityConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaplayintegrityconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaplayintegrityconfig) if err != nil { return nil, err } @@ -5641,12 +5608,11 @@ func (c *ProjectsAppsRecaptchaConfigBatchGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/recaptchaConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5751,12 +5717,11 @@ func (c *ProjectsAppsRecaptchaConfigGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5862,8 +5827,7 @@ func (c *ProjectsAppsRecaptchaConfigPatchCall) Header() http.Header { func (c *ProjectsAppsRecaptchaConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betarecaptchaconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betarecaptchaconfig) if err != nil { return nil, err } @@ -5987,12 +5951,11 @@ func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/recaptchaEnterpriseConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6097,12 +6060,11 @@ func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6207,8 +6169,7 @@ func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) Header() http.Header { func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betarecaptchaenterpriseconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betarecaptchaenterpriseconfig) if err != nil { return nil, err } @@ -6333,12 +6294,11 @@ func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/recaptchaV3Config:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6443,12 +6403,11 @@ func (c *ProjectsAppsRecaptchaV3ConfigGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6554,8 +6513,7 @@ func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) Header() http.Header { func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betarecaptchav3config) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betarecaptchav3config) if err != nil { return nil, err } @@ -6679,12 +6637,11 @@ func (c *ProjectsAppsSafetyNetConfigBatchGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps/-/safetyNetConfig:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6788,12 +6745,11 @@ func (c *ProjectsAppsSafetyNetConfigGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6898,8 +6854,7 @@ func (c *ProjectsAppsSafetyNetConfigPatchCall) Header() http.Header { func (c *ProjectsAppsSafetyNetConfigPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betasafetynetconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betasafetynetconfig) if err != nil { return nil, err } @@ -7003,8 +6958,7 @@ func (c *ProjectsServicesBatchUpdateCall) Header() http.Header { func (c *ProjectsServicesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betabatchupdateservicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betabatchupdateservicesrequest) if err != nil { return nil, err } @@ -7122,12 +7076,11 @@ func (c *ProjectsServicesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7254,12 +7207,11 @@ func (c *ProjectsServicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7389,8 +7341,7 @@ func (c *ProjectsServicesPatchCall) Header() http.Header { func (c *ProjectsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaservice) if err != nil { return nil, err } @@ -7494,8 +7445,7 @@ func (c *ProjectsServicesResourcePoliciesBatchUpdateCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betabatchupdateresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betabatchupdateresourcepoliciesrequest) if err != nil { return nil, err } @@ -7601,8 +7551,7 @@ func (c *ProjectsServicesResourcePoliciesCreateCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaresourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaresourcepolicy) if err != nil { return nil, err } @@ -7717,12 +7666,11 @@ func (c *ProjectsServicesResourcePoliciesDeleteCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7830,12 +7778,11 @@ func (c *ProjectsServicesResourcePoliciesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7979,12 +7926,11 @@ func (c *ProjectsServicesResourcePoliciesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/resourcePolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8112,8 +8058,7 @@ func (c *ProjectsServicesResourcePoliciesPatchCall) Header() http.Header { func (c *ProjectsServicesResourcePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1betaresourcepolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappcheckv1betaresourcepolicy) if err != nil { return nil, err } diff --git a/firebaseappdistribution/v1/firebaseappdistribution-gen.go b/firebaseappdistribution/v1/firebaseappdistribution-gen.go index 8bcc834d343..f243e502b7e 100644 --- a/firebaseappdistribution/v1/firebaseappdistribution-gen.go +++ b/firebaseappdistribution/v1/firebaseappdistribution-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Media = NewMediaService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Media = NewMediaService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1627,8 +1626,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1uploadreleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1uploadreleaserequest) if err != nil { return nil, err } @@ -1639,14 +1637,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1/{+app}/releases:upload") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -1768,12 +1762,11 @@ func (c *ProjectsAppsGetAabInfoCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1868,8 +1861,7 @@ func (c *ProjectsAppsReleasesBatchDeleteCall) Header() http.Header { func (c *ProjectsAppsReleasesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1batchdeletereleasesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1batchdeletereleasesrequest) if err != nil { return nil, err } @@ -1975,8 +1967,7 @@ func (c *ProjectsAppsReleasesDistributeCall) Header() http.Header { func (c *ProjectsAppsReleasesDistributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1distributereleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1distributereleaserequest) if err != nil { return nil, err } @@ -2088,12 +2079,11 @@ func (c *ProjectsAppsReleasesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2238,12 +2228,11 @@ func (c *ProjectsAppsReleasesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2365,8 +2354,7 @@ func (c *ProjectsAppsReleasesPatchCall) Header() http.Header { func (c *ProjectsAppsReleasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1release) if err != nil { return nil, err } @@ -2467,12 +2455,11 @@ func (c *ProjectsAppsReleasesFeedbackReportsDeleteCall) Header() http.Header { func (c *ProjectsAppsReleasesFeedbackReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2577,12 +2564,11 @@ func (c *ProjectsAppsReleasesFeedbackReportsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2706,12 +2692,11 @@ func (c *ProjectsAppsReleasesFeedbackReportsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/feedbackReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2833,8 +2818,7 @@ func (c *ProjectsAppsReleasesOperationsCancelCall) Header() http.Header { func (c *ProjectsAppsReleasesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -2936,12 +2920,11 @@ func (c *ProjectsAppsReleasesOperationsDeleteCall) Header() http.Header { func (c *ProjectsAppsReleasesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3046,12 +3029,11 @@ func (c *ProjectsAppsReleasesOperationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3175,12 +3157,11 @@ func (c *ProjectsAppsReleasesOperationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3302,8 +3283,7 @@ func (c *ProjectsAppsReleasesOperationsWaitCall) Header() http.Header { func (c *ProjectsAppsReleasesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningwaitoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningwaitoperationrequest) if err != nil { return nil, err } @@ -3406,8 +3386,7 @@ func (c *ProjectsGroupsBatchJoinCall) Header() http.Header { func (c *ProjectsGroupsBatchJoinCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1batchjoingrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1batchjoingrouprequest) if err != nil { return nil, err } @@ -3510,8 +3489,7 @@ func (c *ProjectsGroupsBatchLeaveCall) Header() http.Header { func (c *ProjectsGroupsBatchLeaveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1batchleavegrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1batchleavegrouprequest) if err != nil { return nil, err } @@ -3624,8 +3602,7 @@ func (c *ProjectsGroupsCreateCall) Header() http.Header { func (c *ProjectsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1group) if err != nil { return nil, err } @@ -3725,12 +3702,11 @@ func (c *ProjectsGroupsDeleteCall) Header() http.Header { func (c *ProjectsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3834,12 +3810,11 @@ func (c *ProjectsGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3961,12 +3936,11 @@ func (c *ProjectsGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4088,8 +4062,7 @@ func (c *ProjectsGroupsPatchCall) Header() http.Header { func (c *ProjectsGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1group) if err != nil { return nil, err } @@ -4194,8 +4167,7 @@ func (c *ProjectsTestersBatchAddCall) Header() http.Header { func (c *ProjectsTestersBatchAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1batchaddtestersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1batchaddtestersrequest) if err != nil { return nil, err } @@ -4298,8 +4270,7 @@ func (c *ProjectsTestersBatchRemoveCall) Header() http.Header { func (c *ProjectsTestersBatchRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1batchremovetestersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1batchremovetestersrequest) if err != nil { return nil, err } @@ -4440,12 +4411,11 @@ func (c *ProjectsTestersListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/testers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4568,8 +4538,7 @@ func (c *ProjectsTestersPatchCall) Header() http.Header { func (c *ProjectsTestersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1tester) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1tester) if err != nil { return nil, err } diff --git a/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go b/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go index 2e0589807bc..5c7d2c2c8b1 100644 --- a/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go +++ b/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Apps = NewAppsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1671,12 +1670,11 @@ func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{mobilesdkAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1781,12 +1779,11 @@ func (c *AppsGetJwtCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{mobilesdkAppId}/jwt") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1880,12 +1877,11 @@ func (c *AppsProvisionAppCall) Header() http.Header { func (c *AppsProvisionAppCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{mobilesdkAppId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1993,12 +1989,11 @@ func (c *AppsReleaseByHashGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{mobilesdkAppId}/release_by_hash/{uploadHash}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2097,8 +2092,7 @@ func (c *AppsReleasesEnableAccessCall) Header() http.Header { func (c *AppsReleasesEnableAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1alphaenableaccessonreleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1alphaenableaccessonreleaserequest) if err != nil { return nil, err } @@ -2205,8 +2199,7 @@ func (c *AppsReleasesNotesCreateCall) Header() http.Header { func (c *AppsReleasesNotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1alphacreatereleasenotesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1alphacreatereleasenotesrequest) if err != nil { return nil, err } @@ -2327,12 +2320,11 @@ func (c *AppsTestersGetTesterUdidsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{mobilesdkAppId}/testers:getTesterUdids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2440,12 +2432,11 @@ func (c *AppsUploadStatusGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/apps/{mobilesdkAppId}/upload_status/{uploadToken}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2550,12 +2541,11 @@ func (c *ProjectsAppsGetTestConfigCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2656,8 +2646,7 @@ func (c *ProjectsAppsUpdateTestConfigCall) Header() http.Header { func (c *ProjectsAppsUpdateTestConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1alphatestconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1alphatestconfig) if err != nil { return nil, err } @@ -2770,12 +2759,11 @@ func (c *ProjectsAppsReleasesTestsCancelCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2878,8 +2866,7 @@ func (c *ProjectsAppsReleasesTestsCreateCall) Header() http.Header { func (c *ProjectsAppsReleasesTestsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1alphareleasetest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1alphareleasetest) if err != nil { return nil, err } @@ -2992,12 +2979,11 @@ func (c *ProjectsAppsReleasesTestsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3136,12 +3122,11 @@ func (c *ProjectsAppsReleasesTestsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/tests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3266,8 +3251,7 @@ func (c *ProjectsAppsTestCasesCreateCall) Header() http.Header { func (c *ProjectsAppsTestCasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1alphatestcase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1alphatestcase) if err != nil { return nil, err } @@ -3367,12 +3351,11 @@ func (c *ProjectsAppsTestCasesDeleteCall) Header() http.Header { func (c *ProjectsAppsTestCasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3476,12 +3459,11 @@ func (c *ProjectsAppsTestCasesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3603,12 +3585,11 @@ func (c *ProjectsAppsTestCasesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/testCases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3723,8 +3704,7 @@ func (c *ProjectsAppsTestCasesPatchCall) Header() http.Header { func (c *ProjectsAppsTestCasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappdistrov1alphatestcase) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirebaseappdistrov1alphatestcase) if err != nil { return nil, err } @@ -3845,12 +3825,11 @@ func (c *ProjectsTestersGetUdidsCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+project}/testers:udids") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firebasedatabase/v1beta/firebasedatabase-gen.go b/firebasedatabase/v1beta/firebasedatabase-gen.go index c6b41f6be33..804dbce7279 100644 --- a/firebasedatabase/v1beta/firebasedatabase-gen.go +++ b/firebasedatabase/v1beta/firebasedatabase-gen.go @@ -133,7 +133,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -152,9 +153,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -372,8 +371,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -478,12 +476,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -580,8 +577,7 @@ func (c *ProjectsLocationsInstancesDisableCall) Header() http.Header { func (c *ProjectsLocationsInstancesDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disabledatabaseinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disabledatabaseinstancerequest) if err != nil { return nil, err } @@ -699,12 +695,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -839,12 +834,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -962,8 +956,7 @@ func (c *ProjectsLocationsInstancesReenableCall) Header() http.Header { func (c *ProjectsLocationsInstancesReenableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reenabledatabaseinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reenabledatabaseinstancerequest) if err != nil { return nil, err } @@ -1071,8 +1064,7 @@ func (c *ProjectsLocationsInstancesUndeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletedatabaseinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletedatabaseinstancerequest) if err != nil { return nil, err } diff --git a/firebasedynamiclinks/v1/firebasedynamiclinks-gen.go b/firebasedynamiclinks/v1/firebasedynamiclinks-gen.go index 38429447bd0..3ebfb1ce663 100644 --- a/firebasedynamiclinks/v1/firebasedynamiclinks-gen.go +++ b/firebasedynamiclinks/v1/firebasedynamiclinks-gen.go @@ -114,7 +114,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.ManagedShortLinks = NewManagedShortLinksService(s) + s.ShortLinks = NewShortLinksService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -133,11 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.ManagedShortLinks = NewManagedShortLinksService(s) - s.ShortLinks = NewShortLinksService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1168,8 +1167,7 @@ func (c *ManagedShortLinksCreateCall) Header() http.Header { func (c *ManagedShortLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createmanagedshortlinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createmanagedshortlinkrequest) if err != nil { return nil, err } @@ -1268,8 +1266,7 @@ func (c *ShortLinksCreateCall) Header() http.Header { func (c *ShortLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createshortdynamiclinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createshortdynamiclinkrequest) if err != nil { return nil, err } @@ -1393,12 +1390,11 @@ func (c *V1GetLinkStatsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{dynamicLink}/linkStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1488,8 +1484,7 @@ func (c *V1InstallAttributionCall) Header() http.Header { func (c *V1InstallAttributionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiospostinstallattributionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiospostinstallattributionrequest) if err != nil { return nil, err } @@ -1584,8 +1579,7 @@ func (c *V1ReopenAttributionCall) Header() http.Header { func (c *V1ReopenAttributionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiosreopenattributionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiosreopenattributionrequest) if err != nil { return nil, err } diff --git a/firebasehosting/v1/firebasehosting-gen.go b/firebasehosting/v1/firebasehosting-gen.go index f8e1bf7489b..089175e1889 100644 --- a/firebasehosting/v1/firebasehosting-gen.go +++ b/firebasehosting/v1/firebasehosting-gen.go @@ -124,7 +124,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,10 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -767,8 +766,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -869,12 +867,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -997,12 +994,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1117,8 +1113,7 @@ func (c *ProjectsSitesCustomDomainsOperationsCancelCall) Header() http.Header { func (c *ProjectsSitesCustomDomainsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1217,12 +1212,11 @@ func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) Header() http.Header { func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } diff --git a/firebasehosting/v1beta1/firebasehosting-gen.go b/firebasehosting/v1beta1/firebasehosting-gen.go index bf10854b524..c4a83b857e0 100644 --- a/firebasehosting/v1beta1/firebasehosting-gen.go +++ b/firebasehosting/v1beta1/firebasehosting-gen.go @@ -133,7 +133,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.Sites = NewSitesService(s) if err != nil { return nil, err } @@ -152,10 +154,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.Sites = NewSitesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2238,12 +2237,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2357,8 +2355,7 @@ func (c *ProjectsSitesCreateCall) Header() http.Header { func (c *ProjectsSitesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -2460,12 +2457,11 @@ func (c *ProjectsSitesDeleteCall) Header() http.Header { func (c *ProjectsSitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2572,12 +2568,11 @@ func (c *ProjectsSitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2680,12 +2675,11 @@ func (c *ProjectsSitesGetConfigCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2806,12 +2800,11 @@ func (c *ProjectsSitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2939,8 +2932,7 @@ func (c *ProjectsSitesPatchCall) Header() http.Header { func (c *ProjectsSitesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.site) if err != nil { return nil, err } @@ -3051,8 +3043,7 @@ func (c *ProjectsSitesUpdateConfigCall) Header() http.Header { func (c *ProjectsSitesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.siteconfig) if err != nil { return nil, err } @@ -3160,8 +3151,7 @@ func (c *ProjectsSitesChannelsCreateCall) Header() http.Header { func (c *ProjectsSitesChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -3261,12 +3251,11 @@ func (c *ProjectsSitesChannelsDeleteCall) Header() http.Header { func (c *ProjectsSitesChannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3369,12 +3358,11 @@ func (c *ProjectsSitesChannelsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3493,12 +3481,11 @@ func (c *ProjectsSitesChannelsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3621,8 +3608,7 @@ func (c *ProjectsSitesChannelsPatchCall) Header() http.Header { func (c *ProjectsSitesChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -3734,8 +3720,7 @@ func (c *ProjectsSitesChannelsReleasesCreateCall) Header() http.Header { func (c *ProjectsSitesChannelsReleasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release) if err != nil { return nil, err } @@ -3850,12 +3835,11 @@ func (c *ProjectsSitesChannelsReleasesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3977,12 +3961,11 @@ func (c *ProjectsSitesChannelsReleasesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4113,8 +4096,7 @@ func (c *ProjectsSitesCustomDomainsCreateCall) Header() http.Header { func (c *ProjectsSitesCustomDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdomain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customdomain) if err != nil { return nil, err } @@ -4235,12 +4217,11 @@ func (c *ProjectsSitesCustomDomainsDeleteCall) Header() http.Header { func (c *ProjectsSitesCustomDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4342,12 +4323,11 @@ func (c *ProjectsSitesCustomDomainsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4474,12 +4454,11 @@ func (c *ProjectsSitesCustomDomainsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/customDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4617,8 +4596,7 @@ func (c *ProjectsSitesCustomDomainsPatchCall) Header() http.Header { func (c *ProjectsSitesCustomDomainsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdomain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customdomain) if err != nil { return nil, err } @@ -4720,8 +4698,7 @@ func (c *ProjectsSitesCustomDomainsUndeleteCall) Header() http.Header { func (c *ProjectsSitesCustomDomainsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletecustomdomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletecustomdomainrequest) if err != nil { return nil, err } @@ -4832,12 +4809,11 @@ func (c *ProjectsSitesCustomDomainsOperationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4959,12 +4935,11 @@ func (c *ProjectsSitesCustomDomainsOperationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5079,8 +5054,7 @@ func (c *ProjectsSitesDomainsCreateCall) Header() http.Header { func (c *ProjectsSitesDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -5178,12 +5152,11 @@ func (c *ProjectsSitesDomainsDeleteCall) Header() http.Header { func (c *ProjectsSitesDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5285,12 +5258,11 @@ func (c *ProjectsSitesDomainsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5407,12 +5379,11 @@ func (c *ProjectsSitesDomainsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5528,8 +5499,7 @@ func (c *ProjectsSitesDomainsUpdateCall) Header() http.Header { func (c *ProjectsSitesDomainsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -5641,8 +5611,7 @@ func (c *ProjectsSitesReleasesCreateCall) Header() http.Header { func (c *ProjectsSitesReleasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release) if err != nil { return nil, err } @@ -5757,12 +5726,11 @@ func (c *ProjectsSitesReleasesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5884,12 +5852,11 @@ func (c *ProjectsSitesReleasesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6005,8 +5972,7 @@ func (c *ProjectsSitesVersionsCloneCall) Header() http.Header { func (c *ProjectsSitesVersionsCloneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloneversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloneversionrequest) if err != nil { return nil, err } @@ -6123,8 +6089,7 @@ func (c *ProjectsSitesVersionsCreateCall) Header() http.Header { func (c *ProjectsSitesVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -6223,12 +6188,11 @@ func (c *ProjectsSitesVersionsDeleteCall) Header() http.Header { func (c *ProjectsSitesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6333,12 +6297,11 @@ func (c *ProjectsSitesVersionsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6468,12 +6431,11 @@ func (c *ProjectsSitesVersionsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6603,8 +6565,7 @@ func (c *ProjectsSitesVersionsPatchCall) Header() http.Header { func (c *ProjectsSitesVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -6706,8 +6667,7 @@ func (c *ProjectsSitesVersionsPopulateFilesCall) Header() http.Header { func (c *ProjectsSitesVersionsPopulateFilesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.populateversionfilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.populateversionfilesrequest) if err != nil { return nil, err } @@ -6854,12 +6814,11 @@ func (c *ProjectsSitesVersionsFilesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6984,12 +6943,11 @@ func (c *SitesGetConfigCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7092,8 +7050,7 @@ func (c *SitesUpdateConfigCall) Header() http.Header { func (c *SitesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.siteconfig) if err != nil { return nil, err } @@ -7201,8 +7158,7 @@ func (c *SitesChannelsCreateCall) Header() http.Header { func (c *SitesChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -7302,12 +7258,11 @@ func (c *SitesChannelsDeleteCall) Header() http.Header { func (c *SitesChannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7410,12 +7365,11 @@ func (c *SitesChannelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7534,12 +7488,11 @@ func (c *SitesChannelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7662,8 +7615,7 @@ func (c *SitesChannelsPatchCall) Header() http.Header { func (c *SitesChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -7775,8 +7727,7 @@ func (c *SitesChannelsReleasesCreateCall) Header() http.Header { func (c *SitesChannelsReleasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release) if err != nil { return nil, err } @@ -7891,12 +7842,11 @@ func (c *SitesChannelsReleasesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8018,12 +7968,11 @@ func (c *SitesChannelsReleasesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8138,8 +8087,7 @@ func (c *SitesDomainsCreateCall) Header() http.Header { func (c *SitesDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -8237,12 +8185,11 @@ func (c *SitesDomainsDeleteCall) Header() http.Header { func (c *SitesDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8344,12 +8291,11 @@ func (c *SitesDomainsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8466,12 +8412,11 @@ func (c *SitesDomainsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8587,8 +8532,7 @@ func (c *SitesDomainsUpdateCall) Header() http.Header { func (c *SitesDomainsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -8700,8 +8644,7 @@ func (c *SitesReleasesCreateCall) Header() http.Header { func (c *SitesReleasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release) if err != nil { return nil, err } @@ -8816,12 +8759,11 @@ func (c *SitesReleasesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8943,12 +8885,11 @@ func (c *SitesReleasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9064,8 +9005,7 @@ func (c *SitesVersionsCloneCall) Header() http.Header { func (c *SitesVersionsCloneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloneversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloneversionrequest) if err != nil { return nil, err } @@ -9182,8 +9122,7 @@ func (c *SitesVersionsCreateCall) Header() http.Header { func (c *SitesVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -9282,12 +9221,11 @@ func (c *SitesVersionsDeleteCall) Header() http.Header { func (c *SitesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9392,12 +9330,11 @@ func (c *SitesVersionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9527,12 +9464,11 @@ func (c *SitesVersionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9662,8 +9598,7 @@ func (c *SitesVersionsPatchCall) Header() http.Header { func (c *SitesVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -9765,8 +9700,7 @@ func (c *SitesVersionsPopulateFilesCall) Header() http.Header { func (c *SitesVersionsPopulateFilesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.populateversionfilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.populateversionfilesrequest) if err != nil { return nil, err } @@ -9913,12 +9847,11 @@ func (c *SitesVersionsFilesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/files") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firebaseml/v1/firebaseml-gen.go b/firebaseml/v1/firebaseml-gen.go index 729e8a74eb5..a91b41db000 100644 --- a/firebaseml/v1/firebaseml-gen.go +++ b/firebaseml/v1/firebaseml-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -363,8 +362,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -465,12 +463,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -593,12 +590,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firebaseml/v1beta2/firebaseml-gen.go b/firebaseml/v1beta2/firebaseml-gen.go index a126ec916c7..e7f8ce5707d 100644 --- a/firebaseml/v1beta2/firebaseml-gen.go +++ b/firebaseml/v1beta2/firebaseml-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -532,8 +531,7 @@ func (c *ProjectsModelsCreateCall) Header() http.Header { func (c *ProjectsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.model) if err != nil { return nil, err } @@ -632,12 +630,11 @@ func (c *ProjectsModelsDeleteCall) Header() http.Header { func (c *ProjectsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -742,12 +739,11 @@ func (c *ProjectsModelsDownloadCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -851,12 +847,11 @@ func (c *ProjectsModelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -980,12 +975,11 @@ func (c *ProjectsModelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1108,8 +1102,7 @@ func (c *ProjectsModelsPatchCall) Header() http.Header { func (c *ProjectsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.model) if err != nil { return nil, err } @@ -1221,12 +1214,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firebaseml/v2beta/firebaseml-gen.go b/firebaseml/v2beta/firebaseml-gen.go index 4f87f27bc58..31d7e58af72 100644 --- a/firebaseml/v2beta/firebaseml-gen.go +++ b/firebaseml/v2beta/firebaseml-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2337,8 +2336,7 @@ func (c *ProjectsLocationsPublishersModelsCountTokensCall) Header() http.Header func (c *ProjectsLocationsPublishersModelsCountTokensCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1counttokensrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1counttokensrequest) if err != nil { return nil, err } @@ -2443,8 +2441,7 @@ func (c *ProjectsLocationsPublishersModelsGenerateContentCall) Header() http.Hea func (c *ProjectsLocationsPublishersModelsGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } @@ -2550,8 +2547,7 @@ func (c *ProjectsLocationsPublishersModelsStreamGenerateContentCall) Header() ht func (c *ProjectsLocationsPublishersModelsStreamGenerateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generatecontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudaiplatformv1beta1generatecontentrequest) if err != nil { return nil, err } diff --git a/firebaserules/v1/firebaserules-gen.go b/firebaserules/v1/firebaserules-gen.go index c5d770b60d7..0c521c888a3 100644 --- a/firebaserules/v1/firebaserules-gen.go +++ b/firebaserules/v1/firebaserules-gen.go @@ -128,7 +128,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -147,9 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1002,8 +1001,7 @@ func (c *ProjectsTestCall) Header() http.Header { func (c *ProjectsTestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testrulesetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testrulesetrequest) if err != nil { return nil, err } @@ -1118,8 +1116,7 @@ func (c *ProjectsReleasesCreateCall) Header() http.Header { func (c *ProjectsReleasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release) if err != nil { return nil, err } @@ -1218,12 +1215,11 @@ func (c *ProjectsReleasesDeleteCall) Header() http.Header { func (c *ProjectsReleasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1326,12 +1322,11 @@ func (c *ProjectsReleasesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1456,12 +1451,11 @@ func (c *ProjectsReleasesGetExecutableCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getExecutable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1602,12 +1596,11 @@ func (c *ProjectsReleasesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1724,8 +1717,7 @@ func (c *ProjectsReleasesPatchCall) Header() http.Header { func (c *ProjectsReleasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatereleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatereleaserequest) if err != nil { return nil, err } @@ -1830,8 +1822,7 @@ func (c *ProjectsRulesetsCreateCall) Header() http.Header { func (c *ProjectsRulesetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ruleset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ruleset) if err != nil { return nil, err } @@ -1931,12 +1922,11 @@ func (c *ProjectsRulesetsDeleteCall) Header() http.Header { func (c *ProjectsRulesetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2039,12 +2029,11 @@ func (c *ProjectsRulesetsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2175,12 +2164,11 @@ func (c *ProjectsRulesetsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/rulesets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firebasestorage/v1beta/firebasestorage-gen.go b/firebasestorage/v1beta/firebasestorage-gen.go index 55878c7904b..5ae32ea13f3 100644 --- a/firebasestorage/v1beta/firebasestorage-gen.go +++ b/firebasestorage/v1beta/firebasestorage-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -452,12 +451,11 @@ func (c *ProjectsDeleteDefaultBucketCall) Header() http.Header { func (c *ProjectsDeleteDefaultBucketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -560,12 +558,11 @@ func (c *ProjectsGetDefaultBucketCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -659,8 +656,7 @@ func (c *ProjectsBucketsAddFirebaseCall) Header() http.Header { func (c *ProjectsBucketsAddFirebaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addfirebaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addfirebaserequest) if err != nil { return nil, err } @@ -772,12 +768,11 @@ func (c *ProjectsBucketsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -896,12 +891,11 @@ func (c *ProjectsBucketsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1018,8 +1012,7 @@ func (c *ProjectsBucketsRemoveFirebaseCall) Header() http.Header { func (c *ProjectsBucketsRemoveFirebaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removefirebaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removefirebaserequest) if err != nil { return nil, err } @@ -1123,8 +1116,7 @@ func (c *ProjectsDefaultBucketCreateCall) Header() http.Header { func (c *ProjectsDefaultBucketCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.defaultbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.defaultbucket) if err != nil { return nil, err } diff --git a/firestore/v1/firestore-gen.go b/firestore/v1/firestore-gen.go index 6ef0fda13d4..1560d78de78 100644 --- a/firestore/v1/firestore-gen.go +++ b/firestore/v1/firestore-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4338,8 +4337,7 @@ func (c *ProjectsDatabasesBulkDeleteDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesBulkDeleteDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1bulkdeletedocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1bulkdeletedocumentsrequest) if err != nil { return nil, err } @@ -4451,8 +4449,7 @@ func (c *ProjectsDatabasesCreateCall) Header() http.Header { func (c *ProjectsDatabasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1database) if err != nil { return nil, err } @@ -4559,12 +4556,11 @@ func (c *ProjectsDatabasesDeleteCall) Header() http.Header { func (c *ProjectsDatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4666,8 +4662,7 @@ func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1exportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1exportdocumentsrequest) if err != nil { return nil, err } @@ -4778,12 +4773,11 @@ func (c *ProjectsDatabasesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4882,8 +4876,7 @@ func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1importdocumentsrequest) if err != nil { return nil, err } @@ -5001,12 +4994,11 @@ func (c *ProjectsDatabasesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5107,8 +5099,7 @@ func (c *ProjectsDatabasesPatchCall) Header() http.Header { func (c *ProjectsDatabasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1database) if err != nil { return nil, err } @@ -5219,8 +5210,7 @@ func (c *ProjectsDatabasesRestoreCall) Header() http.Header { func (c *ProjectsDatabasesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1restoredatabaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1restoredatabaserequest) if err != nil { return nil, err } @@ -5324,8 +5314,7 @@ func (c *ProjectsDatabasesBackupSchedulesCreateCall) Header() http.Header { func (c *ProjectsDatabasesBackupSchedulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1backupschedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1backupschedule) if err != nil { return nil, err } @@ -5425,12 +5414,11 @@ func (c *ProjectsDatabasesBackupSchedulesDeleteCall) Header() http.Header { func (c *ProjectsDatabasesBackupSchedulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5533,12 +5521,11 @@ func (c *ProjectsDatabasesBackupSchedulesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5642,12 +5629,11 @@ func (c *ProjectsDatabasesBackupSchedulesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupSchedules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5750,8 +5736,7 @@ func (c *ProjectsDatabasesBackupSchedulesPatchCall) Header() http.Header { func (c *ProjectsDatabasesBackupSchedulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1backupschedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1backupschedule) if err != nil { return nil, err } @@ -5864,12 +5849,11 @@ func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6003,12 +5987,11 @@ func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fields") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6156,8 +6139,7 @@ func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Header() http.Header func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1field) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1field) if err != nil { return nil, err } @@ -6263,8 +6245,7 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Header() http.Heade func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1index) if err != nil { return nil, err } @@ -6365,12 +6346,11 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Header() http.Heade func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6474,12 +6454,11 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6606,12 +6585,11 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6727,8 +6705,7 @@ func (c *ProjectsDatabasesDocumentsBatchGetCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchgetdocumentsrequest) if err != nil { return nil, err } @@ -6835,8 +6812,7 @@ func (c *ProjectsDatabasesDocumentsBatchWriteCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsBatchWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchwriterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchwriterequest) if err != nil { return nil, err } @@ -6938,8 +6914,7 @@ func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsBeginTransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.begintransactionrequest) if err != nil { return nil, err } @@ -7041,8 +7016,7 @@ func (c *ProjectsDatabasesDocumentsCommitCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitrequest) if err != nil { return nil, err } @@ -7165,8 +7139,7 @@ func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsCreateDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.document) if err != nil { return nil, err } @@ -7282,12 +7255,11 @@ func (c *ProjectsDatabasesDocumentsDeleteCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7414,12 +7386,11 @@ func (c *ProjectsDatabasesDocumentsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7593,12 +7564,11 @@ func (c *ProjectsDatabasesDocumentsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7716,8 +7686,7 @@ func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listcollectionidsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listcollectionidsrequest) if err != nil { return nil, err } @@ -7921,12 +7890,11 @@ func (c *ProjectsDatabasesDocumentsListDocumentsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8043,8 +8011,7 @@ func (c *ProjectsDatabasesDocumentsListenCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsListenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listenrequest) if err != nil { return nil, err } @@ -8150,8 +8117,7 @@ func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsPartitionQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.partitionqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.partitionqueryrequest) if err != nil { return nil, err } @@ -8306,8 +8272,7 @@ func (c *ProjectsDatabasesDocumentsPatchCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.document) if err != nil { return nil, err } @@ -8408,8 +8373,7 @@ func (c *ProjectsDatabasesDocumentsRollbackCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackrequest) if err != nil { return nil, err } @@ -8517,8 +8481,7 @@ func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) Header() http.Header func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runaggregationqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runaggregationqueryrequest) if err != nil { return nil, err } @@ -8623,8 +8586,7 @@ func (c *ProjectsDatabasesDocumentsRunQueryCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsRunQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runqueryrequest) if err != nil { return nil, err } @@ -8728,8 +8690,7 @@ func (c *ProjectsDatabasesDocumentsWriteCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writerequest) if err != nil { return nil, err } @@ -8837,8 +8798,7 @@ func (c *ProjectsDatabasesOperationsCancelCall) Header() http.Header { func (c *ProjectsDatabasesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -8939,12 +8899,11 @@ func (c *ProjectsDatabasesOperationsDeleteCall) Header() http.Header { func (c *ProjectsDatabasesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9048,12 +9007,11 @@ func (c *ProjectsDatabasesOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9177,12 +9135,11 @@ func (c *ProjectsDatabasesOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9306,12 +9263,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9437,12 +9393,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9555,12 +9510,11 @@ func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9663,12 +9617,11 @@ func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9786,12 +9739,11 @@ func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firestore/v1beta1/firestore-gen.go b/firestore/v1beta1/firestore-gen.go index 7b5f4079afd..2d038de079d 100644 --- a/firestore/v1beta1/firestore-gen.go +++ b/firestore/v1beta1/firestore-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3192,8 +3191,7 @@ func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta1exportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta1exportdocumentsrequest) if err != nil { return nil, err } @@ -3300,8 +3298,7 @@ func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta1importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta1importdocumentsrequest) if err != nil { return nil, err } @@ -3404,8 +3401,7 @@ func (c *ProjectsDatabasesDocumentsBatchGetCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchgetdocumentsrequest) if err != nil { return nil, err } @@ -3512,8 +3508,7 @@ func (c *ProjectsDatabasesDocumentsBatchWriteCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsBatchWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchwriterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchwriterequest) if err != nil { return nil, err } @@ -3615,8 +3610,7 @@ func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsBeginTransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.begintransactionrequest) if err != nil { return nil, err } @@ -3718,8 +3712,7 @@ func (c *ProjectsDatabasesDocumentsCommitCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitrequest) if err != nil { return nil, err } @@ -3842,8 +3835,7 @@ func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsCreateDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.document) if err != nil { return nil, err } @@ -3959,12 +3951,11 @@ func (c *ProjectsDatabasesDocumentsDeleteCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4091,12 +4082,11 @@ func (c *ProjectsDatabasesDocumentsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4270,12 +4260,11 @@ func (c *ProjectsDatabasesDocumentsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4393,8 +4382,7 @@ func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listcollectionidsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listcollectionidsrequest) if err != nil { return nil, err } @@ -4598,12 +4586,11 @@ func (c *ProjectsDatabasesDocumentsListDocumentsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/{collectionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4720,8 +4707,7 @@ func (c *ProjectsDatabasesDocumentsListenCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsListenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listenrequest) if err != nil { return nil, err } @@ -4827,8 +4813,7 @@ func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsPartitionQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.partitionqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.partitionqueryrequest) if err != nil { return nil, err } @@ -4983,8 +4968,7 @@ func (c *ProjectsDatabasesDocumentsPatchCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.document) if err != nil { return nil, err } @@ -5085,8 +5069,7 @@ func (c *ProjectsDatabasesDocumentsRollbackCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackrequest) if err != nil { return nil, err } @@ -5194,8 +5177,7 @@ func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) Header() http.Header func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runaggregationqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runaggregationqueryrequest) if err != nil { return nil, err } @@ -5300,8 +5282,7 @@ func (c *ProjectsDatabasesDocumentsRunQueryCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsRunQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runqueryrequest) if err != nil { return nil, err } @@ -5405,8 +5386,7 @@ func (c *ProjectsDatabasesDocumentsWriteCall) Header() http.Header { func (c *ProjectsDatabasesDocumentsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writerequest) if err != nil { return nil, err } @@ -5514,8 +5494,7 @@ func (c *ProjectsDatabasesIndexesCreateCall) Header() http.Header { func (c *ProjectsDatabasesIndexesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta1index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta1index) if err != nil { return nil, err } @@ -5615,12 +5594,11 @@ func (c *ProjectsDatabasesIndexesDeleteCall) Header() http.Header { func (c *ProjectsDatabasesIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5723,12 +5701,11 @@ func (c *ProjectsDatabasesIndexesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5852,12 +5829,11 @@ func (c *ProjectsDatabasesIndexesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/firestore/v1beta2/firestore-gen.go b/firestore/v1beta2/firestore-gen.go index ee916106fcc..13a1d15a65c 100644 --- a/firestore/v1beta2/firestore-gen.go +++ b/firestore/v1beta2/firestore-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1110,8 +1109,7 @@ func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2exportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta2exportdocumentsrequest) if err != nil { return nil, err } @@ -1218,8 +1216,7 @@ func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header { func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2importdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta2importdocumentsrequest) if err != nil { return nil, err } @@ -1332,12 +1329,11 @@ func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1471,12 +1467,11 @@ func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/fields") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1626,8 +1621,7 @@ func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Header() http.Header func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2field) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta2field) if err != nil { return nil, err } @@ -1733,8 +1727,7 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Header() http.Heade func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2index) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlefirestoreadminv1beta2index) if err != nil { return nil, err } @@ -1835,12 +1828,11 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Header() http.Heade func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1944,12 +1936,11 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2076,12 +2067,11 @@ func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/fitness/v1/fitness-gen.go b/fitness/v1/fitness-gen.go index c185c7f6047..16db84816a8 100644 --- a/fitness/v1/fitness-gen.go +++ b/fitness/v1/fitness-gen.go @@ -217,7 +217,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -236,9 +237,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1273,8 +1272,7 @@ func (c *UsersDataSourcesCreateCall) Header() http.Header { func (c *UsersDataSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -1377,12 +1375,11 @@ func (c *UsersDataSourcesDeleteCall) Header() http.Header { func (c *UsersDataSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1489,12 +1486,11 @@ func (c *UsersDataSourcesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1609,12 +1605,11 @@ func (c *UsersDataSourcesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1713,8 +1708,7 @@ func (c *UsersDataSourcesUpdateCall) Header() http.Header { func (c *UsersDataSourcesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -1846,12 +1840,11 @@ func (c *UsersDataSourcesDataPointChangesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}/dataPointChanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1980,12 +1973,11 @@ func (c *UsersDataSourcesDatasetsDeleteCall) Header() http.Header { func (c *UsersDataSourcesDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2102,12 +2094,11 @@ func (c *UsersDataSourcesDatasetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2234,8 +2225,7 @@ func (c *UsersDataSourcesDatasetsPatchCall) Header() http.Header { func (c *UsersDataSourcesDatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -2361,8 +2351,7 @@ func (c *UsersDatasetAggregateCall) Header() http.Header { func (c *UsersDatasetAggregateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.aggregaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.aggregaterequest) if err != nil { return nil, err } @@ -2465,12 +2454,11 @@ func (c *UsersSessionsDeleteCall) Header() http.Header { func (c *UsersSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/sessions/{sessionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2598,12 +2586,11 @@ func (c *UsersSessionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2721,8 +2708,7 @@ func (c *UsersSessionsUpdateCall) Header() http.Header { func (c *UsersSessionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.session) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.session) if err != nil { return nil, err } diff --git a/forms/v1/forms-gen.go b/forms/v1/forms-gen.go index c788df4e043..1852da80f25 100644 --- a/forms/v1/forms-gen.go +++ b/forms/v1/forms-gen.go @@ -140,7 +140,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Forms = NewFormsService(s) if err != nil { return nil, err } @@ -159,9 +160,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Forms = NewFormsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1976,8 +1975,7 @@ func (c *FormsBatchUpdateCall) Header() http.Header { func (c *FormsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdateformrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdateformrequest) if err != nil { return nil, err } @@ -2080,8 +2078,7 @@ func (c *FormsCreateCall) Header() http.Header { func (c *FormsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.form) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.form) if err != nil { return nil, err } @@ -2188,12 +2185,11 @@ func (c *FormsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2298,12 +2294,11 @@ func (c *FormsResponsesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/responses/{responseId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2434,12 +2429,11 @@ func (c *FormsResponsesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/responses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2556,8 +2550,7 @@ func (c *FormsWatchesCreateCall) Header() http.Header { func (c *FormsWatchesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createwatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createwatchrequest) if err != nil { return nil, err } @@ -2658,12 +2651,11 @@ func (c *FormsWatchesDeleteCall) Header() http.Header { func (c *FormsWatchesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/watches/{watchId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2768,12 +2760,11 @@ func (c *FormsWatchesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/watches") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2873,8 +2864,7 @@ func (c *FormsWatchesRenewCall) Header() http.Header { func (c *FormsWatchesRenewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewwatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renewwatchrequest) if err != nil { return nil, err } diff --git a/games/v1/games-gen.go b/games/v1/games-gen.go index 4dacf9ab56a..1d3bd638607 100644 --- a/games/v1/games-gen.go +++ b/games/v1/games-gen.go @@ -127,7 +127,20 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accesstokens = NewAccesstokensService(s) + s.AchievementDefinitions = NewAchievementDefinitionsService(s) + s.Achievements = NewAchievementsService(s) + s.Applications = NewApplicationsService(s) + s.Events = NewEventsService(s) + s.Leaderboards = NewLeaderboardsService(s) + s.Metagame = NewMetagameService(s) + s.Players = NewPlayersService(s) + s.Recall = NewRecallService(s) + s.Revisions = NewRevisionsService(s) + s.Scores = NewScoresService(s) + s.Snapshots = NewSnapshotsService(s) + s.Stats = NewStatsService(s) if err != nil { return nil, err } @@ -146,21 +159,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accesstokens = NewAccesstokensService(s) - s.AchievementDefinitions = NewAchievementDefinitionsService(s) - s.Achievements = NewAchievementsService(s) - s.Applications = NewApplicationsService(s) - s.Events = NewEventsService(s) - s.Leaderboards = NewLeaderboardsService(s) - s.Metagame = NewMetagameService(s) - s.Players = NewPlayersService(s) - s.Recall = NewRecallService(s) - s.Revisions = NewRevisionsService(s) - s.Scores = NewScoresService(s) - s.Snapshots = NewSnapshotsService(s) - s.Stats = NewStatsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3047,12 +3046,11 @@ func (c *AccesstokensGeneratePlayGroupingApiTokenCall) Header() http.Header { func (c *AccesstokensGeneratePlayGroupingApiTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/accesstokens/generatePlayGroupingApiToken") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3164,12 +3162,11 @@ func (c *AccesstokensGenerateRecallPlayGroupingApiTokenCall) Header() http.Heade func (c *AccesstokensGenerateRecallPlayGroupingApiTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/accesstokens/generateRecallPlayGroupingApiToken") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3288,12 +3285,11 @@ func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/achievements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3413,12 +3409,11 @@ func (c *AchievementsIncrementCall) Header() http.Header { func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/achievements/{achievementId}/increment") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3561,12 +3556,11 @@ func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/{playerId}/achievements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3679,12 +3673,11 @@ func (c *AchievementsRevealCall) Header() http.Header { func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/achievements/{achievementId}/reveal") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3780,12 +3773,11 @@ func (c *AchievementsSetStepsAtLeastCall) Header() http.Header { func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/achievements/{achievementId}/setStepsAtLeast") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3876,12 +3868,11 @@ func (c *AchievementsUnlockCall) Header() http.Header { func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/achievements/{achievementId}/unlock") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3971,8 +3962,7 @@ func (c *AchievementsUpdateMultipleCall) Header() http.Header { func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.achievementupdatemultiplerequest) if err != nil { return nil, err } @@ -4102,12 +4092,11 @@ func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/applications/{applicationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4212,12 +4201,11 @@ func (c *ApplicationsGetEndPointCall) Header() http.Header { func (c *ApplicationsGetEndPointCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/applications/getEndPoint") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4301,12 +4289,11 @@ func (c *ApplicationsPlayedCall) Header() http.Header { func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/applications/played") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4384,12 +4371,11 @@ func (c *ApplicationsVerifyCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/applications/{applicationId}/verify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4511,12 +4497,11 @@ func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/events") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4657,12 +4642,11 @@ func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/eventDefinitions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4777,8 +4761,7 @@ func (c *EventsRecordCall) Header() http.Header { func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventrecordrequest) if err != nil { return nil, err } @@ -4893,12 +4876,11 @@ func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/leaderboards/{leaderboardId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5018,12 +5000,11 @@ func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/leaderboards") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5141,12 +5122,11 @@ func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/metagameConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5273,12 +5253,11 @@ func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/{playerId}/categories/{collection}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5421,12 +5400,11 @@ func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/{playerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5535,12 +5513,11 @@ func (c *PlayersGetMultipleApplicationPlayerIdsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/me/multipleApplicationPlayerIds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5637,12 +5614,11 @@ func (c *PlayersGetScopedPlayerIdsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/me/scopedIds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5765,12 +5741,11 @@ func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/me/players/{collection}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5905,12 +5880,11 @@ func (c *RecallGamesPlayerTokensCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/recall/gamesPlayerTokens/{sessionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6017,12 +5991,11 @@ func (c *RecallLastTokenFromAllDeveloperGamesCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/recall/developerGamesLastPlayerToken/{sessionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6112,8 +6085,7 @@ func (c *RecallLinkPersonaCall) Header() http.Header { func (c *RecallLinkPersonaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.linkpersonarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.linkpersonarequest) if err != nil { return nil, err } @@ -6208,8 +6180,7 @@ func (c *RecallResetPersonaCall) Header() http.Header { func (c *RecallResetPersonaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetpersonarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetpersonarequest) if err != nil { return nil, err } @@ -6320,12 +6291,11 @@ func (c *RecallRetrieveTokensCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/recall/tokens/{sessionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6416,8 +6386,7 @@ func (c *RecallUnlinkPersonaCall) Header() http.Header { func (c *RecallUnlinkPersonaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unlinkpersonarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unlinkpersonarequest) if err != nil { return nil, err } @@ -6528,12 +6497,11 @@ func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/revisions/check") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6688,12 +6656,11 @@ func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6847,12 +6814,11 @@ func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/leaderboards/{leaderboardId}/scores/{collection}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7024,12 +6990,11 @@ func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/leaderboards/{leaderboardId}/window/{collection}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7164,12 +7129,11 @@ func (c *ScoresSubmitCall) Header() http.Header { func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/leaderboards/{leaderboardId}/scores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7265,8 +7229,7 @@ func (c *ScoresSubmitMultipleCall) Header() http.Header { func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playerscoresubmissionlist) if err != nil { return nil, err } @@ -7381,12 +7344,11 @@ func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/snapshots/{snapshotId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7513,12 +7475,11 @@ func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/players/{playerId}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7639,12 +7600,11 @@ func (c *StatsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1/stats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/gamesconfiguration/v1configuration/gamesconfiguration-gen.go b/gamesconfiguration/v1configuration/gamesconfiguration-gen.go index b5c40200f43..a01634c3ab6 100644 --- a/gamesconfiguration/v1configuration/gamesconfiguration-gen.go +++ b/gamesconfiguration/v1configuration/gamesconfiguration-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AchievementConfigurations = NewAchievementConfigurationsService(s) + s.LeaderboardConfigurations = NewLeaderboardConfigurationsService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AchievementConfigurations = NewAchievementConfigurationsService(s) - s.LeaderboardConfigurations = NewLeaderboardConfigurationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -565,12 +564,11 @@ func (c *AchievementConfigurationsDeleteCall) Header() http.Header { func (c *AchievementConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/achievements/{achievementId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -650,12 +648,11 @@ func (c *AchievementConfigurationsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/achievements/{achievementId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -748,8 +745,7 @@ func (c *AchievementConfigurationsInsertCall) Header() http.Header { func (c *AchievementConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.achievementconfiguration) if err != nil { return nil, err } @@ -876,12 +872,11 @@ func (c *AchievementConfigurationsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/applications/{applicationId}/achievements") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -996,8 +991,7 @@ func (c *AchievementConfigurationsUpdateCall) Header() http.Header { func (c *AchievementConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.achievementconfiguration) if err != nil { return nil, err } @@ -1096,12 +1090,11 @@ func (c *LeaderboardConfigurationsDeleteCall) Header() http.Header { func (c *LeaderboardConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/leaderboards/{leaderboardId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1181,12 +1174,11 @@ func (c *LeaderboardConfigurationsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/leaderboards/{leaderboardId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1279,8 +1271,7 @@ func (c *LeaderboardConfigurationsInsertCall) Header() http.Header { func (c *LeaderboardConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.leaderboardconfiguration) if err != nil { return nil, err } @@ -1407,12 +1398,11 @@ func (c *LeaderboardConfigurationsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/applications/{applicationId}/leaderboards") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1527,8 +1517,7 @@ func (c *LeaderboardConfigurationsUpdateCall) Header() http.Header { func (c *LeaderboardConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.leaderboardconfiguration) if err != nil { return nil, err } diff --git a/gamesmanagement/v1management/gamesmanagement-gen.go b/gamesmanagement/v1management/gamesmanagement-gen.go index fb05840b9d9..6cdb4b3e092 100644 --- a/gamesmanagement/v1management/gamesmanagement-gen.go +++ b/gamesmanagement/v1management/gamesmanagement-gen.go @@ -114,7 +114,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Achievements = NewAchievementsService(s) + s.Applications = NewApplicationsService(s) + s.Events = NewEventsService(s) + s.Players = NewPlayersService(s) + s.Scores = NewScoresService(s) if err != nil { return nil, err } @@ -133,13 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Achievements = NewAchievementsService(s) - s.Applications = NewApplicationsService(s) - s.Events = NewEventsService(s) - s.Players = NewPlayersService(s) - s.Scores = NewScoresService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -667,12 +666,11 @@ func (c *AchievementsResetCall) Header() http.Header { func (c *AchievementsResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/{achievementId}/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -761,12 +759,11 @@ func (c *AchievementsResetAllCall) Header() http.Header { func (c *AchievementsResetAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -851,12 +848,11 @@ func (c *AchievementsResetAllForAllPlayersCall) Header() http.Header { func (c *AchievementsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/resetAllForAllPlayers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -922,12 +918,11 @@ func (c *AchievementsResetForAllPlayersCall) Header() http.Header { func (c *AchievementsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/{achievementId}/resetForAllPlayers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -994,8 +989,7 @@ func (c *AchievementsResetMultipleForAllPlayersCall) Header() http.Header { func (c *AchievementsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementresetmultipleforallrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.achievementresetmultipleforallrequest) if err != nil { return nil, err } @@ -1096,12 +1090,11 @@ func (c *ApplicationsListHiddenCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1215,12 +1208,11 @@ func (c *EventsResetCall) Header() http.Header { func (c *EventsResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/{eventId}/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1285,12 +1277,11 @@ func (c *EventsResetAllCall) Header() http.Header { func (c *EventsResetAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1351,12 +1342,11 @@ func (c *EventsResetAllForAllPlayersCall) Header() http.Header { func (c *EventsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/resetAllForAllPlayers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1422,12 +1412,11 @@ func (c *EventsResetForAllPlayersCall) Header() http.Header { func (c *EventsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/{eventId}/resetForAllPlayers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1494,8 +1483,7 @@ func (c *EventsResetMultipleForAllPlayersCall) Header() http.Header { func (c *EventsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventsresetmultipleforallrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventsresetmultipleforallrequest) if err != nil { return nil, err } @@ -1572,12 +1560,11 @@ func (c *PlayersHideCall) Header() http.Header { func (c *PlayersHideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden/{playerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1651,12 +1638,11 @@ func (c *PlayersUnhideCall) Header() http.Header { func (c *PlayersUnhideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden/{playerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1726,12 +1712,11 @@ func (c *ScoresResetCall) Header() http.Header { func (c *ScoresResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/leaderboards/{leaderboardId}/scores/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1820,12 +1805,11 @@ func (c *ScoresResetAllCall) Header() http.Header { func (c *ScoresResetAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/reset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1911,12 +1895,11 @@ func (c *ScoresResetAllForAllPlayersCall) Header() http.Header { func (c *ScoresResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/resetAllForAllPlayers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1982,12 +1965,11 @@ func (c *ScoresResetForAllPlayersCall) Header() http.Header { func (c *ScoresResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2054,8 +2036,7 @@ func (c *ScoresResetMultipleForAllPlayersCall) Header() http.Header { func (c *ScoresResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scoresresetmultipleforallrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scoresresetmultipleforallrequest) if err != nil { return nil, err } diff --git a/gkebackup/v1/gkebackup-gen.go b/gkebackup/v1/gkebackup-gen.go index b20944cbf6e..3ea4fd43c9d 100644 --- a/gkebackup/v1/gkebackup-gen.go +++ b/gkebackup/v1/gkebackup-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2784,12 +2783,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2915,12 +2913,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3046,8 +3043,7 @@ func (c *ProjectsLocationsBackupPlansCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupplan) if err != nil { return nil, err } @@ -3155,12 +3151,11 @@ func (c *ProjectsLocationsBackupPlansDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3264,12 +3259,11 @@ func (c *ProjectsLocationsBackupPlansGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3391,12 +3385,11 @@ func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3533,12 +3526,11 @@ func (c *ProjectsLocationsBackupPlansListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupPlans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3667,8 +3659,7 @@ func (c *ProjectsLocationsBackupPlansPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupplan) if err != nil { return nil, err } @@ -3773,8 +3764,7 @@ func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3881,8 +3871,7 @@ func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3994,8 +3983,7 @@ func (c *ProjectsLocationsBackupPlansBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -4111,12 +4099,11 @@ func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4220,12 +4207,11 @@ func (c *ProjectsLocationsBackupPlansBackupsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4329,12 +4315,11 @@ func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+backup}:getBackupIndexDownloadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4457,12 +4442,11 @@ func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4599,12 +4583,11 @@ func (c *ProjectsLocationsBackupPlansBackupsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4731,8 +4714,7 @@ func (c *ProjectsLocationsBackupPlansBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsBackupPlansBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -4837,8 +4819,7 @@ func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4945,8 +4926,7 @@ func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5058,12 +5038,11 @@ func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5185,12 +5164,11 @@ func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5327,12 +5305,11 @@ func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/volumeBackups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5450,8 +5427,7 @@ func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) Heade func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5558,8 +5534,7 @@ func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5668,8 +5643,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -5770,12 +5744,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5879,12 +5852,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6008,12 +5980,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6139,8 +6110,7 @@ func (c *ProjectsLocationsRestorePlansCreateCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreplan) if err != nil { return nil, err } @@ -6256,12 +6226,11 @@ func (c *ProjectsLocationsRestorePlansDeleteCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6365,12 +6334,11 @@ func (c *ProjectsLocationsRestorePlansGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6492,12 +6460,11 @@ func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6634,12 +6601,11 @@ func (c *ProjectsLocationsRestorePlansListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/restorePlans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6767,8 +6733,7 @@ func (c *ProjectsLocationsRestorePlansPatchCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreplan) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreplan) if err != nil { return nil, err } @@ -6873,8 +6838,7 @@ func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6981,8 +6945,7 @@ func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7095,8 +7058,7 @@ func (c *ProjectsLocationsRestorePlansRestoresCreateCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansRestoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restore) if err != nil { return nil, err } @@ -7212,12 +7174,11 @@ func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7321,12 +7282,11 @@ func (c *ProjectsLocationsRestorePlansRestoresGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7448,12 +7408,11 @@ func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7590,12 +7549,11 @@ func (c *ProjectsLocationsRestorePlansRestoresListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/restores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7722,8 +7680,7 @@ func (c *ProjectsLocationsRestorePlansRestoresPatchCall) Header() http.Header { func (c *ProjectsLocationsRestorePlansRestoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restore) if err != nil { return nil, err } @@ -7828,8 +7785,7 @@ func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7936,8 +7892,7 @@ func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) Header() h func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8049,12 +8004,11 @@ func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8176,12 +8130,11 @@ func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8318,12 +8271,11 @@ func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/volumeRestores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8441,8 +8393,7 @@ func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) He func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8549,8 +8500,7 @@ func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCa func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/gkehub/v1/gkehub-gen.go b/gkehub/v1/gkehub-gen.go index ccce49eccb3..1ef48435a3a 100644 --- a/gkehub/v1/gkehub-gen.go +++ b/gkehub/v1/gkehub-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5870,12 +5869,11 @@ func (c *OrganizationsLocationsFleetsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fleets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5999,12 +5997,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6130,12 +6127,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6273,8 +6269,7 @@ func (c *ProjectsLocationsFeaturesCreateCall) Header() http.Header { func (c *ProjectsLocationsFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -6398,12 +6393,11 @@ func (c *ProjectsLocationsFeaturesDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6515,12 +6509,11 @@ func (c *ProjectsLocationsFeaturesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6642,12 +6635,11 @@ func (c *ProjectsLocationsFeaturesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6794,12 +6786,11 @@ func (c *ProjectsLocationsFeaturesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6937,8 +6928,7 @@ func (c *ProjectsLocationsFeaturesPatchCall) Header() http.Header { func (c *ProjectsLocationsFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -7042,8 +7032,7 @@ func (c *ProjectsLocationsFeaturesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7150,8 +7139,7 @@ func (c *ProjectsLocationsFeaturesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsFeaturesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7253,8 +7241,7 @@ func (c *ProjectsLocationsFleetsCreateCall) Header() http.Header { func (c *ProjectsLocationsFleetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fleet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fleet) if err != nil { return nil, err } @@ -7354,12 +7341,11 @@ func (c *ProjectsLocationsFleetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFleetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7462,12 +7448,11 @@ func (c *ProjectsLocationsFleetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7589,12 +7574,11 @@ func (c *ProjectsLocationsFleetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fleets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7717,8 +7701,7 @@ func (c *ProjectsLocationsFleetsPatchCall) Header() http.Header { func (c *ProjectsLocationsFleetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fleet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fleet) if err != nil { return nil, err } @@ -7849,8 +7832,7 @@ func (c *ProjectsLocationsMembershipsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -7976,12 +7958,11 @@ func (c *ProjectsLocationsMembershipsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8134,12 +8115,11 @@ func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:generateConnectManifest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8243,12 +8223,11 @@ func (c *ProjectsLocationsMembershipsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8370,12 +8349,11 @@ func (c *ProjectsLocationsMembershipsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8515,12 +8493,11 @@ func (c *ProjectsLocationsMembershipsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8658,8 +8635,7 @@ func (c *ProjectsLocationsMembershipsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -8763,8 +8739,7 @@ func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMembershipsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8871,8 +8846,7 @@ func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8982,8 +8956,7 @@ func (c *ProjectsLocationsMembershipsBindingsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipbinding) if err != nil { return nil, err } @@ -9082,12 +9055,11 @@ func (c *ProjectsLocationsMembershipsBindingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9190,12 +9162,11 @@ func (c *ProjectsLocationsMembershipsBindingsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9323,12 +9294,11 @@ func (c *ProjectsLocationsMembershipsBindingsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9451,8 +9421,7 @@ func (c *ProjectsLocationsMembershipsBindingsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipbinding) if err != nil { return nil, err } @@ -9565,8 +9534,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsCreateCall) Header() http.H func (c *ProjectsLocationsMembershipsRbacrolebindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -9665,12 +9633,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsDeleteCall) Header() http.H func (c *ProjectsLocationsMembershipsRbacrolebindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9776,8 +9743,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleB func (c *ProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleBindingYAMLCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -9889,12 +9855,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10014,12 +9979,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rbacrolebindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10144,8 +10108,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsPatchCall) Header() http.He func (c *ProjectsLocationsMembershipsRbacrolebindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -10253,8 +10216,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -10355,12 +10317,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10464,12 +10425,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10592,12 +10552,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10719,8 +10678,7 @@ func (c *ProjectsLocationsScopesCreateCall) Header() http.Header { func (c *ProjectsLocationsScopesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scope) if err != nil { return nil, err } @@ -10819,12 +10777,11 @@ func (c *ProjectsLocationsScopesDeleteCall) Header() http.Header { func (c *ProjectsLocationsScopesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10927,12 +10884,11 @@ func (c *ProjectsLocationsScopesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11054,12 +11010,11 @@ func (c *ProjectsLocationsScopesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11178,12 +11133,11 @@ func (c *ProjectsLocationsScopesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scopes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11338,12 +11292,11 @@ func (c *ProjectsLocationsScopesListMembershipsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scopeName}:listMemberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11484,12 +11437,11 @@ func (c *ProjectsLocationsScopesListPermittedCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scopes:listPermitted") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11611,8 +11563,7 @@ func (c *ProjectsLocationsScopesPatchCall) Header() http.Header { func (c *ProjectsLocationsScopesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scope) if err != nil { return nil, err } @@ -11716,8 +11667,7 @@ func (c *ProjectsLocationsScopesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsScopesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11824,8 +11774,7 @@ func (c *ProjectsLocationsScopesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsScopesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11938,8 +11887,7 @@ func (c *ProjectsLocationsScopesNamespacesCreateCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -12038,12 +11986,11 @@ func (c *ProjectsLocationsScopesNamespacesDeleteCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12146,12 +12093,11 @@ func (c *ProjectsLocationsScopesNamespacesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12270,12 +12216,11 @@ func (c *ProjectsLocationsScopesNamespacesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/namespaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12397,8 +12342,7 @@ func (c *ProjectsLocationsScopesNamespacesPatchCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -12510,8 +12454,7 @@ func (c *ProjectsLocationsScopesRbacrolebindingsCreateCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -12610,12 +12553,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsDeleteCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12718,12 +12660,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12843,12 +12784,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rbacrolebindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12973,8 +12913,7 @@ func (c *ProjectsLocationsScopesRbacrolebindingsPatchCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } diff --git a/gkehub/v1alpha/gkehub-gen.go b/gkehub/v1alpha/gkehub-gen.go index b79686cbb0f..8dd257c471b 100644 --- a/gkehub/v1alpha/gkehub-gen.go +++ b/gkehub/v1alpha/gkehub-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6660,12 +6659,11 @@ func (c *OrganizationsLocationsFleetsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/fleets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6789,12 +6787,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6920,12 +6917,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7063,8 +7059,7 @@ func (c *ProjectsLocationsFeaturesCreateCall) Header() http.Header { func (c *ProjectsLocationsFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -7188,12 +7183,11 @@ func (c *ProjectsLocationsFeaturesDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7305,12 +7299,11 @@ func (c *ProjectsLocationsFeaturesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7432,12 +7425,11 @@ func (c *ProjectsLocationsFeaturesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7584,12 +7576,11 @@ func (c *ProjectsLocationsFeaturesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7727,8 +7718,7 @@ func (c *ProjectsLocationsFeaturesPatchCall) Header() http.Header { func (c *ProjectsLocationsFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -7832,8 +7822,7 @@ func (c *ProjectsLocationsFeaturesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7940,8 +7929,7 @@ func (c *ProjectsLocationsFeaturesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsFeaturesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8043,8 +8031,7 @@ func (c *ProjectsLocationsFleetsCreateCall) Header() http.Header { func (c *ProjectsLocationsFleetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fleet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fleet) if err != nil { return nil, err } @@ -8144,12 +8131,11 @@ func (c *ProjectsLocationsFleetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFleetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8252,12 +8238,11 @@ func (c *ProjectsLocationsFleetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8379,12 +8364,11 @@ func (c *ProjectsLocationsFleetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/fleets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8507,8 +8491,7 @@ func (c *ProjectsLocationsFleetsPatchCall) Header() http.Header { func (c *ProjectsLocationsFleetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fleet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fleet) if err != nil { return nil, err } @@ -8639,8 +8622,7 @@ func (c *ProjectsLocationsMembershipsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -8766,12 +8748,11 @@ func (c *ProjectsLocationsMembershipsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8924,12 +8905,11 @@ func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:generateConnectManifest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9058,12 +9038,11 @@ func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:generateExclusivityManifest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9167,12 +9146,11 @@ func (c *ProjectsLocationsMembershipsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9294,12 +9272,11 @@ func (c *ProjectsLocationsMembershipsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9439,12 +9416,11 @@ func (c *ProjectsLocationsMembershipsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9600,12 +9576,11 @@ func (c *ProjectsLocationsMembershipsListAdminCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/memberships:listAdmin") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9743,8 +9718,7 @@ func (c *ProjectsLocationsMembershipsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -9848,8 +9822,7 @@ func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMembershipsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9956,8 +9929,7 @@ func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10062,8 +10034,7 @@ func (c *ProjectsLocationsMembershipsValidateCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsValidateCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatecreatemembershiprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validatecreatemembershiprequest) if err != nil { return nil, err } @@ -10193,12 +10164,11 @@ func (c *ProjectsLocationsMembershipsValidateExclusivityCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/memberships:validateExclusivity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10300,8 +10270,7 @@ func (c *ProjectsLocationsMembershipsBindingsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipbinding) if err != nil { return nil, err } @@ -10400,12 +10369,11 @@ func (c *ProjectsLocationsMembershipsBindingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10508,12 +10476,11 @@ func (c *ProjectsLocationsMembershipsBindingsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10641,12 +10608,11 @@ func (c *ProjectsLocationsMembershipsBindingsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/bindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10769,8 +10735,7 @@ func (c *ProjectsLocationsMembershipsBindingsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipbinding) if err != nil { return nil, err } @@ -10883,8 +10848,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsCreateCall) Header() http.H func (c *ProjectsLocationsMembershipsRbacrolebindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -10983,12 +10947,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsDeleteCall) Header() http.H func (c *ProjectsLocationsMembershipsRbacrolebindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11094,8 +11057,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleB func (c *ProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleBindingYAMLCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -11207,12 +11169,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11332,12 +11293,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/rbacrolebindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11462,8 +11422,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsPatchCall) Header() http.He func (c *ProjectsLocationsMembershipsRbacrolebindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -11571,8 +11530,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -11673,12 +11631,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11782,12 +11739,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11910,12 +11866,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12037,8 +11992,7 @@ func (c *ProjectsLocationsScopesCreateCall) Header() http.Header { func (c *ProjectsLocationsScopesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scope) if err != nil { return nil, err } @@ -12137,12 +12091,11 @@ func (c *ProjectsLocationsScopesDeleteCall) Header() http.Header { func (c *ProjectsLocationsScopesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12245,12 +12198,11 @@ func (c *ProjectsLocationsScopesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12372,12 +12324,11 @@ func (c *ProjectsLocationsScopesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12496,12 +12447,11 @@ func (c *ProjectsLocationsScopesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scopes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12656,12 +12606,11 @@ func (c *ProjectsLocationsScopesListMembershipsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+scopeName}:listMemberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12802,12 +12751,11 @@ func (c *ProjectsLocationsScopesListPermittedCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scopes:listPermitted") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12929,8 +12877,7 @@ func (c *ProjectsLocationsScopesPatchCall) Header() http.Header { func (c *ProjectsLocationsScopesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scope) if err != nil { return nil, err } @@ -13034,8 +12981,7 @@ func (c *ProjectsLocationsScopesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsScopesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13142,8 +13088,7 @@ func (c *ProjectsLocationsScopesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsScopesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -13256,8 +13201,7 @@ func (c *ProjectsLocationsScopesNamespacesCreateCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -13356,12 +13300,11 @@ func (c *ProjectsLocationsScopesNamespacesDeleteCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13464,12 +13407,11 @@ func (c *ProjectsLocationsScopesNamespacesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13588,12 +13530,11 @@ func (c *ProjectsLocationsScopesNamespacesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/namespaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13715,8 +13656,7 @@ func (c *ProjectsLocationsScopesNamespacesPatchCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -13828,8 +13768,7 @@ func (c *ProjectsLocationsScopesRbacrolebindingsCreateCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -13928,12 +13867,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsDeleteCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14036,12 +13974,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14161,12 +14098,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/rbacrolebindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14291,8 +14227,7 @@ func (c *ProjectsLocationsScopesRbacrolebindingsPatchCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } diff --git a/gkehub/v1beta/gkehub-gen.go b/gkehub/v1beta/gkehub-gen.go index d026ecd7d22..179433969bc 100644 --- a/gkehub/v1beta/gkehub-gen.go +++ b/gkehub/v1beta/gkehub-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6088,12 +6087,11 @@ func (c *OrganizationsLocationsFleetsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/fleets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6217,12 +6215,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6348,12 +6345,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6491,8 +6487,7 @@ func (c *ProjectsLocationsFeaturesCreateCall) Header() http.Header { func (c *ProjectsLocationsFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -6616,12 +6611,11 @@ func (c *ProjectsLocationsFeaturesDeleteCall) Header() http.Header { func (c *ProjectsLocationsFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6733,12 +6727,11 @@ func (c *ProjectsLocationsFeaturesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6860,12 +6853,11 @@ func (c *ProjectsLocationsFeaturesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7012,12 +7004,11 @@ func (c *ProjectsLocationsFeaturesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7155,8 +7146,7 @@ func (c *ProjectsLocationsFeaturesPatchCall) Header() http.Header { func (c *ProjectsLocationsFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.feature) if err != nil { return nil, err } @@ -7260,8 +7250,7 @@ func (c *ProjectsLocationsFeaturesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFeaturesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7368,8 +7357,7 @@ func (c *ProjectsLocationsFeaturesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsFeaturesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7471,8 +7459,7 @@ func (c *ProjectsLocationsFleetsCreateCall) Header() http.Header { func (c *ProjectsLocationsFleetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fleet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fleet) if err != nil { return nil, err } @@ -7572,12 +7559,11 @@ func (c *ProjectsLocationsFleetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFleetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7680,12 +7666,11 @@ func (c *ProjectsLocationsFleetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7807,12 +7792,11 @@ func (c *ProjectsLocationsFleetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/fleets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7935,8 +7919,7 @@ func (c *ProjectsLocationsFleetsPatchCall) Header() http.Header { func (c *ProjectsLocationsFleetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fleet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fleet) if err != nil { return nil, err } @@ -8067,8 +8050,7 @@ func (c *ProjectsLocationsMembershipsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -8194,12 +8176,11 @@ func (c *ProjectsLocationsMembershipsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8352,12 +8333,11 @@ func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:generateConnectManifest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8461,12 +8441,11 @@ func (c *ProjectsLocationsMembershipsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8588,12 +8567,11 @@ func (c *ProjectsLocationsMembershipsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8733,12 +8711,11 @@ func (c *ProjectsLocationsMembershipsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8876,8 +8853,7 @@ func (c *ProjectsLocationsMembershipsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -8981,8 +8957,7 @@ func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMembershipsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9089,8 +9064,7 @@ func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9200,8 +9174,7 @@ func (c *ProjectsLocationsMembershipsBindingsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipbinding) if err != nil { return nil, err } @@ -9300,12 +9273,11 @@ func (c *ProjectsLocationsMembershipsBindingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9408,12 +9380,11 @@ func (c *ProjectsLocationsMembershipsBindingsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9541,12 +9512,11 @@ func (c *ProjectsLocationsMembershipsBindingsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/bindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9669,8 +9639,7 @@ func (c *ProjectsLocationsMembershipsBindingsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipbinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipbinding) if err != nil { return nil, err } @@ -9783,8 +9752,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsCreateCall) Header() http.H func (c *ProjectsLocationsMembershipsRbacrolebindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -9883,12 +9851,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsDeleteCall) Header() http.H func (c *ProjectsLocationsMembershipsRbacrolebindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9994,8 +9961,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleB func (c *ProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleBindingYAMLCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -10107,12 +10073,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10232,12 +10197,11 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/rbacrolebindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10362,8 +10326,7 @@ func (c *ProjectsLocationsMembershipsRbacrolebindingsPatchCall) Header() http.He func (c *ProjectsLocationsMembershipsRbacrolebindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -10471,8 +10434,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -10573,12 +10535,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10682,12 +10643,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10810,12 +10770,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10937,8 +10896,7 @@ func (c *ProjectsLocationsScopesCreateCall) Header() http.Header { func (c *ProjectsLocationsScopesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scope) if err != nil { return nil, err } @@ -11037,12 +10995,11 @@ func (c *ProjectsLocationsScopesDeleteCall) Header() http.Header { func (c *ProjectsLocationsScopesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11145,12 +11102,11 @@ func (c *ProjectsLocationsScopesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11272,12 +11228,11 @@ func (c *ProjectsLocationsScopesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11396,12 +11351,11 @@ func (c *ProjectsLocationsScopesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scopes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11556,12 +11510,11 @@ func (c *ProjectsLocationsScopesListMembershipsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+scopeName}:listMemberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11702,12 +11655,11 @@ func (c *ProjectsLocationsScopesListPermittedCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scopes:listPermitted") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11829,8 +11781,7 @@ func (c *ProjectsLocationsScopesPatchCall) Header() http.Header { func (c *ProjectsLocationsScopesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scope) if err != nil { return nil, err } @@ -11934,8 +11885,7 @@ func (c *ProjectsLocationsScopesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsScopesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12042,8 +11992,7 @@ func (c *ProjectsLocationsScopesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsScopesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12156,8 +12105,7 @@ func (c *ProjectsLocationsScopesNamespacesCreateCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -12256,12 +12204,11 @@ func (c *ProjectsLocationsScopesNamespacesDeleteCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12364,12 +12311,11 @@ func (c *ProjectsLocationsScopesNamespacesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12488,12 +12434,11 @@ func (c *ProjectsLocationsScopesNamespacesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/namespaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12615,8 +12560,7 @@ func (c *ProjectsLocationsScopesNamespacesPatchCall) Header() http.Header { func (c *ProjectsLocationsScopesNamespacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -12728,8 +12672,7 @@ func (c *ProjectsLocationsScopesRbacrolebindingsCreateCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } @@ -12828,12 +12771,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsDeleteCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12936,12 +12878,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13061,12 +13002,11 @@ func (c *ProjectsLocationsScopesRbacrolebindingsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/rbacrolebindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13191,8 +13131,7 @@ func (c *ProjectsLocationsScopesRbacrolebindingsPatchCall) Header() http.Header func (c *ProjectsLocationsScopesRbacrolebindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rbacrolebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rbacrolebinding) if err != nil { return nil, err } diff --git a/gkehub/v1beta1/gkehub-gen.go b/gkehub/v1beta1/gkehub-gen.go index c2298f484ae..71bd4de3ded 100644 --- a/gkehub/v1beta1/gkehub-gen.go +++ b/gkehub/v1beta1/gkehub-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1606,12 +1605,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1737,12 +1735,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1887,8 +1884,7 @@ func (c *ProjectsLocationsMembershipsCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -2014,12 +2010,11 @@ func (c *ProjectsLocationsMembershipsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2180,12 +2175,11 @@ func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:generateConnectManifest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2314,12 +2308,11 @@ func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:generateExclusivityManifest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2423,12 +2416,11 @@ func (c *ProjectsLocationsMembershipsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2550,12 +2542,11 @@ func (c *ProjectsLocationsMembershipsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2695,12 +2686,11 @@ func (c *ProjectsLocationsMembershipsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2838,8 +2828,7 @@ func (c *ProjectsLocationsMembershipsPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membership) if err != nil { return nil, err } @@ -2943,8 +2932,7 @@ func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsMembershipsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3051,8 +3039,7 @@ func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3182,12 +3169,11 @@ func (c *ProjectsLocationsMembershipsValidateExclusivityCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:validateExclusivity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3288,8 +3274,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3390,12 +3375,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3499,12 +3483,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3627,12 +3610,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/gkehub/v2alpha/gkehub-gen.go b/gkehub/v2alpha/gkehub-gen.go index a3d763ed48f..0b4f65bb684 100644 --- a/gkehub/v2alpha/gkehub-gen.go +++ b/gkehub/v2alpha/gkehub-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3520,12 +3519,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3651,12 +3649,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3784,8 +3781,7 @@ func (c *ProjectsLocationsMembershipsFeaturesCreateCall) Header() http.Header { func (c *ProjectsLocationsMembershipsFeaturesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipfeature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipfeature) if err != nil { return nil, err } @@ -3890,12 +3886,11 @@ func (c *ProjectsLocationsMembershipsFeaturesDeleteCall) Header() http.Header { func (c *ProjectsLocationsMembershipsFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3999,12 +3994,11 @@ func (c *ProjectsLocationsMembershipsFeaturesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4143,12 +4137,11 @@ func (c *ProjectsLocationsMembershipsFeaturesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/features") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4287,8 +4280,7 @@ func (c *ProjectsLocationsMembershipsFeaturesPatchCall) Header() http.Header { func (c *ProjectsLocationsMembershipsFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.membershipfeature) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.membershipfeature) if err != nil { return nil, err } @@ -4396,8 +4388,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4509,12 +4500,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4637,12 +4627,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/gkeonprem/v1/gkeonprem-gen.go b/gkeonprem/v1/gkeonprem-gen.go index c3798b4313f..4bbb040d18a 100644 --- a/gkeonprem/v1/gkeonprem-gen.go +++ b/gkeonprem/v1/gkeonprem-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5433,12 +5432,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5564,12 +5562,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5713,8 +5710,7 @@ func (c *ProjectsLocationsBareMetalAdminClustersCreateCall) Header() http.Header func (c *ProjectsLocationsBareMetalAdminClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.baremetaladmincluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.baremetaladmincluster) if err != nil { return nil, err } @@ -5819,8 +5815,7 @@ func (c *ProjectsLocationsBareMetalAdminClustersEnrollCall) Header() http.Header func (c *ProjectsLocationsBareMetalAdminClustersEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollbaremetaladminclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollbaremetaladminclusterrequest) if err != nil { return nil, err } @@ -5963,12 +5958,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6091,12 +6085,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6247,12 +6240,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bareMetalAdminClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6385,8 +6377,7 @@ func (c *ProjectsLocationsBareMetalAdminClustersPatchCall) Header() http.Header func (c *ProjectsLocationsBareMetalAdminClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.baremetaladmincluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.baremetaladmincluster) if err != nil { return nil, err } @@ -6495,12 +6486,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersQueryVersionConfigCall) Header() func (c *ProjectsLocationsBareMetalAdminClustersQueryVersionConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bareMetalAdminClusters:queryVersionConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6597,8 +6587,7 @@ func (c *ProjectsLocationsBareMetalAdminClustersSetIamPolicyCall) Header() http. func (c *ProjectsLocationsBareMetalAdminClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6705,8 +6694,7 @@ func (c *ProjectsLocationsBareMetalAdminClustersTestIamPermissionsCall) Header() func (c *ProjectsLocationsBareMetalAdminClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6845,12 +6833,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersUnenrollCall) Header() http.Head func (c *ProjectsLocationsBareMetalAdminClustersUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6954,12 +6941,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7082,12 +7068,11 @@ func (c *ProjectsLocationsBareMetalAdminClustersOperationsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7228,8 +7213,7 @@ func (c *ProjectsLocationsBareMetalClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsBareMetalClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.baremetalcluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.baremetalcluster) if err != nil { return nil, err } @@ -7371,12 +7355,11 @@ func (c *ProjectsLocationsBareMetalClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsBareMetalClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7474,8 +7457,7 @@ func (c *ProjectsLocationsBareMetalClustersEnrollCall) Header() http.Header { func (c *ProjectsLocationsBareMetalClustersEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollbaremetalclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollbaremetalclusterrequest) if err != nil { return nil, err } @@ -7618,12 +7600,11 @@ func (c *ProjectsLocationsBareMetalClustersGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7746,12 +7727,11 @@ func (c *ProjectsLocationsBareMetalClustersGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7909,12 +7889,11 @@ func (c *ProjectsLocationsBareMetalClustersListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bareMetalClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8056,8 +8035,7 @@ func (c *ProjectsLocationsBareMetalClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsBareMetalClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.baremetalcluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.baremetalcluster) if err != nil { return nil, err } @@ -8185,12 +8163,11 @@ func (c *ProjectsLocationsBareMetalClustersQueryVersionConfigCall) Header() http func (c *ProjectsLocationsBareMetalClustersQueryVersionConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bareMetalClusters:queryVersionConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8287,8 +8264,7 @@ func (c *ProjectsLocationsBareMetalClustersSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsBareMetalClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8395,8 +8371,7 @@ func (c *ProjectsLocationsBareMetalClustersTestIamPermissionsCall) Header() http func (c *ProjectsLocationsBareMetalClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8532,12 +8507,11 @@ func (c *ProjectsLocationsBareMetalClustersUnenrollCall) Header() http.Header { func (c *ProjectsLocationsBareMetalClustersUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8649,8 +8623,7 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsCreateCall) Header( func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.baremetalnodepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.baremetalnodepool) if err != nil { return nil, err } @@ -8786,12 +8759,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsDeleteCall) Header( func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8887,8 +8859,7 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsEnrollCall) Header( func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollbaremetalnodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollbaremetalnodepoolrequest) if err != nil { return nil, err } @@ -9023,12 +8994,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9151,12 +9121,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsGetIamPolicyCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9303,12 +9272,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bareMetalNodePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9450,8 +9418,7 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsPatchCall) Header() func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.baremetalnodepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.baremetalnodepool) if err != nil { return nil, err } @@ -9555,8 +9522,7 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsSetIamPolicyCall) H func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9663,8 +9629,7 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsTestIamPermissionsC func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9788,12 +9753,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsUnenrollCall) Heade func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9897,12 +9861,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsOperationsGetCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10025,12 +9988,11 @@ func (c *ProjectsLocationsBareMetalClustersBareMetalNodePoolsOperationsListCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10156,12 +10118,11 @@ func (c *ProjectsLocationsBareMetalClustersOperationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10284,12 +10245,11 @@ func (c *ProjectsLocationsBareMetalClustersOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10411,8 +10371,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -10513,12 +10472,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10622,12 +10580,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10750,12 +10707,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10897,8 +10853,7 @@ func (c *ProjectsLocationsVmwareAdminClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsVmwareAdminClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwareadmincluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwareadmincluster) if err != nil { return nil, err } @@ -11003,8 +10958,7 @@ func (c *ProjectsLocationsVmwareAdminClustersEnrollCall) Header() http.Header { func (c *ProjectsLocationsVmwareAdminClustersEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollvmwareadminclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollvmwareadminclusterrequest) if err != nil { return nil, err } @@ -11146,12 +11100,11 @@ func (c *ProjectsLocationsVmwareAdminClustersGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11274,12 +11227,11 @@ func (c *ProjectsLocationsVmwareAdminClustersGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11430,12 +11382,11 @@ func (c *ProjectsLocationsVmwareAdminClustersListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vmwareAdminClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11568,8 +11519,7 @@ func (c *ProjectsLocationsVmwareAdminClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsVmwareAdminClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwareadmincluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwareadmincluster) if err != nil { return nil, err } @@ -11673,8 +11623,7 @@ func (c *ProjectsLocationsVmwareAdminClustersSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsVmwareAdminClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11781,8 +11730,7 @@ func (c *ProjectsLocationsVmwareAdminClustersTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsVmwareAdminClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11909,12 +11857,11 @@ func (c *ProjectsLocationsVmwareAdminClustersUnenrollCall) Header() http.Header func (c *ProjectsLocationsVmwareAdminClustersUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12018,12 +11965,11 @@ func (c *ProjectsLocationsVmwareAdminClustersOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12146,12 +12092,11 @@ func (c *ProjectsLocationsVmwareAdminClustersOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12292,8 +12237,7 @@ func (c *ProjectsLocationsVmwareClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsVmwareClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwarecluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwarecluster) if err != nil { return nil, err } @@ -12434,12 +12378,11 @@ func (c *ProjectsLocationsVmwareClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsVmwareClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12537,8 +12480,7 @@ func (c *ProjectsLocationsVmwareClustersEnrollCall) Header() http.Header { func (c *ProjectsLocationsVmwareClustersEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollvmwareclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollvmwareclusterrequest) if err != nil { return nil, err } @@ -12680,12 +12622,11 @@ func (c *ProjectsLocationsVmwareClustersGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12807,12 +12748,11 @@ func (c *ProjectsLocationsVmwareClustersGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12970,12 +12910,11 @@ func (c *ProjectsLocationsVmwareClustersListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vmwareClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13108,8 +13047,7 @@ func (c *ProjectsLocationsVmwareClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsVmwareClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwarecluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwarecluster) if err != nil { return nil, err } @@ -13236,12 +13174,11 @@ func (c *ProjectsLocationsVmwareClustersQueryVersionConfigCall) Header() http.He func (c *ProjectsLocationsVmwareClustersQueryVersionConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vmwareClusters:queryVersionConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13338,8 +13275,7 @@ func (c *ProjectsLocationsVmwareClustersSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsVmwareClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13446,8 +13382,7 @@ func (c *ProjectsLocationsVmwareClustersTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsVmwareClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -13582,12 +13517,11 @@ func (c *ProjectsLocationsVmwareClustersUnenrollCall) Header() http.Header { func (c *ProjectsLocationsVmwareClustersUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13691,12 +13625,11 @@ func (c *ProjectsLocationsVmwareClustersOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13819,12 +13752,11 @@ func (c *ProjectsLocationsVmwareClustersOperationsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13958,8 +13890,7 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsCreateCall) Header() http func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwarenodepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwarenodepool) if err != nil { return nil, err } @@ -14095,12 +14026,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsDeleteCall) Header() http func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14192,8 +14122,7 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsEnrollCall) Header() http func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsEnrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollvmwarenodepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enrollvmwarenodepoolrequest) if err != nil { return nil, err } @@ -14328,12 +14257,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14455,12 +14383,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsGetIamPolicyCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14605,12 +14532,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vmwareNodePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14743,8 +14669,7 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsPatchCall) Header() http. func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwarenodepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwarenodepool) if err != nil { return nil, err } @@ -14848,8 +14773,7 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsSetIamPolicyCall) Header( func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -14956,8 +14880,7 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsTestIamPermissionsCall) H func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -15081,12 +15004,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsUnenrollCall) Header() ht func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsUnenrollCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenroll") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15190,12 +15112,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsOperationsGetCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15318,12 +15239,11 @@ func (c *ProjectsLocationsVmwareClustersVmwareNodePoolsOperationsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/gmail/v1/gmail-gen.go b/gmail/v1/gmail-gen.go index 9aa5f632d50..428285dee96 100644 --- a/gmail/v1/gmail-gen.go +++ b/gmail/v1/gmail-gen.go @@ -172,7 +172,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -191,9 +192,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2217,12 +2216,11 @@ func (c *UsersGetProfileCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/profile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2313,12 +2311,11 @@ func (c *UsersStopCall) Header() http.Header { func (c *UsersStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/stop") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2388,8 +2385,7 @@ func (c *UsersWatchCall) Header() http.Header { func (c *UsersWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.watchrequest) if err != nil { return nil, err } @@ -2529,8 +2525,7 @@ func (c *UsersDraftsCreateCall) Header() http.Header { func (c *UsersDraftsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.draft) if err != nil { return nil, err } @@ -2541,14 +2536,10 @@ func (c *UsersDraftsCreateCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/drafts") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -2661,12 +2652,11 @@ func (c *UsersDraftsDeleteCall) Header() http.Header { func (c *UsersDraftsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2775,12 +2765,11 @@ func (c *UsersDraftsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2914,12 +2903,11 @@ func (c *UsersDraftsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3074,8 +3062,7 @@ func (c *UsersDraftsSendCall) Header() http.Header { func (c *UsersDraftsSendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.draft) if err != nil { return nil, err } @@ -3086,14 +3073,10 @@ func (c *UsersDraftsSendCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/drafts/send") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -3246,8 +3229,7 @@ func (c *UsersDraftsUpdateCall) Header() http.Header { func (c *UsersDraftsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.draft) if err != nil { return nil, err } @@ -3258,14 +3240,10 @@ func (c *UsersDraftsUpdateCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/drafts/{id}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, newBody) if err != nil { return nil, err } @@ -3440,12 +3418,11 @@ func (c *UsersHistoryListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3560,8 +3537,7 @@ func (c *UsersLabelsCreateCall) Header() http.Header { func (c *UsersLabelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.label) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.label) if err != nil { return nil, err } @@ -3664,12 +3640,11 @@ func (c *UsersLabelsDeleteCall) Header() http.Header { func (c *UsersLabelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3753,12 +3728,11 @@ func (c *UsersLabelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3862,12 +3836,11 @@ func (c *UsersLabelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3964,8 +3937,7 @@ func (c *UsersLabelsPatchCall) Header() http.Header { func (c *UsersLabelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.label) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.label) if err != nil { return nil, err } @@ -4070,8 +4042,7 @@ func (c *UsersLabelsUpdateCall) Header() http.Header { func (c *UsersLabelsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.label) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.label) if err != nil { return nil, err } @@ -4174,8 +4145,7 @@ func (c *UsersMessagesBatchDeleteCall) Header() http.Header { func (c *UsersMessagesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletemessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletemessagesrequest) if err != nil { return nil, err } @@ -4253,8 +4223,7 @@ func (c *UsersMessagesBatchModifyCall) Header() http.Header { func (c *UsersMessagesBatchModifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchmodifymessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchmodifymessagesrequest) if err != nil { return nil, err } @@ -4334,12 +4303,11 @@ func (c *UsersMessagesDeleteCall) Header() http.Header { func (c *UsersMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4457,12 +4425,11 @@ func (c *UsersMessagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4639,8 +4606,7 @@ func (c *UsersMessagesImportCall) Header() http.Header { func (c *UsersMessagesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -4651,14 +4617,10 @@ func (c *UsersMessagesImportCall) doRequest(alt string) (*http.Response, error) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/messages/import") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -4835,8 +4797,7 @@ func (c *UsersMessagesInsertCall) Header() http.Header { func (c *UsersMessagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -4847,14 +4808,10 @@ func (c *UsersMessagesInsertCall) doRequest(alt string) (*http.Response, error) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/messages") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -5016,12 +4973,11 @@ func (c *UsersMessagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5139,8 +5095,7 @@ func (c *UsersMessagesModifyCall) Header() http.Header { func (c *UsersMessagesModifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifymessagerequest) if err != nil { return nil, err } @@ -5283,8 +5238,7 @@ func (c *UsersMessagesSendCall) Header() http.Header { func (c *UsersMessagesSendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -5295,14 +5249,10 @@ func (c *UsersMessagesSendCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/messages/send") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -5414,12 +5364,11 @@ func (c *UsersMessagesTrashCall) Header() http.Header { func (c *UsersMessagesTrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}/trash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5514,12 +5463,11 @@ func (c *UsersMessagesUntrashCall) Header() http.Header { func (c *UsersMessagesUntrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}/untrash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5629,12 +5577,11 @@ func (c *UsersMessagesAttachmentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5741,12 +5688,11 @@ func (c *UsersSettingsGetAutoForwardingCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/autoForwarding") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5849,12 +5795,11 @@ func (c *UsersSettingsGetImapCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/imap") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5957,12 +5902,11 @@ func (c *UsersSettingsGetLanguageCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/language") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6066,12 +6010,11 @@ func (c *UsersSettingsGetPopCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/pop") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6174,12 +6117,11 @@ func (c *UsersSettingsGetVacationCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/vacation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6276,8 +6218,7 @@ func (c *UsersSettingsUpdateAutoForwardingCall) Header() http.Header { func (c *UsersSettingsUpdateAutoForwardingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoforwarding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autoforwarding) if err != nil { return nil, err } @@ -6378,8 +6319,7 @@ func (c *UsersSettingsUpdateImapCall) Header() http.Header { func (c *UsersSettingsUpdateImapCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.imapsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.imapsettings) if err != nil { return nil, err } @@ -6484,8 +6424,7 @@ func (c *UsersSettingsUpdateLanguageCall) Header() http.Header { func (c *UsersSettingsUpdateLanguageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.languagesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.languagesettings) if err != nil { return nil, err } @@ -6587,8 +6526,7 @@ func (c *UsersSettingsUpdatePopCall) Header() http.Header { func (c *UsersSettingsUpdatePopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.popsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.popsettings) if err != nil { return nil, err } @@ -6689,8 +6627,7 @@ func (c *UsersSettingsUpdateVacationCall) Header() http.Header { func (c *UsersSettingsUpdateVacationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vacationsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vacationsettings) if err != nil { return nil, err } @@ -6795,8 +6732,7 @@ func (c *UsersSettingsCseIdentitiesCreateCall) Header() http.Header { func (c *UsersSettingsCseIdentitiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cseidentity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cseidentity) if err != nil { return nil, err } @@ -6902,12 +6838,11 @@ func (c *UsersSettingsCseIdentitiesDeleteCall) Header() http.Header { func (c *UsersSettingsCseIdentitiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6992,12 +6927,11 @@ func (c *UsersSettingsCseIdentitiesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7116,12 +7050,11 @@ func (c *UsersSettingsCseIdentitiesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/cse/identities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7242,8 +7175,7 @@ func (c *UsersSettingsCseIdentitiesPatchCall) Header() http.Header { func (c *UsersSettingsCseIdentitiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cseidentity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cseidentity) if err != nil { return nil, err } @@ -7346,8 +7278,7 @@ func (c *UsersSettingsCseKeypairsCreateCall) Header() http.Header { func (c *UsersSettingsCseKeypairsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.csekeypair) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.csekeypair) if err != nil { return nil, err } @@ -7455,8 +7386,7 @@ func (c *UsersSettingsCseKeypairsDisableCall) Header() http.Header { func (c *UsersSettingsCseKeypairsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablecsekeypairrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablecsekeypairrequest) if err != nil { return nil, err } @@ -7563,8 +7493,7 @@ func (c *UsersSettingsCseKeypairsEnableCall) Header() http.Header { func (c *UsersSettingsCseKeypairsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablecsekeypairrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablecsekeypairrequest) if err != nil { return nil, err } @@ -7679,12 +7608,11 @@ func (c *UsersSettingsCseKeypairsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7803,12 +7731,11 @@ func (c *UsersSettingsCseKeypairsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/cse/keypairs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7931,8 +7858,7 @@ func (c *UsersSettingsCseKeypairsObliterateCall) Header() http.Header { func (c *UsersSettingsCseKeypairsObliterateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.obliteratecsekeypairrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.obliteratecsekeypairrequest) if err != nil { return nil, err } @@ -8021,8 +7947,7 @@ func (c *UsersSettingsDelegatesCreateCall) Header() http.Header { func (c *UsersSettingsDelegatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.delegate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.delegate) if err != nil { return nil, err } @@ -8128,12 +8053,11 @@ func (c *UsersSettingsDelegatesDeleteCall) Header() http.Header { func (c *UsersSettingsDelegatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8221,12 +8145,11 @@ func (c *UsersSettingsDelegatesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8332,12 +8255,11 @@ func (c *UsersSettingsDelegatesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8432,8 +8354,7 @@ func (c *UsersSettingsFiltersCreateCall) Header() http.Header { func (c *UsersSettingsFiltersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filter) if err != nil { return nil, err } @@ -8535,12 +8456,11 @@ func (c *UsersSettingsFiltersDeleteCall) Header() http.Header { func (c *UsersSettingsFiltersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8624,12 +8544,11 @@ func (c *UsersSettingsFiltersGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8733,12 +8652,11 @@ func (c *UsersSettingsFiltersListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8836,8 +8754,7 @@ func (c *UsersSettingsForwardingAddressesCreateCall) Header() http.Header { func (c *UsersSettingsForwardingAddressesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingaddress) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.forwardingaddress) if err != nil { return nil, err } @@ -8942,12 +8859,11 @@ func (c *UsersSettingsForwardingAddressesDeleteCall) Header() http.Header { func (c *UsersSettingsForwardingAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9031,12 +8947,11 @@ func (c *UsersSettingsForwardingAddressesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9141,12 +9056,11 @@ func (c *UsersSettingsForwardingAddressesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9248,8 +9162,7 @@ func (c *UsersSettingsSendAsCreateCall) Header() http.Header { func (c *UsersSettingsSendAsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendas) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendas) if err != nil { return nil, err } @@ -9353,12 +9266,11 @@ func (c *UsersSettingsSendAsDeleteCall) Header() http.Header { func (c *UsersSettingsSendAsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9443,12 +9355,11 @@ func (c *UsersSettingsSendAsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9554,12 +9465,11 @@ func (c *UsersSettingsSendAsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9656,8 +9566,7 @@ func (c *UsersSettingsSendAsPatchCall) Header() http.Header { func (c *UsersSettingsSendAsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendas) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendas) if err != nil { return nil, err } @@ -9765,8 +9674,7 @@ func (c *UsersSettingsSendAsUpdateCall) Header() http.Header { func (c *UsersSettingsSendAsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendas) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendas) if err != nil { return nil, err } @@ -9871,12 +9779,11 @@ func (c *UsersSettingsSendAsVerifyCall) Header() http.Header { func (c *UsersSettingsSendAsVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9952,12 +9859,11 @@ func (c *UsersSettingsSendAsSmimeInfoDeleteCall) Header() http.Header { func (c *UsersSettingsSendAsSmimeInfoDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10046,12 +9952,11 @@ func (c *UsersSettingsSendAsSmimeInfoGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10151,8 +10056,7 @@ func (c *UsersSettingsSendAsSmimeInfoInsertCall) Header() http.Header { func (c *UsersSettingsSendAsSmimeInfoInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.smimeinfo) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.smimeinfo) if err != nil { return nil, err } @@ -10268,12 +10172,11 @@ func (c *UsersSettingsSendAsSmimeInfoListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10373,12 +10276,11 @@ func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) Header() http.Header { func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10453,12 +10355,11 @@ func (c *UsersThreadsDeleteCall) Header() http.Header { func (c *UsersThreadsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10568,12 +10469,11 @@ func (c *UsersThreadsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10715,12 +10615,11 @@ func (c *UsersThreadsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10839,8 +10738,7 @@ func (c *UsersThreadsModifyCall) Header() http.Header { func (c *UsersThreadsModifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifythreadrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifythreadrequest) if err != nil { return nil, err } @@ -10944,12 +10842,11 @@ func (c *UsersThreadsTrashCall) Header() http.Header { func (c *UsersThreadsTrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}/trash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11045,12 +10942,11 @@ func (c *UsersThreadsUntrashCall) Header() http.Header { func (c *UsersThreadsUntrashCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}/untrash") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/gmailpostmastertools/v1/gmailpostmastertools-gen.go b/gmailpostmastertools/v1/gmailpostmastertools-gen.go index 31ca52a1cd3..064c3603528 100644 --- a/gmailpostmastertools/v1/gmailpostmastertools-gen.go +++ b/gmailpostmastertools/v1/gmailpostmastertools-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Domains = NewDomainsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Domains = NewDomainsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -619,12 +618,11 @@ func (c *DomainsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -741,12 +739,11 @@ func (c *DomainsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -870,12 +867,11 @@ func (c *DomainsTrafficStatsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1042,12 +1038,11 @@ func (c *DomainsTrafficStatsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/trafficStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/gmailpostmastertools/v1beta1/gmailpostmastertools-gen.go b/gmailpostmastertools/v1beta1/gmailpostmastertools-gen.go index 497b7ce13c0..e3c9e0743ea 100644 --- a/gmailpostmastertools/v1beta1/gmailpostmastertools-gen.go +++ b/gmailpostmastertools/v1beta1/gmailpostmastertools-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Domains = NewDomainsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Domains = NewDomainsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -624,12 +623,11 @@ func (c *DomainsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -746,12 +744,11 @@ func (c *DomainsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -875,12 +872,11 @@ func (c *DomainsTrafficStatsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1047,12 +1043,11 @@ func (c *DomainsTrafficStatsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/trafficStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/go.work.sum b/go.work.sum index 43ffe5381d4..38e803c6ed7 100644 --- a/go.work.sum +++ b/go.work.sum @@ -353,6 +353,7 @@ cloud.google.com/go/logging v1.12.0/go.mod h1:wwYBt5HlYP1InnrtYI0wtwttpVU1rifnMT cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMILWnOg= cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= +cloud.google.com/go/longrunning v0.5.6/go.mod h1:vUaDrWYOMKRuhiv6JBnn49YxCPz2Ayn9GqyjaBT8/mA= cloud.google.com/go/longrunning v0.5.11/go.mod h1:rDn7//lmlfWV1Dx6IB4RatCPenTwwmqXuiP0/RgoEO4= cloud.google.com/go/longrunning v0.6.0/go.mod h1:uHzSZqW89h7/pasCWNYdUpwGz3PcVWhrWupreVPYLts= cloud.google.com/go/longrunning v0.6.1/go.mod h1:nHISoOZpBcmlwbJmiVk5oDRz0qG/ZxPynEGs1iZ79s0= @@ -575,6 +576,7 @@ cloud.google.com/go/trace v1.11.0/go.mod h1:Aiemdi52635dBR7o3zuc9lLjXo3BwGaChEjC cloud.google.com/go/trace v1.11.1/go.mod h1:IQKNQuBzH72EGaXEodKlNJrWykGZxet2zgjtS60OtjA= cloud.google.com/go/trace v1.11.2/go.mod h1:bn7OwXd4pd5rFuAnTrzBuoZ4ax2XQeG3qNgYmfCy0Io= cloud.google.com/go/translate v1.10.1/go.mod h1:adGZcQNom/3ogU65N9UXHOnnSvjPwA/jKQUMnsYXOyk= +cloud.google.com/go/translate v1.10.3/go.mod h1:GW0vC1qvPtd3pgtypCv4k4U8B7EdgK9/QEF2aJEUovs= cloud.google.com/go/translate v1.10.7/go.mod h1:mH/+8tvcItuy1cOWqU+/Y3iFHgkVUObNIQYI/kiFFiY= cloud.google.com/go/translate v1.12.0/go.mod h1:4/C4shFIY5hSZ3b3g+xXWM5xhBLqcUqksSMrQ7tyFtc= cloud.google.com/go/translate v1.12.1/go.mod h1:5f4RvC7/hh76qSl6LYuqOJaKbIzEpR1Sj+CMA6gSgIk= diff --git a/google-api-go-generator/gen.go b/google-api-go-generator/gen.go index 1fc1a3f2d9d..38de45e7080 100644 --- a/google-api-go-generator/gen.go +++ b/google-api-go-generator/gen.go @@ -895,7 +895,10 @@ func (a *API) GenerateCode() ([]byte, error) { pn("client, endpoint, err := htransport.NewClient(ctx, opts...)") pn("if err != nil { return nil, err }") - pn("s, err := New(client)") + pn("s := &%s{client: client, BasePath: basePath}", service) + for _, res := range a.doc.Resources { // add top level resources. + pn("s.%s = New%s(s)", resourceGoField(res, nil), resourceGoType(res)) + } pn("if err != nil { return nil, err }") pn(`if endpoint != "" { s.BasePath = endpoint }`) pn("return s, nil") @@ -908,11 +911,7 @@ func (a *API) GenerateCode() ([]byte, error) { pn("// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.") pn("func New(client *http.Client) (*%s, error) {", service) pn("if client == nil { return nil, errors.New(\"client is nil\") }") - pn("s := &%s{client: client, BasePath: basePath}", service) - for _, res := range a.doc.Resources { // add top level resources. - pn("s.%s = New%s(s)", resourceGoField(res, nil), resourceGoType(res)) - } - pn("return s, nil") + pn("return NewService(context.Background(), option.WithHTTPClient(client))") pn("}") pn("\ntype %s struct {", service) @@ -994,7 +993,6 @@ func splitFileHeading(w io.Writer, pkg string) { for _, imp := range []string{ "context", "fmt", - "io", "net/http", } { pn(" %q", imp) @@ -2265,7 +2263,8 @@ func (meth *Method) generateCode() { pn("\nfunc (c *%s) doRequest(alt string) (*http.Response, error) {", callName) var contentType = `""` - if !meth.IsRawRequest() && args.bodyArg() != nil && httpMethod != "GET" { + if (!meth.IsRawRequest() && args.bodyArg() != nil && httpMethod != "GET") || + (meth.supportsMediaUpload() && args.bodyArg() == nil) { contentType = `"application/json"` } apiVersion := meth.m.APIVersion @@ -2279,31 +2278,40 @@ func (meth *Method) generateCode() { pn(` reqHeaders.Set("If-None-Match", c.ifNoneMatch_)`) pn("}") } - pn("var body io.Reader = nil") + var hasBody bool if meth.IsRawRequest() { - pn("body = c.body_") + pn("body := bytes.NewBuffer(nil)") + pn("_, err := body.ReadFrom(c.body_)") + pn("if err != nil { return nil, err }") + hasBody = true } else if meth.IsProtoStructRequest() { pn("protoBytes, err := json.Marshal(c.req)") pn("if err != nil { return nil, err }") - pn("body = bytes.NewReader(protoBytes)") + pn("body := bytes.NewReader(protoBytes)") + hasBody = true } else { if ba := args.bodyArg(); ba != nil && httpMethod != "GET" { if meth.m.ID == "ml.projects.predict" { // TODO(cbro): move ML API to rawHTTP (it will be a breaking change) - // Skip JSONReader for APIs that require clients to pass in JSON already. - pn("body = strings.NewReader(c.%s.HttpBody.Data)", ba.goname) + // Skip JSONBuffer for APIs that require clients to pass in JSON already. + pn("body := bytes.NewBufferString(c.%s.HttpBody.Data)", ba.goname) } else { style := "WithoutDataWrapper" if a.needsDataWrapper() { style = "WithDataWrapper" } - pn("body, err := googleapi.%s.JSONReader(c.%s)", style, ba.goname) + pn("body, err := googleapi.%s.JSONBuffer(c.%s)", style, ba.goname) pn("if err != nil { return nil, err }") } + hasBody = true } pn(`c.urlParams_.Set("alt", alt)`) pn(`c.urlParams_.Set("prettyPrint", "false")`) } + bodyArg := "nil" + if hasBody { + bodyArg = "body" + } pn("urls := googleapi.ResolveRelative(c.s.BasePath, %q)", meth.m.Path) if meth.supportsMediaUpload() { @@ -2312,15 +2320,12 @@ func (meth *Method) generateCode() { pn(` c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())`) pn("}") - pn("if body == nil {") - pn(" body = new(bytes.Buffer)") - pn(` reqHeaders.Set("Content-Type", "application/json")`) - pn("}") - pn("body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)") + pn("newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, %s)", bodyArg) pn("defer cleanup()") + bodyArg = "newBody" } pn(`urls += "?" + c.urlParams_.Encode()`) - pn("req, err := http.NewRequest(%q, urls, body)", httpMethod) + pn("req, err := http.NewRequest(%q, urls, %s)", httpMethod, bodyArg) pn("if err != nil { return nil, err }") pn("req.Header = reqHeaders") if meth.supportsMediaUpload() { diff --git a/google-api-go-generator/gen_test.go b/google-api-go-generator/gen_test.go index a9ad03a2823..3a8e36410d0 100644 --- a/google-api-go-generator/gen_test.go +++ b/google-api-go-generator/gen_test.go @@ -43,6 +43,7 @@ func TestAPIs(t *testing.T) { "mapofint64strings", "mapofobjects", "mapofstrings-1", + "mediaupload", "param-rename", "quotednum", "repeated", diff --git a/google-api-go-generator/testdata/any.want b/google-api-go-generator/testdata/any.want index 7d623e14e7c..90b987846a0 100644 --- a/google-api-go-generator/testdata/any.want +++ b/google-api-go-generator/testdata/any.want @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -752,12 +751,11 @@ func (c *ProjectsLogServicesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -935,12 +933,11 @@ func (c *ProjectsLogServicesIndexesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1059,8 +1056,7 @@ func (c *ProjectsLogServicesSinksCreateCall) Header() http.Header { func (c *ProjectsLogServicesSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -1165,12 +1161,11 @@ func (c *ProjectsLogServicesSinksDeleteCall) Header() http.Header { func (c *ProjectsLogServicesSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1280,12 +1275,11 @@ func (c *ProjectsLogServicesSinksGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1393,12 +1387,11 @@ func (c *ProjectsLogServicesSinksListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1498,8 +1491,7 @@ func (c *ProjectsLogServicesSinksUpdateCall) Header() http.Header { func (c *ProjectsLogServicesSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -1603,12 +1595,11 @@ func (c *ProjectsLogsDeleteCall) Header() http.Header { func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1752,12 +1743,11 @@ func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1881,8 +1871,7 @@ func (c *ProjectsLogsEntriesWriteCall) Header() http.Header { func (c *ProjectsLogsEntriesWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writelogentriesrequest) if err != nil { return nil, err } @@ -1987,8 +1976,7 @@ func (c *ProjectsLogsSinksCreateCall) Header() http.Header { func (c *ProjectsLogsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -2093,12 +2081,11 @@ func (c *ProjectsLogsSinksDeleteCall) Header() http.Header { func (c *ProjectsLogsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2208,12 +2195,11 @@ func (c *ProjectsLogsSinksGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2320,12 +2306,11 @@ func (c *ProjectsLogsSinksListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2425,8 +2410,7 @@ func (c *ProjectsLogsSinksUpdateCall) Header() http.Header { func (c *ProjectsLogsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_, "x-goog-api-version", "v1_20240501") - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/arrayofarray-1.want b/google-api-go-generator/testdata/arrayofarray-1.want index 21b3b2fbc1a..6eab6008c7e 100644 --- a/google-api-go-generator/testdata/arrayofarray-1.want +++ b/google-api-go-generator/testdata/arrayofarray-1.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/arrayofenum.want b/google-api-go-generator/testdata/arrayofenum.want index a9f4de04823..9a2f56e0b08 100644 --- a/google-api-go-generator/testdata/arrayofenum.want +++ b/google-api-go-generator/testdata/arrayofenum.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/arrayofmapofobjects.want b/google-api-go-generator/testdata/arrayofmapofobjects.want index 6bd02b469cb..24df3cc4cd0 100644 --- a/google-api-go-generator/testdata/arrayofmapofobjects.want +++ b/google-api-go-generator/testdata/arrayofmapofobjects.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/arrayofmapofstrings.want b/google-api-go-generator/testdata/arrayofmapofstrings.want index 58ae792254a..06c4a884d11 100644 --- a/google-api-go-generator/testdata/arrayofmapofstrings.want +++ b/google-api-go-generator/testdata/arrayofmapofstrings.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/blogger-3.want b/google-api-go-generator/testdata/blogger-3.want index 94ab15560ef..0bf98a7635c 100644 --- a/google-api-go-generator/testdata/blogger-3.want +++ b/google-api-go-generator/testdata/blogger-3.want @@ -123,7 +123,15 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BlogUserInfos = NewBlogUserInfosService(s) + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.PageViews = NewPageViewsService(s) + s.Pages = NewPagesService(s) + s.PostUserInfos = NewPostUserInfosService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -142,16 +150,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BlogUserInfos = NewBlogUserInfosService(s) - s.Blogs = NewBlogsService(s) - s.Comments = NewCommentsService(s) - s.PageViews = NewPageViewsService(s) - s.Pages = NewPagesService(s) - s.PostUserInfos = NewPostUserInfosService(s) - s.Posts = NewPostsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1333,12 +1332,11 @@ func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1448,12 +1446,11 @@ func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1554,12 +1551,11 @@ func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1678,12 +1674,11 @@ func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1779,12 +1774,11 @@ func (c *CommentsApproveCall) Header() http.Header { func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1882,12 +1876,11 @@ func (c *CommentsDeleteCall) Header() http.Header { func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1974,12 +1967,11 @@ func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2146,12 +2138,11 @@ func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2311,12 +2302,11 @@ func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2433,12 +2423,11 @@ func (c *CommentsMarkAsSpamCall) Header() http.Header { func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2536,12 +2525,11 @@ func (c *CommentsRemoveContentCall) Header() http.Header { func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2657,12 +2645,11 @@ func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2755,12 +2742,11 @@ func (c *PagesDeleteCall) Header() http.Header { func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2855,12 +2841,11 @@ func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2953,8 +2938,7 @@ func (c *PagesInsertCall) Header() http.Header { func (c *PagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.page) if err != nil { return nil, err } @@ -3096,12 +3080,11 @@ func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3196,8 +3179,7 @@ func (c *PagesPatchCall) Header() http.Header { func (c *PagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.page) if err != nil { return nil, err } @@ -3301,8 +3283,7 @@ func (c *PagesUpdateCall) Header() http.Header { func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.page) if err != nil { return nil, err } @@ -3427,12 +3408,11 @@ func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3617,12 +3597,11 @@ func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3738,12 +3717,11 @@ func (c *PostsDeleteCall) Header() http.Header { func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3845,12 +3823,11 @@ func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3974,12 +3951,11 @@ func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4078,8 +4054,7 @@ func (c *PostsInsertCall) Header() http.Header { func (c *PostsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.post) if err != nil { return nil, err } @@ -4274,12 +4249,11 @@ func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4395,8 +4369,7 @@ func (c *PostsPatchCall) Header() http.Header { func (c *PostsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.post) if err != nil { return nil, err } @@ -4505,12 +4478,11 @@ func (c *PostsPublishCall) Header() http.Header { func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4604,12 +4576,11 @@ func (c *PostsRevertCall) Header() http.Header { func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4733,12 +4704,11 @@ func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4833,8 +4803,7 @@ func (c *PostsUpdateCall) Header() http.Header { func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.post) if err != nil { return nil, err } @@ -4945,12 +4914,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/floats.want b/google-api-go-generator/testdata/floats.want index 544cd5e8434..a6ae22bcdaf 100644 --- a/google-api-go-generator/testdata/floats.want +++ b/google-api-go-generator/testdata/floats.want @@ -103,7 +103,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -122,8 +122,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/getwithoutbody.want b/google-api-go-generator/testdata/getwithoutbody.want index c4a0b27fb70..3f42e43710c 100644 --- a/google-api-go-generator/testdata/getwithoutbody.want +++ b/google-api-go-generator/testdata/getwithoutbody.want @@ -99,7 +99,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.MetricDescriptors = NewMetricDescriptorsService(s) if err != nil { return nil, err } @@ -118,9 +119,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.MetricDescriptors = NewMetricDescriptorsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -275,12 +274,11 @@ func (c *MetricDescriptorsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/http-body.want b/google-api-go-generator/testdata/http-body.want index 5e4e1d8a059..5e36b1fd03a 100644 --- a/google-api-go-generator/testdata/http-body.want +++ b/google-api-go-generator/testdata/http-body.want @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -333,8 +332,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirCreateResourceCall) Header() htt func (c *ProjectsLocationsDatasetsFhirStoresFhirCreateResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -430,12 +432,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirReadCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/json-body.want b/google-api-go-generator/testdata/json-body.want index 153a2e0cecd..5fdef4f0458 100644 --- a/google-api-go-generator/testdata/json-body.want +++ b/google-api-go-generator/testdata/json-body.want @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2457,12 +2456,11 @@ func (c *ProjectsGetConfigCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2563,8 +2561,7 @@ func (c *ProjectsPredictCall) Header() http.Header { func (c *ProjectsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body = strings.NewReader(c.googlecloudmlv1__predictrequest.HttpBody.Data) + body := bytes.NewBufferString(c.googlecloudmlv1__predictrequest.HttpBody.Data) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:predict") @@ -2670,8 +2667,7 @@ func (c *ProjectsJobsCancelCall) Header() http.Header { func (c *ProjectsJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__canceljobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__canceljobrequest) if err != nil { return nil, err } @@ -2772,8 +2768,7 @@ func (c *ProjectsJobsCreateCall) Header() http.Header { func (c *ProjectsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__job) if err != nil { return nil, err } @@ -2884,12 +2879,11 @@ func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2997,12 +2991,11 @@ func (c *ProjectsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3146,12 +3139,11 @@ func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3298,8 +3290,7 @@ func (c *ProjectsJobsPatchCall) Header() http.Header { func (c *ProjectsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__job) if err != nil { return nil, err } @@ -3404,8 +3395,7 @@ func (c *ProjectsJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__setiampolicyrequest) if err != nil { return nil, err } @@ -3518,8 +3508,7 @@ func (c *ProjectsJobsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__testiampermissionsrequest) if err != nil { return nil, err } @@ -3632,12 +3621,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3765,12 +3753,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3890,8 +3877,7 @@ func (c *ProjectsModelsCreateCall) Header() http.Header { func (c *ProjectsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__model) if err != nil { return nil, err } @@ -3996,12 +3982,11 @@ func (c *ProjectsModelsDeleteCall) Header() http.Header { func (c *ProjectsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4107,12 +4092,11 @@ func (c *ProjectsModelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4220,12 +4204,11 @@ func (c *ProjectsModelsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4365,12 +4348,11 @@ func (c *ProjectsModelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4513,8 +4495,7 @@ func (c *ProjectsModelsPatchCall) Header() http.Header { func (c *ProjectsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__model) if err != nil { return nil, err } @@ -4619,8 +4600,7 @@ func (c *ProjectsModelsSetIamPolicyCall) Header() http.Header { func (c *ProjectsModelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__setiampolicyrequest) if err != nil { return nil, err } @@ -4733,8 +4713,7 @@ func (c *ProjectsModelsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsModelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__testiampermissionsrequest) if err != nil { return nil, err } @@ -4849,8 +4828,7 @@ func (c *ProjectsModelsVersionsCreateCall) Header() http.Header { func (c *ProjectsModelsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__version) if err != nil { return nil, err } @@ -4958,12 +4936,11 @@ func (c *ProjectsModelsVersionsDeleteCall) Header() http.Header { func (c *ProjectsModelsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5073,12 +5050,11 @@ func (c *ProjectsModelsVersionsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5216,12 +5192,11 @@ func (c *ProjectsModelsVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5360,8 +5335,7 @@ func (c *ProjectsModelsVersionsPatchCall) Header() http.Header { func (c *ProjectsModelsVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__version) if err != nil { return nil, err } @@ -5475,8 +5449,7 @@ func (c *ProjectsModelsVersionsSetDefaultCall) Header() http.Header { func (c *ProjectsModelsVersionsSetDefaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__setdefaultversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__setdefaultversionrequest) if err != nil { return nil, err } @@ -5587,12 +5560,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5689,12 +5661,11 @@ func (c *ProjectsOperationsDeleteCall) Header() http.Header { func (c *ProjectsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5801,12 +5772,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5942,12 +5912,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/mapofany.want b/google-api-go-generator/testdata/mapofany.want index f301cd52304..11820bfe0e4 100644 --- a/google-api-go-generator/testdata/mapofany.want +++ b/google-api-go-generator/testdata/mapofany.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/mapofarrayofobjects.want b/google-api-go-generator/testdata/mapofarrayofobjects.want index 9438d2e7fe2..cdf9d46d2da 100644 --- a/google-api-go-generator/testdata/mapofarrayofobjects.want +++ b/google-api-go-generator/testdata/mapofarrayofobjects.want @@ -99,7 +99,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Atlas = NewAtlasService(s) if err != nil { return nil, err } @@ -118,9 +119,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Atlas = NewAtlasService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -229,12 +228,11 @@ func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "map") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/mapofint64strings.want b/google-api-go-generator/testdata/mapofint64strings.want index 54883d21d81..ac08585d7c4 100644 --- a/google-api-go-generator/testdata/mapofint64strings.want +++ b/google-api-go-generator/testdata/mapofint64strings.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/mapofobjects.want b/google-api-go-generator/testdata/mapofobjects.want index edd7116578d..fa5492f4bec 100644 --- a/google-api-go-generator/testdata/mapofobjects.want +++ b/google-api-go-generator/testdata/mapofobjects.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/mapofstrings-1.want b/google-api-go-generator/testdata/mapofstrings-1.want index f2173014861..1ad1c5a3430 100644 --- a/google-api-go-generator/testdata/mapofstrings-1.want +++ b/google-api-go-generator/testdata/mapofstrings-1.want @@ -99,7 +99,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Atlas = NewAtlasService(s) if err != nil { return nil, err } @@ -118,9 +119,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Atlas = NewAtlasService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -226,12 +225,11 @@ func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "map") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/mapprotostruct.want b/google-api-go-generator/testdata/mapprotostruct.want index 74118a411a2..0bcbfbf0e22 100644 --- a/google-api-go-generator/testdata/mapprotostruct.want +++ b/google-api-go-generator/testdata/mapprotostruct.want @@ -99,7 +99,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Atlas = NewAtlasService(s) if err != nil { return nil, err } @@ -118,9 +119,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Atlas = NewAtlasService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -199,12 +198,11 @@ func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil protoBytes, err := json.Marshal(c.req) if err != nil { return nil, err } - body = bytes.NewReader(protoBytes) + body := bytes.NewReader(protoBytes) urls := googleapi.ResolveRelative(c.s.BasePath, "map") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) diff --git a/google-api-go-generator/testdata/mediaupload.json b/google-api-go-generator/testdata/mediaupload.json new file mode 100644 index 00000000000..d633615d87e --- /dev/null +++ b/google-api-go-generator/testdata/mediaupload.json @@ -0,0 +1,226 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/youtube": { + "description": "Manage your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.channel-memberships.creator": { + "description": "See a list of your current active channel members, their current level, and when they became a member" + }, + "https://www.googleapis.com/auth/youtube.force-ssl": { + "description": "See, edit, and permanently delete your YouTube videos, ratings, comments and captions" + }, + "https://www.googleapis.com/auth/youtube.readonly": { + "description": "View your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.upload": { + "description": "Manage your YouTube videos" + }, + "https://www.googleapis.com/auth/youtubepartner": { + "description": "View and manage your assets and associated content on YouTube" + }, + "https://www.googleapis.com/auth/youtubepartner-channel-audit": { + "description": "View private information of your YouTube channel relevant during the audit process with a YouTube partner" + } + } + } + }, + "basePath": "", + "baseUrl": "https://youtube.googleapis.com/", + "batchPath": "batch", + "canonicalName": "YouTube", + "description": "The YouTube Data API v3 is an API that provides access to YouTube data, such as videos, playlists, and channels.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/youtube/", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "youtube:v3", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://youtube.mtls.googleapis.com/", + "name": "youtube", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "revision": "20241203", + "rootUrl": "https://youtube.googleapis.com/", + "servicePath": "", + "title": "YouTube Data API v3", + "version": "v3", + "resources": { + "captions": { + "methods": { + "insert": { + "description": "Inserts a new resource into this collection.", + "flatPath": "youtube/v3/captions", + "httpMethod": "POST", + "id": "youtube.captions.insert", + "mediaUpload": { + "accept": [ + "text/xml", + "application/octet-stream", + "*/*" + ], + "maxSize": "104857600", + "protocols": { + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/captions" + }, + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/captions" + } + } + }, + "parameterOrder": [ + "part" + ], + "parameters": { + "onBehalfOf": { + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "location": "query", + "type": "string" + }, + "onBehalfOfContentOwner": { + "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query", + "type": "string" + }, + "part": { + "description": "The *part* parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.", + "location": "query", + "repeated": true, + "required": true, + "type": "string" + }, + "sync": { + "description": "Extra parameter to allow automatically syncing the uploaded caption/transcript with the audio.", + "location": "query", + "type": "boolean" + } + }, + "path": "youtube/v3/captions", + "request": { + "$ref": "Caption" + }, + "response": { + "$ref": "Caption" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true + } + } + } + }, + "schemas": { + "Caption": { + "description": "A *caption* resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.", + "id": "Caption", + "properties": { + "etag": { + "description": "Etag of this resource.", + "type": "string" + }, + "id": { + "annotations": { + "required": [ + "youtube.captions.update" + ] + }, + "description": "The ID that YouTube uses to uniquely identify the caption track.", + "type": "string" + }, + "kind": { + "default": "youtube#caption", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#caption\".", + "type": "string" + } + }, + "type": "object" + } + } +} diff --git a/google-api-go-generator/testdata/mediaupload.want b/google-api-go-generator/testdata/mediaupload.want new file mode 100644 index 00000000000..16f44cc1e64 --- /dev/null +++ b/google-api-go-generator/testdata/mediaupload.want @@ -0,0 +1,415 @@ +// Copyright YEAR Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package youtube provides access to the YouTube Data API v3. +// +// For product documentation, see: https://developers.google.com/youtube/ +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/youtube/v3" +// ... +// ctx := context.Background() +// youtubeService, err := youtube.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// By default, all available scopes (see "Constants") are used to authenticate. +// To restrict scopes, use [google.golang.org/api/option.WithScopes]: +// +// youtubeService, err := youtube.NewService(ctx, option.WithScopes(youtube.YoutubepartnerChannelAuditScope)) +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// youtubeService, err := youtube.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// youtubeService, err := youtube.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package youtube // import "google.golang.org/api/youtube/v3" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "youtube:v3" +const apiName = "youtube" +const apiVersion = "v3" +const basePath = "https://youtube.googleapis.com/" +const basePathTemplate = "https://youtube.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://youtube.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your YouTube account + YoutubeScope = "https://www.googleapis.com/auth/youtube" + + // See a list of your current active channel members, their current level, and + // when they became a member + YoutubeChannelMembershipsCreatorScope = "https://www.googleapis.com/auth/youtube.channel-memberships.creator" + + // See, edit, and permanently delete your YouTube videos, ratings, comments and + // captions + YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl" + + // View your YouTube account + YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly" + + // Manage your YouTube videos + YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload" + + // View and manage your assets and associated content on YouTube + YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner" + + // View private information of your YouTube channel relevant during the audit + // process with a YouTube partner + YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.channel-memberships.creator", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner", + "https://www.googleapis.com/auth/youtubepartner-channel-audit", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s := &Service{client: client, BasePath: basePath} + s.Captions = NewCaptionsService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Captions *CaptionsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewCaptionsService(s *Service) *CaptionsService { + rs := &CaptionsService{s: s} + return rs +} + +type CaptionsService struct { + s *Service +} + +// Caption: A *caption* resource represents a YouTube caption track. A caption +// track is associated with exactly one YouTube video. +type Caption struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + // Id: The ID that YouTube uses to uniquely identify the caption track. + Id string `json:"id,omitempty"` + // Kind: Identifies what kind of resource this is. Value: the fixed string + // "youtube#caption". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Etag") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s Caption) MarshalJSON() ([]byte, error) { + type NoMethod Caption + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type CaptionsInsertCall struct { + s *Service + caption *Caption + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a new resource into this collection. +// +// - part: The *part* parameter specifies the caption resource parts that the +// API response will include. Set the parameter value to snippet. +func (r *CaptionsService) Insert(part []string, caption *Caption) *CaptionsInsertCall { + c := &CaptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.urlParams_.SetMulti("part", append([]string{}, part...)) + c.caption = caption + return c +} + +// OnBehalfOf sets the optional parameter "onBehalfOf": ID of the Google+ Page +// for the channel that the request is be on behalf of +func (c *CaptionsInsertCall) OnBehalfOf(onBehalfOf string) *CaptionsInsertCall { + c.urlParams_.Set("onBehalfOf", onBehalfOf) + return c +} + +// OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner": +// *Note:* This parameter is intended exclusively for YouTube content partners. +// The *onBehalfOfContentOwner* parameter indicates that the request's +// authorization credentials identify a YouTube CMS user who is acting on +// behalf of the content owner specified in the parameter value. This parameter +// is intended for YouTube content partners that own and manage many different +// YouTube channels. It allows content owners to authenticate once and get +// access to all their video and channel data, without having to provide +// authentication credentials for each individual channel. The actual CMS +// account that the user authenticates with must be linked to the specified +// YouTube content owner. +func (c *CaptionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsInsertCall { + c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner) + return c +} + +// Sync sets the optional parameter "sync": Extra parameter to allow +// automatically syncing the uploaded caption/transcript with the audio. +func (c *CaptionsInsertCall) Sync(sync bool) *CaptionsInsertCall { + c.urlParams_.Set("sync", fmt.Sprint(sync)) + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk size +// may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload +// request will be determined by sniffing the contents of r, unless a +// MediaOption generated by googleapi.ContentType is supplied. +// At most one of Media and ResumableMedia may be set. +func (c *CaptionsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsInsertCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled +// with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType identifies the +// MIME media type of the upload, such as "image/png". If mediaType is "", it +// will be auto-detected. The provided ctx will supersede any context +// previously provided to the Context method. +func (c *CaptionsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsInsertCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called after every +// chunk. It should be a low-latency function in order to not slow down the +// upload operation. This should only be called when using ResumableMedia (as +// opposed to Media). +func (c *CaptionsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsInsertCall { + c.mediaInfo_.SetProgressUpdater(pu) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CaptionsInsertCall) Fields(s ...googleapi.Field) *CaptionsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *CaptionsInsertCall) Context(ctx context.Context) *CaptionsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CaptionsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.caption) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/captions") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, newBody) + if err != nil { + return nil, err + } + req.Header = reqHeaders + req.GetBody = getBody + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "youtube.captions.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *Caption.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CaptionsInsertCall) Do(opts ...googleapi.CallOption) (*Caption, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + } + ret := &Caption{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} diff --git a/google-api-go-generator/testdata/param-rename.want b/google-api-go-generator/testdata/param-rename.want index 745170b91a2..e72922fca83 100644 --- a/google-api-go-generator/testdata/param-rename.want +++ b/google-api-go-generator/testdata/param-rename.want @@ -99,7 +99,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Events = NewEventsService(s) + s.Reports = NewReportsService(s) if err != nil { return nil, err } @@ -118,10 +120,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Events = NewEventsService(s) - s.Reports = NewReportsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -214,12 +213,11 @@ func (c *EventsMoveCall) Header() http.Header { func (c *EventsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -321,12 +319,11 @@ func (c *ReportsQueryCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/quotednum.want b/google-api-go-generator/testdata/quotednum.want index 3cacb89a0bc..254bb3a0aaa 100644 --- a/google-api-go-generator/testdata/quotednum.want +++ b/google-api-go-generator/testdata/quotednum.want @@ -114,7 +114,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -133,8 +133,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/repeated.want b/google-api-go-generator/testdata/repeated.want index a56b2ec3e43..644b4dee0e4 100644 --- a/google-api-go-generator/testdata/repeated.want +++ b/google-api-go-generator/testdata/repeated.want @@ -99,7 +99,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -118,9 +119,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -248,12 +247,11 @@ func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/required-query.want b/google-api-go-generator/testdata/required-query.want index 2112fea886e..32e1a15afbf 100644 --- a/google-api-go-generator/testdata/required-query.want +++ b/google-api-go-generator/testdata/required-query.want @@ -99,7 +99,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Techs = NewTechsService(s) if err != nil { return nil, err } @@ -118,9 +119,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Techs = NewTechsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -225,12 +224,11 @@ func (c *TechsCountCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "techs/count") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/resource-named-service.want b/google-api-go-generator/testdata/resource-named-service.want index 6cd5bc0d683..a0dc977c75f 100644 --- a/google-api-go-generator/testdata/resource-named-service.want +++ b/google-api-go-generator/testdata/resource-named-service.want @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Apps = NewAppsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -1812,12 +1811,11 @@ func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1913,8 +1911,7 @@ func (c *AppsRepairCall) Header() http.Header { func (c *AppsRepairCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairapplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repairapplicationrequest) if err != nil { return nil, err } @@ -2027,12 +2024,11 @@ func (c *AppsLocationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/locations/{locationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2156,12 +2152,11 @@ func (c *AppsLocationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2290,12 +2285,11 @@ func (c *AppsOperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/operations/{operationsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2421,12 +2415,11 @@ func (c *AppsOperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2542,12 +2535,11 @@ func (c *AppsServicesDeleteCall) Header() http.Header { func (c *AppsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2654,12 +2646,11 @@ func (c *AppsServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2777,12 +2768,11 @@ func (c *AppsServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2926,8 +2916,7 @@ func (c *AppsServicesPatchCall) Header() http.Header { func (c *AppsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -3032,8 +3021,7 @@ func (c *AppsServicesVersionsCreateCall) Header() http.Header { func (c *AppsServicesVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -3139,12 +3127,11 @@ func (c *AppsServicesVersionsDeleteCall) Header() http.Header { func (c *AppsServicesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3269,12 +3256,11 @@ func (c *AppsServicesVersionsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3408,12 +3394,11 @@ func (c *AppsServicesVersionsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3556,8 +3541,7 @@ func (c *AppsServicesVersionsPatchCall) Header() http.Header { func (c *AppsServicesVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -3674,8 +3658,7 @@ func (c *AppsServicesVersionsInstancesDebugCall) Header() http.Header { func (c *AppsServicesVersionsInstancesDebugCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.debuginstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.debuginstancerequest) if err != nil { return nil, err } @@ -3786,12 +3769,11 @@ func (c *AppsServicesVersionsInstancesDeleteCall) Header() http.Header { func (c *AppsServicesVersionsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3906,12 +3888,11 @@ func (c *AppsServicesVersionsInstancesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4037,12 +4018,11 @@ func (c *AppsServicesVersionsInstancesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/google-api-go-generator/testdata/unfortunatedefaults.want b/google-api-go-generator/testdata/unfortunatedefaults.want index 5b0c7f666e4..3f45088093f 100644 --- a/google-api-go-generator/testdata/unfortunatedefaults.want +++ b/google-api-go-generator/testdata/unfortunatedefaults.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/variants.want b/google-api-go-generator/testdata/variants.want index bdb5c72f0a4..42bbd80a7ef 100644 --- a/google-api-go-generator/testdata/variants.want +++ b/google-api-go-generator/testdata/variants.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/google-api-go-generator/testdata/wrapnewlines.want b/google-api-go-generator/testdata/wrapnewlines.want index 4bc5d3b6e1f..bd8da6a041b 100644 --- a/google-api-go-generator/testdata/wrapnewlines.want +++ b/google-api-go-generator/testdata/wrapnewlines.want @@ -99,7 +99,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} if err != nil { return nil, err } @@ -118,8 +118,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { diff --git a/googleapi/googleapi.go b/googleapi/googleapi.go index 04a10f51c97..6818b2de304 100644 --- a/googleapi/googleapi.go +++ b/googleapi/googleapi.go @@ -200,7 +200,17 @@ var WithDataWrapper = MarshalStyle(true) // WithoutDataWrapper marshals JSON without a {"data": ...} wrapper. var WithoutDataWrapper = MarshalStyle(false) +// JSONReader is like JSONBuffer, but returns an io.Reader instead. func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) { + buf, err := wrap.JSONBuffer(v) + if err != nil { + return nil, err + } + return buf, nil +} + +// JSONBuffer encodes the body and wraps it if needed. +func (wrap MarshalStyle) JSONBuffer(v interface{}) (*bytes.Buffer, error) { buf := new(bytes.Buffer) if wrap { buf.Write([]byte(`{"data": `)) diff --git a/groupsmigration/v1/groupsmigration-gen.go b/groupsmigration/v1/groupsmigration-gen.go index c5f01faa8f9..64c81c0f410 100644 --- a/groupsmigration/v1/groupsmigration-gen.go +++ b/groupsmigration/v1/groupsmigration-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Archive = NewArchiveService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Archive = NewArchiveService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -269,8 +268,7 @@ func (c *ArchiveInsertCall) Header() http.Header { } func (c *ArchiveInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "groups/v1/groups/{groupId}/archive") @@ -278,14 +276,10 @@ func (c *ArchiveInsertCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/groups/v1/groups/{groupId}/archive") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/groupssettings/v1/groupssettings-gen.go b/groupssettings/v1/groupssettings-gen.go index e9c653666fe..70197d5579a 100644 --- a/groupssettings/v1/groupssettings-gen.go +++ b/groupssettings/v1/groupssettings-gen.go @@ -112,7 +112,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Groups = NewGroupsService(s) if err != nil { return nil, err } @@ -131,9 +132,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Groups = NewGroupsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -710,12 +709,11 @@ func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -807,8 +805,7 @@ func (c *GroupsPatchCall) Header() http.Header { func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groups) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groups) if err != nil { return nil, err } @@ -908,8 +905,7 @@ func (c *GroupsUpdateCall) Header() http.Header { func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groups) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groups) if err != nil { return nil, err } diff --git a/healthcare/v1/healthcare-gen.go b/healthcare/v1/healthcare-gen.go index b472d17e064..7cd5d3f70dc 100644 --- a/healthcare/v1/healthcare-gen.go +++ b/healthcare/v1/healthcare-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6455,12 +6454,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6586,12 +6584,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6717,8 +6714,7 @@ func (c *ProjectsLocationsDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -6827,8 +6823,7 @@ func (c *ProjectsLocationsDatasetsDeidentifyCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deidentifydatasetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deidentifydatasetrequest) if err != nil { return nil, err } @@ -6929,12 +6924,11 @@ func (c *ProjectsLocationsDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7037,12 +7031,11 @@ func (c *ProjectsLocationsDatasetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7164,12 +7157,11 @@ func (c *ProjectsLocationsDatasetsGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7286,12 +7278,11 @@ func (c *ProjectsLocationsDatasetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7414,8 +7405,7 @@ func (c *ProjectsLocationsDatasetsPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -7519,8 +7509,7 @@ func (c *ProjectsLocationsDatasetsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDatasetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7627,8 +7616,7 @@ func (c *ProjectsLocationsDatasetsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsDatasetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7733,8 +7721,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresCheckDataAccessCall) Header() htt func (c *ProjectsLocationsDatasetsConsentStoresCheckDataAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkdataaccessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkdataaccessrequest) if err != nil { return nil, err } @@ -7845,8 +7832,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresCreateCall) Header() http.Header func (c *ProjectsLocationsDatasetsConsentStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consentstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consentstore) if err != nil { return nil, err } @@ -7945,12 +7931,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresDeleteCall) Header() http.Header func (c *ProjectsLocationsDatasetsConsentStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8046,8 +8031,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresEvaluateUserConsentsCall) Header( func (c *ProjectsLocationsDatasetsConsentStoresEvaluateUserConsentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evaluateuserconsentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evaluateuserconsentsrequest) if err != nil { return nil, err } @@ -8179,12 +8163,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8306,12 +8289,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8436,12 +8418,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/consentStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8567,8 +8548,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsConsentStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consentstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consentstore) if err != nil { return nil, err } @@ -8694,8 +8674,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresQueryAccessibleDataCall) Header() func (c *ProjectsLocationsDatasetsConsentStoresQueryAccessibleDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryaccessibledatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryaccessibledatarequest) if err != nil { return nil, err } @@ -8799,8 +8778,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDatasetsConsentStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8907,8 +8885,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresTestIamPermissionsCall) Header() func (c *ProjectsLocationsDatasetsConsentStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9020,8 +8997,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsCreateCall) H func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributedefinition) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributedefinition) if err != nil { return nil, err } @@ -9124,12 +9100,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsDeleteCall) H func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9231,12 +9206,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9362,12 +9336,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attributeDefinitions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9495,8 +9468,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsPatchCall) He func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributedefinition) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributedefinition) if err != nil { return nil, err } @@ -9597,8 +9569,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsCreateCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consentartifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consentartifact) if err != nil { return nil, err } @@ -9700,12 +9671,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsDeleteCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9807,12 +9777,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9961,12 +9930,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/consentArtifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10087,8 +10055,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsActivateCall) Header() ht func (c *ProjectsLocationsDatasetsConsentStoresConsentsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activateconsentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activateconsentrequest) if err != nil { return nil, err } @@ -10188,8 +10155,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsCreateCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consent) if err != nil { return nil, err } @@ -10293,12 +10259,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10394,12 +10359,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteRevisionCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10507,12 +10471,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10662,12 +10625,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/consents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10839,12 +10801,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsListRevisionsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10974,8 +10935,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsPatchCall) Header() http. func (c *ProjectsLocationsDatasetsConsentStoresConsentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consent) if err != nil { return nil, err } @@ -11082,8 +11042,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsRejectCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsRejectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rejectconsentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rejectconsentrequest) if err != nil { return nil, err } @@ -11190,8 +11149,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsRevokeCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokeconsentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revokeconsentrequest) if err != nil { return nil, err } @@ -11291,8 +11249,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsArchiveCall) Head func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.archiveuserdatamappingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.archiveuserdatamappingrequest) if err != nil { return nil, err } @@ -11393,8 +11350,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsCreateCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdatamapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userdatamapping) if err != nil { return nil, err } @@ -11493,12 +11449,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsDeleteCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11600,12 +11555,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11752,12 +11706,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userDataMappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11883,8 +11836,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsPatchCall) Header func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdatamapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userdatamapping) if err != nil { return nil, err } @@ -12015,12 +11967,11 @@ func (c *ProjectsLocationsDatasetsDataMapperWorkspacesGetIamPolicyCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12116,8 +12067,7 @@ func (c *ProjectsLocationsDatasetsDataMapperWorkspacesSetIamPolicyCall) Header() func (c *ProjectsLocationsDatasetsDataMapperWorkspacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12224,8 +12174,7 @@ func (c *ProjectsLocationsDatasetsDataMapperWorkspacesTestIamPermissionsCall) He func (c *ProjectsLocationsDatasetsDataMapperWorkspacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12334,8 +12283,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dicomstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dicomstore) if err != nil { return nil, err } @@ -12445,8 +12393,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresDeidentifyCall) Header() http.Heade func (c *ProjectsLocationsDatasetsDicomStoresDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deidentifydicomstorerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deidentifydicomstorerequest) if err != nil { return nil, err } @@ -12545,12 +12492,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12649,8 +12595,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportdicomdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportdicomdatarequest) if err != nil { return nil, err } @@ -12760,12 +12705,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12867,12 +12811,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresGetDICOMStoreMetricsCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getDICOMStoreMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12995,12 +12938,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13099,8 +13041,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdicomdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdicomdatarequest) if err != nil { return nil, err } @@ -13253,12 +13194,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13382,8 +13322,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dicomstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dicomstore) if err != nil { return nil, err } @@ -13508,12 +13447,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresSearchForInstancesCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13598,12 +13536,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresSearchForSeriesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13689,12 +13626,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresSearchForStudiesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13768,8 +13704,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresSetBlobStorageSettingsCall) Header( func (c *ProjectsLocationsDatasetsDicomStoresSetBlobStorageSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setblobstoragesettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setblobstoragesettingsrequest) if err != nil { return nil, err } @@ -13873,8 +13808,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsDatasetsDicomStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13987,8 +13921,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStoreInstancesCall) Header() http.H func (c *ProjectsLocationsDatasetsDicomStoresStoreInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -14060,8 +13997,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsDatasetsDicomStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -14174,12 +14110,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesGetStudyMetricsCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+study}:getStudyMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14283,8 +14218,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSetBlobStorageSettin func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSetBlobStorageSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setblobstoragesettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setblobstoragesettingsrequest) if err != nil { return nil, err } @@ -14396,12 +14330,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSeriesGetSeriesMetri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+series}:getSeriesMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14508,12 +14441,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSeriesInstancesGetSt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getStorageInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14614,12 +14546,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesDeleteCall) Header() http.He func (c *ProjectsLocationsDatasetsDicomStoresStudiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14737,12 +14668,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesRetrieveMetadataCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14828,12 +14758,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesRetrieveStudyCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14920,12 +14849,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSearchForInstancesCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15010,12 +14938,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSearchForSeriesCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15090,8 +15017,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesStoreInstancesCall) Header() func (c *ProjectsLocationsDatasetsDicomStoresStudiesStoreInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -15167,12 +15097,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesDeleteCall) Header() h func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15290,12 +15219,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesRetrieveMetadataCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15381,12 +15309,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesRetrieveSeriesCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15473,12 +15400,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesSearchForInstancesCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15550,12 +15476,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesDeleteCall) H func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15675,12 +15600,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesRetrieveInsta if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15769,12 +15693,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesRetrieveMetad if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15863,12 +15786,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesRetrieveRende if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15955,12 +15877,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesFramesRetriev if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16049,12 +15970,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesFramesRetriev if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16357,8 +16277,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fhirstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fhirstore) if err != nil { return nil, err } @@ -16465,8 +16384,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresDeidentifyCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deidentifyfhirstorerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deidentifyfhirstorerequest) if err != nil { return nil, err } @@ -16565,12 +16483,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16789,8 +16706,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportresourcesrequest) if err != nil { return nil, err } @@ -16900,12 +16816,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17007,12 +16922,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getFHIRStoreMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17135,12 +17049,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17289,8 +17202,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importresourcesrequest) if err != nil { return nil, err } @@ -17443,12 +17355,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhirStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17573,8 +17484,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fhirstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fhirstore) if err != nil { return nil, err } @@ -17683,8 +17593,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresRollbackCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfhirresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackfhirresourcesrequest) if err != nil { return nil, err } @@ -17788,8 +17697,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsDatasetsFhirStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -17896,8 +17804,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsDatasetsFhirStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -18028,8 +17935,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryCreateCall) Header() http. func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir/Binary") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -18111,12 +18021,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryReadCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18211,8 +18120,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryUpdateCall) Header() http. func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) @@ -18294,12 +18206,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryVreadCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18632,12 +18543,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirPatientEverythingCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/$everything") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18701,12 +18611,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourcePurgeCall) Header() http func (c *ProjectsLocationsDatasetsFhirStoresFhirResourcePurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/$purge") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18834,8 +18743,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) Header() h func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir/{+type}/$validate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -18923,12 +18835,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirCapabilitiesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/fhir/metadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19006,12 +18917,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalDeleteCall) Header() func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19129,8 +19039,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalPatchCall) Header() h func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) @@ -19228,8 +19141,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalUpdateCall) Header() func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) @@ -19327,8 +19243,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirCreateCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -19401,12 +19320,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirDeleteCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19502,8 +19420,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirExecuteBundleCall) Header() http func (c *ProjectsLocationsDatasetsFhirStoresFhirExecuteBundleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fhir") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -19630,12 +19551,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirHistoryCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/_history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19711,8 +19631,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirPatchCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) @@ -19802,12 +19725,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirReadCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19935,8 +19857,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchresourcesrequest) if err != nil { return nil, err } @@ -20079,8 +20000,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchTypeCall) Header() http.He func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchresourcesrequest) if err != nil { return nil, err } @@ -20171,8 +20091,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirUpdateCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) @@ -20257,12 +20180,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirVreadCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20331,8 +20253,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hl7v2store) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hl7v2store) if err != nil { return nil, err } @@ -20431,12 +20352,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20536,8 +20456,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportmessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportmessagesrequest) if err != nil { return nil, err } @@ -20647,12 +20566,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20757,12 +20675,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresGetHL7v2StoreMetricsCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getHL7v2StoreMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20885,12 +20802,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21008,8 +20924,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importmessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importmessagesrequest) if err != nil { return nil, err } @@ -21162,12 +21077,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/hl7V2Stores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21291,8 +21205,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hl7v2store) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hl7v2store) if err != nil { return nil, err } @@ -21401,8 +21314,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresRollbackCall) Header() http.Header func (c *ProjectsLocationsDatasetsHl7V2StoresRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackhl7v2messagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackhl7v2messagesrequest) if err != nil { return nil, err } @@ -21506,8 +21418,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsDatasetsHl7V2StoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -21614,8 +21525,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsDatasetsHl7V2StoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -21720,8 +21630,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesCreateCall) Header() http.H func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createmessagerequest) if err != nil { return nil, err } @@ -21819,12 +21728,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesDeleteCall) Header() http.H func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21952,12 +21860,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22057,8 +21964,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesIngestCall) Header() http.H func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesIngestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ingestmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ingestmessagerequest) if err != nil { return nil, err } @@ -22267,12 +22173,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22400,8 +22305,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesPatchCall) Header() http.He func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -22509,8 +22413,7 @@ func (c *ProjectsLocationsDatasetsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -22622,12 +22525,11 @@ func (c *ProjectsLocationsDatasetsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22750,12 +22652,11 @@ func (c *ProjectsLocationsDatasetsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22872,8 +22773,7 @@ func (c *ProjectsLocationsServicesNlpAnalyzeEntitiesCall) Header() http.Header { func (c *ProjectsLocationsServicesNlpAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitiesrequest) if err != nil { return nil, err } diff --git a/healthcare/v1beta1/healthcare-gen.go b/healthcare/v1beta1/healthcare-gen.go index 3e88f4ccdc5..57d1763188a 100644 --- a/healthcare/v1beta1/healthcare-gen.go +++ b/healthcare/v1beta1/healthcare-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7927,12 +7926,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8058,12 +8056,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8189,8 +8186,7 @@ func (c *ProjectsLocationsDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -8299,8 +8295,7 @@ func (c *ProjectsLocationsDatasetsDeidentifyCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deidentifydatasetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deidentifydatasetrequest) if err != nil { return nil, err } @@ -8401,12 +8396,11 @@ func (c *ProjectsLocationsDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8509,12 +8503,11 @@ func (c *ProjectsLocationsDatasetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8636,12 +8629,11 @@ func (c *ProjectsLocationsDatasetsGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8758,12 +8750,11 @@ func (c *ProjectsLocationsDatasetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8886,8 +8877,7 @@ func (c *ProjectsLocationsDatasetsPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -8991,8 +8981,7 @@ func (c *ProjectsLocationsDatasetsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsDatasetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9099,8 +9088,7 @@ func (c *ProjectsLocationsDatasetsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsDatasetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9209,8 +9197,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresCreateCall) Header() http.Head func (c *ProjectsLocationsDatasetsAnnotationStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotationstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotationstore) if err != nil { return nil, err } @@ -9310,12 +9297,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresDeleteCall) Header() http.Head func (c *ProjectsLocationsDatasetsAnnotationStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9415,8 +9401,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresEvaluateCall) Header() http.He func (c *ProjectsLocationsDatasetsAnnotationStoresEvaluateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evaluateannotationstorerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evaluateannotationstorerequest) if err != nil { return nil, err } @@ -9524,8 +9509,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresExportCall) Header() http.Head func (c *ProjectsLocationsDatasetsAnnotationStoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportannotationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportannotationsrequest) if err != nil { return nil, err } @@ -9636,12 +9620,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9764,12 +9747,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresGetIamPolicyCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9870,8 +9852,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresImportCall) Header() http.Head func (c *ProjectsLocationsDatasetsAnnotationStoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importannotationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importannotationsrequest) if err != nil { return nil, err } @@ -10024,12 +10005,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/annotationStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10153,8 +10133,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresPatchCall) Header() http.Heade func (c *ProjectsLocationsDatasetsAnnotationStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotationstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotationstore) if err != nil { return nil, err } @@ -10259,8 +10238,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresSetIamPolicyCall) Header() htt func (c *ProjectsLocationsDatasetsAnnotationStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10367,8 +10345,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresTestIamPermissionsCall) Header func (c *ProjectsLocationsDatasetsAnnotationStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10474,8 +10451,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsCreateCall) Header( func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotation) if err != nil { return nil, err } @@ -10573,12 +10549,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsDeleteCall) Header( func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10680,12 +10655,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10833,12 +10807,11 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/annotations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10962,8 +10935,7 @@ func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsPatchCall) Header() func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotation) if err != nil { return nil, err } @@ -11067,8 +11039,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresCheckDataAccessCall) Header() htt func (c *ProjectsLocationsDatasetsConsentStoresCheckDataAccessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkdataaccessrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkdataaccessrequest) if err != nil { return nil, err } @@ -11179,8 +11150,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresCreateCall) Header() http.Header func (c *ProjectsLocationsDatasetsConsentStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consentstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consentstore) if err != nil { return nil, err } @@ -11279,12 +11249,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresDeleteCall) Header() http.Header func (c *ProjectsLocationsDatasetsConsentStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11380,8 +11349,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresEvaluateUserConsentsCall) Header( func (c *ProjectsLocationsDatasetsConsentStoresEvaluateUserConsentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evaluateuserconsentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evaluateuserconsentsrequest) if err != nil { return nil, err } @@ -11513,12 +11481,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11640,12 +11607,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11791,12 +11757,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consentStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11922,8 +11887,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsConsentStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consentstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consentstore) if err != nil { return nil, err } @@ -12049,8 +12013,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresQueryAccessibleDataCall) Header() func (c *ProjectsLocationsDatasetsConsentStoresQueryAccessibleDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryaccessibledatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryaccessibledatarequest) if err != nil { return nil, err } @@ -12154,8 +12117,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsDatasetsConsentStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12262,8 +12224,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresTestIamPermissionsCall) Header() func (c *ProjectsLocationsDatasetsConsentStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12375,8 +12336,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsCreateCall) H func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributedefinition) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributedefinition) if err != nil { return nil, err } @@ -12479,12 +12439,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsDeleteCall) H func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12586,12 +12545,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12738,12 +12696,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/attributeDefinitions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12871,8 +12828,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsPatchCall) He func (c *ProjectsLocationsDatasetsConsentStoresAttributeDefinitionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributedefinition) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributedefinition) if err != nil { return nil, err } @@ -12973,8 +12929,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsCreateCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consentartifact) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consentartifact) if err != nil { return nil, err } @@ -13076,12 +13031,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsDeleteCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13183,12 +13137,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13337,12 +13290,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentArtifactsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consentArtifacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13463,8 +13415,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsActivateCall) Header() ht func (c *ProjectsLocationsDatasetsConsentStoresConsentsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activateconsentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activateconsentrequest) if err != nil { return nil, err } @@ -13564,8 +13515,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsCreateCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consent) if err != nil { return nil, err } @@ -13669,12 +13619,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13770,12 +13719,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteRevisionCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresConsentsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:deleteRevision") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13883,12 +13831,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14038,12 +13985,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14215,12 +14161,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsListRevisionsCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14350,8 +14295,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsPatchCall) Header() http. func (c *ProjectsLocationsDatasetsConsentStoresConsentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.consent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.consent) if err != nil { return nil, err } @@ -14458,8 +14402,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsRejectCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsRejectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rejectconsentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rejectconsentrequest) if err != nil { return nil, err } @@ -14566,8 +14509,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresConsentsRevokeCall) Header() http func (c *ProjectsLocationsDatasetsConsentStoresConsentsRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokeconsentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revokeconsentrequest) if err != nil { return nil, err } @@ -14667,8 +14609,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsArchiveCall) Head func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.archiveuserdatamappingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.archiveuserdatamappingrequest) if err != nil { return nil, err } @@ -14769,8 +14710,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsCreateCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdatamapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userdatamapping) if err != nil { return nil, err } @@ -14869,12 +14809,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsDeleteCall) Heade func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14976,12 +14915,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15128,12 +15066,11 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userDataMappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15259,8 +15196,7 @@ func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsPatchCall) Header func (c *ProjectsLocationsDatasetsConsentStoresUserDataMappingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdatamapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userdatamapping) if err != nil { return nil, err } @@ -15391,12 +15327,11 @@ func (c *ProjectsLocationsDatasetsDataMapperWorkspacesGetIamPolicyCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15492,8 +15427,7 @@ func (c *ProjectsLocationsDatasetsDataMapperWorkspacesSetIamPolicyCall) Header() func (c *ProjectsLocationsDatasetsDataMapperWorkspacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -15600,8 +15534,7 @@ func (c *ProjectsLocationsDatasetsDataMapperWorkspacesTestIamPermissionsCall) He func (c *ProjectsLocationsDatasetsDataMapperWorkspacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -15710,8 +15643,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dicomstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dicomstore) if err != nil { return nil, err } @@ -15821,8 +15753,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresDeidentifyCall) Header() http.Heade func (c *ProjectsLocationsDatasetsDicomStoresDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deidentifydicomstorerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deidentifydicomstorerequest) if err != nil { return nil, err } @@ -15921,12 +15852,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16025,8 +15955,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportdicomdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportdicomdatarequest) if err != nil { return nil, err } @@ -16136,12 +16065,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16243,12 +16171,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresGetDICOMStoreMetricsCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:getDICOMStoreMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16371,12 +16298,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16475,8 +16401,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdicomdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdicomdatarequest) if err != nil { return nil, err } @@ -16629,12 +16554,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16758,8 +16682,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDicomStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dicomstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dicomstore) if err != nil { return nil, err } @@ -16884,12 +16807,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresSearchForInstancesCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16974,12 +16896,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresSearchForSeriesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17065,12 +16986,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresSearchForStudiesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17144,8 +17064,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresSetBlobStorageSettingsCall) Header( func (c *ProjectsLocationsDatasetsDicomStoresSetBlobStorageSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setblobstoragesettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setblobstoragesettingsrequest) if err != nil { return nil, err } @@ -17249,8 +17168,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsDatasetsDicomStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -17363,8 +17281,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStoreInstancesCall) Header() http.H func (c *ProjectsLocationsDatasetsDicomStoresStoreInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -17436,8 +17357,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsDatasetsDicomStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -17550,12 +17470,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesGetStudyMetricsCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+study}:getStudyMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17659,8 +17578,7 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSetBlobStorageSettin func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSetBlobStorageSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setblobstoragesettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setblobstoragesettingsrequest) if err != nil { return nil, err } @@ -17772,12 +17690,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSeriesGetSeriesMetri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+series}:getSeriesMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17884,12 +17801,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresDicomWebStudiesSeriesInstancesGetSt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getStorageInfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17989,12 +17905,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesDeleteCall) Header() http.He func (c *ProjectsLocationsDatasetsDicomStoresStudiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18112,12 +18027,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesRetrieveMetadataCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18203,12 +18117,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesRetrieveStudyCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18295,12 +18208,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSearchForInstancesCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18385,12 +18297,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSearchForSeriesCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18465,8 +18376,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesStoreInstancesCall) Header() func (c *ProjectsLocationsDatasetsDicomStoresStudiesStoreInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -18541,12 +18455,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesDeleteCall) Header() h func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18664,12 +18577,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesRetrieveMetadataCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18755,12 +18667,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesRetrieveSeriesCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18847,12 +18758,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesSearchForInstancesCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18924,12 +18834,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesDeleteCall) H func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19049,12 +18958,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesRetrieveInsta if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19143,12 +19051,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesRetrieveMetad if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19237,12 +19144,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesRetrieveRende if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19330,12 +19236,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesBulkdataRetri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19422,12 +19327,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesFramesRetriev if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19516,12 +19420,11 @@ func (c *ProjectsLocationsDatasetsDicomStoresStudiesSeriesInstancesFramesRetriev if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19600,8 +19503,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresApplyAdminConsentsCall) Header() htt func (c *ProjectsLocationsDatasetsFhirStoresApplyAdminConsentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applyadminconsentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applyadminconsentsrequest) if err != nil { return nil, err } @@ -19715,8 +19617,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresApplyConsentsCall) Header() http.Hea func (c *ProjectsLocationsDatasetsFhirStoresApplyConsentsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applyconsentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applyconsentsrequest) if err != nil { return nil, err } @@ -19824,8 +19725,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresConfigureSearchCall) Header() http.H func (c *ProjectsLocationsDatasetsFhirStoresConfigureSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuresearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.configuresearchrequest) if err != nil { return nil, err } @@ -19933,8 +19833,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fhirstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fhirstore) if err != nil { return nil, err } @@ -20042,8 +19941,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresDeidentifyCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresDeidentifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deidentifyfhirstorerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deidentifyfhirstorerequest) if err != nil { return nil, err } @@ -20142,12 +20040,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20259,12 +20156,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresExplainDataAccessCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:explainDataAccess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20366,8 +20262,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportresourcesrequest) if err != nil { return nil, err } @@ -20478,8 +20373,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresExportHistoryCall) Header() http.Hea func (c *ProjectsLocationsDatasetsFhirStoresExportHistoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportresourceshistoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportresourceshistoryrequest) if err != nil { return nil, err } @@ -20589,12 +20483,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20696,12 +20589,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:getFHIRStoreMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20824,12 +20716,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetIamPolicyCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20978,8 +20869,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importresourcesrequest) if err != nil { return nil, err } @@ -21091,8 +20981,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresImportHistoryCall) Header() http.Hea func (c *ProjectsLocationsDatasetsFhirStoresImportHistoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importresourceshistoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importresourceshistoryrequest) if err != nil { return nil, err } @@ -21245,12 +21134,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhirStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21375,8 +21263,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fhirstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fhirstore) if err != nil { return nil, err } @@ -21485,8 +21372,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresRollbackCall) Header() http.Header { func (c *ProjectsLocationsDatasetsFhirStoresRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfhirresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackfhirresourcesrequest) if err != nil { return nil, err } @@ -21590,8 +21476,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsDatasetsFhirStoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -21698,8 +21583,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsDatasetsFhirStoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -21830,8 +21714,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryCreateCall) Header() http. func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/Binary") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -21913,12 +21800,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryReadCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22013,8 +21899,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryUpdateCall) Header() http. func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) @@ -22096,12 +21985,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirBinaryVreadCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22226,12 +22114,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConceptMapSearchTranslateCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/ConceptMap/$translate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22335,12 +22222,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConceptMapTranslateCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/$translate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22417,12 +22303,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConsentEnforcementStatusCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/$consent-enforcement-status") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22557,12 +22442,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirEncounterEverythingCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/$everything") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22657,12 +22541,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirObservationLastnCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/Observation/$lastn") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22758,12 +22641,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirPatientConsentEnforcementStatusC if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/$consent-enforcement-status") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22913,12 +22795,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirPatientEverythingCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/$everything") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23042,12 +22923,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceIncomingReferencesCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/$references") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23111,12 +22991,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourcePurgeCall) Header() http func (c *ProjectsLocationsDatasetsFhirStoresFhirResourcePurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/$purge") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23244,8 +23123,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) Header() h func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/{+type}/$validate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -23333,12 +23215,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirCapabilitiesCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/fhir/metadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23425,12 +23306,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalDeleteCall) Header() func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23551,8 +23431,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalPatchCall) Header() h func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) @@ -23654,8 +23537,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalUpdateCall) Header() func (c *ProjectsLocationsDatasetsFhirStoresFhirConditionalUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) @@ -23749,8 +23635,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirCreateCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir/{+type}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -23823,12 +23712,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirDeleteCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23926,8 +23814,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirExecuteBundleCall) Header() http func (c *ProjectsLocationsDatasetsFhirStoresFhirExecuteBundleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/fhir") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) @@ -24054,12 +23945,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirHistoryCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/_history") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24135,8 +24025,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirPatchCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) @@ -24226,12 +24119,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirReadCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24359,8 +24251,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchresourcesrequest) if err != nil { return nil, err } @@ -24503,8 +24394,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchTypeCall) Header() http.He func (c *ProjectsLocationsDatasetsFhirStoresFhirSearchTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchresourcesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchresourcesrequest) if err != nil { return nil, err } @@ -24595,8 +24485,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirUpdateCall) Header() http.Header func (c *ProjectsLocationsDatasetsFhirStoresFhirUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - body = c.body_ + body := bytes.NewBuffer(nil) + _, err := body.ReadFrom(c.body_) + if err != nil { + return nil, err + } urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) @@ -24681,12 +24574,11 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirVreadCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24755,8 +24647,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hl7v2store) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hl7v2store) if err != nil { return nil, err } @@ -24855,12 +24746,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24960,8 +24850,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresExportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportmessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportmessagesrequest) if err != nil { return nil, err } @@ -25071,12 +24960,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25181,12 +25069,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresGetHL7v2StoreMetricsCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:getHL7v2StoreMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25309,12 +25196,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresGetIamPolicyCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25432,8 +25318,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresImportCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importmessagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importmessagesrequest) if err != nil { return nil, err } @@ -25586,12 +25471,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/hl7V2Stores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25715,8 +25599,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresPatchCall) Header() http.Header { func (c *ProjectsLocationsDatasetsHl7V2StoresPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hl7v2store) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hl7v2store) if err != nil { return nil, err } @@ -25825,8 +25708,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresRollbackCall) Header() http.Header func (c *ProjectsLocationsDatasetsHl7V2StoresRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackhl7v2messagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackhl7v2messagesrequest) if err != nil { return nil, err } @@ -25930,8 +25812,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsDatasetsHl7V2StoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -26038,8 +25919,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsDatasetsHl7V2StoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -26189,12 +26069,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesBatchGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/messages:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26291,8 +26170,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesCreateCall) Header() http.H func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createmessagerequest) if err != nil { return nil, err } @@ -26390,12 +26268,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesDeleteCall) Header() http.H func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26526,12 +26403,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26631,8 +26507,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesIngestCall) Header() http.H func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesIngestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ingestmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ingestmessagerequest) if err != nil { return nil, err } @@ -26844,12 +26719,11 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26977,8 +26851,7 @@ func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesPatchCall) Header() http.He func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.message) if err != nil { return nil, err } @@ -27086,8 +26959,7 @@ func (c *ProjectsLocationsDatasetsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsDatasetsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -27199,12 +27071,11 @@ func (c *ProjectsLocationsDatasetsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27327,12 +27198,11 @@ func (c *ProjectsLocationsDatasetsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27450,8 +27320,7 @@ func (c *ProjectsLocationsServicesNlpAnalyzeEntitiesCall) Header() http.Header { func (c *ProjectsLocationsServicesNlpAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitiesrequest) if err != nil { return nil, err } diff --git a/homegraph/v1/homegraph-gen.go b/homegraph/v1/homegraph-gen.go index 140ff669b6e..713ffb61687 100644 --- a/homegraph/v1/homegraph-gen.go +++ b/homegraph/v1/homegraph-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AgentUsers = NewAgentUsersService(s) + s.Devices = NewDevicesService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AgentUsers = NewAgentUsersService(s) - s.Devices = NewDevicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -770,12 +769,11 @@ func (c *AgentUsersDeleteCall) Header() http.Header { func (c *AgentUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+agentUserId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -866,8 +864,7 @@ func (c *DevicesQueryCall) Header() http.Header { func (c *DevicesQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryrequest) if err != nil { return nil, err } @@ -972,8 +969,7 @@ func (c *DevicesReportStateAndNotificationCall) Header() http.Header { func (c *DevicesReportStateAndNotificationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportstateandnotificationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportstateandnotificationrequest) if err != nil { return nil, err } @@ -1072,8 +1068,7 @@ func (c *DevicesRequestSyncCall) Header() http.Header { func (c *DevicesRequestSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.requestsyncdevicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.requestsyncdevicesrequest) if err != nil { return nil, err } @@ -1170,8 +1165,7 @@ func (c *DevicesSyncCall) Header() http.Header { func (c *DevicesSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.syncrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.syncrequest) if err != nil { return nil, err } diff --git a/iam/v1/iam-gen.go b/iam/v1/iam-gen.go index 8d3d42ea281..069ea9923ac 100644 --- a/iam/v1/iam-gen.go +++ b/iam/v1/iam-gen.go @@ -115,7 +115,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.IamPolicies = NewIamPoliciesService(s) + s.Locations = NewLocationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Permissions = NewPermissionsService(s) + s.Projects = NewProjectsService(s) + s.Roles = NewRolesService(s) if err != nil { return nil, err } @@ -134,14 +140,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.IamPolicies = NewIamPoliciesService(s) - s.Locations = NewLocationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Permissions = NewPermissionsService(s) - s.Projects = NewProjectsService(s) - s.Roles = NewRolesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3725,8 +3724,7 @@ func (c *IamPoliciesLintPolicyCall) Header() http.Header { func (c *IamPoliciesLintPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lintpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lintpolicyrequest) if err != nil { return nil, err } @@ -3823,8 +3821,7 @@ func (c *IamPoliciesQueryAuditableServicesCall) Header() http.Header { func (c *IamPoliciesQueryAuditableServicesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryauditableservicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryauditableservicesrequest) if err != nil { return nil, err } @@ -3934,8 +3931,7 @@ func (c *LocationsWorkforcePoolsCreateCall) Header() http.Header { func (c *LocationsWorkforcePoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workforcepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workforcepool) if err != nil { return nil, err } @@ -4041,12 +4037,11 @@ func (c *LocationsWorkforcePoolsDeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4149,12 +4144,11 @@ func (c *LocationsWorkforcePoolsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4248,8 +4242,7 @@ func (c *LocationsWorkforcePoolsGetIamPolicyCall) Header() http.Header { func (c *LocationsWorkforcePoolsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -4390,12 +4383,11 @@ func (c *LocationsWorkforcePoolsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/workforcePools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4517,8 +4509,7 @@ func (c *LocationsWorkforcePoolsPatchCall) Header() http.Header { func (c *LocationsWorkforcePoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workforcepool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workforcepool) if err != nil { return nil, err } @@ -4620,8 +4611,7 @@ func (c *LocationsWorkforcePoolsSetIamPolicyCall) Header() http.Header { func (c *LocationsWorkforcePoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4726,8 +4716,7 @@ func (c *LocationsWorkforcePoolsTestIamPermissionsCall) Header() http.Header { func (c *LocationsWorkforcePoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4830,8 +4819,7 @@ func (c *LocationsWorkforcePoolsUndeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkforcepoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkforcepoolrequest) if err != nil { return nil, err } @@ -4943,12 +4931,11 @@ func (c *LocationsWorkforcePoolsOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5052,8 +5039,7 @@ func (c *LocationsWorkforcePoolsProvidersCreateCall) Header() http.Header { func (c *LocationsWorkforcePoolsProvidersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workforcepoolprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workforcepoolprovider) if err != nil { return nil, err } @@ -5157,12 +5143,11 @@ func (c *LocationsWorkforcePoolsProvidersDeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsProvidersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5266,12 +5251,11 @@ func (c *LocationsWorkforcePoolsProvidersGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5399,12 +5383,11 @@ func (c *LocationsWorkforcePoolsProvidersListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/providers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5527,8 +5510,7 @@ func (c *LocationsWorkforcePoolsProvidersPatchCall) Header() http.Header { func (c *LocationsWorkforcePoolsProvidersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workforcepoolprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workforcepoolprovider) if err != nil { return nil, err } @@ -5631,8 +5613,7 @@ func (c *LocationsWorkforcePoolsProvidersUndeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsProvidersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkforcepoolproviderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkforcepoolproviderrequest) if err != nil { return nil, err } @@ -5741,8 +5722,7 @@ func (c *LocationsWorkforcePoolsProvidersKeysCreateCall) Header() http.Header { func (c *LocationsWorkforcePoolsProvidersKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workforcepoolproviderkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workforcepoolproviderkey) if err != nil { return nil, err } @@ -5841,12 +5821,11 @@ func (c *LocationsWorkforcePoolsProvidersKeysDeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsProvidersKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5948,12 +5927,11 @@ func (c *LocationsWorkforcePoolsProvidersKeysGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6083,12 +6061,11 @@ func (c *LocationsWorkforcePoolsProvidersKeysListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6203,8 +6180,7 @@ func (c *LocationsWorkforcePoolsProvidersKeysUndeleteCall) Header() http.Header func (c *LocationsWorkforcePoolsProvidersKeysUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkforcepoolproviderkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkforcepoolproviderkeyrequest) if err != nil { return nil, err } @@ -6316,12 +6292,11 @@ func (c *LocationsWorkforcePoolsProvidersKeysOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6425,12 +6400,11 @@ func (c *LocationsWorkforcePoolsProvidersOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6537,12 +6511,11 @@ func (c *LocationsWorkforcePoolsSubjectsDeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsSubjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6640,8 +6613,7 @@ func (c *LocationsWorkforcePoolsSubjectsUndeleteCall) Header() http.Header { func (c *LocationsWorkforcePoolsSubjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkforcepoolsubjectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkforcepoolsubjectrequest) if err != nil { return nil, err } @@ -6753,12 +6725,11 @@ func (c *LocationsWorkforcePoolsSubjectsOperationsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6869,8 +6840,7 @@ func (c *OrganizationsRolesCreateCall) Header() http.Header { func (c *OrganizationsRolesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createrolerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createrolerequest) if err != nil { return nil, err } @@ -7006,12 +6976,11 @@ func (c *OrganizationsRolesDeleteCall) Header() http.Header { func (c *OrganizationsRolesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7139,12 +7108,11 @@ func (c *OrganizationsRolesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7312,12 +7280,11 @@ func (c *OrganizationsRolesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/roles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7459,8 +7426,7 @@ func (c *OrganizationsRolesPatchCall) Header() http.Header { func (c *OrganizationsRolesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.role) if err != nil { return nil, err } @@ -7581,8 +7547,7 @@ func (c *OrganizationsRolesUndeleteCall) Header() http.Header { func (c *OrganizationsRolesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleterolerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleterolerequest) if err != nil { return nil, err } @@ -7680,8 +7645,7 @@ func (c *PermissionsQueryTestablePermissionsCall) Header() http.Header { func (c *PermissionsQueryTestablePermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querytestablepermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querytestablepermissionsrequest) if err != nil { return nil, err } @@ -7813,8 +7777,7 @@ func (c *ProjectsLocationsOauthClientsCreateCall) Header() http.Header { func (c *ProjectsLocationsOauthClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.oauthclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.oauthclient) if err != nil { return nil, err } @@ -7920,12 +7883,11 @@ func (c *ProjectsLocationsOauthClientsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOauthClientsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8028,12 +7990,11 @@ func (c *ProjectsLocationsOauthClientsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8159,12 +8120,11 @@ func (c *ProjectsLocationsOauthClientsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/oauthClients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8287,8 +8247,7 @@ func (c *ProjectsLocationsOauthClientsPatchCall) Header() http.Header { func (c *ProjectsLocationsOauthClientsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.oauthclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.oauthclient) if err != nil { return nil, err } @@ -8390,8 +8349,7 @@ func (c *ProjectsLocationsOauthClientsUndeleteCall) Header() http.Header { func (c *ProjectsLocationsOauthClientsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteoauthclientrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteoauthclientrequest) if err != nil { return nil, err } @@ -8502,8 +8460,7 @@ func (c *ProjectsLocationsOauthClientsCredentialsCreateCall) Header() http.Heade func (c *ProjectsLocationsOauthClientsCredentialsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.oauthclientcredential) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.oauthclientcredential) if err != nil { return nil, err } @@ -8605,12 +8562,11 @@ func (c *ProjectsLocationsOauthClientsCredentialsDeleteCall) Header() http.Heade func (c *ProjectsLocationsOauthClientsCredentialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8714,12 +8670,11 @@ func (c *ProjectsLocationsOauthClientsCredentialsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8822,12 +8777,11 @@ func (c *ProjectsLocationsOauthClientsCredentialsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/credentials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8930,8 +8884,7 @@ func (c *ProjectsLocationsOauthClientsCredentialsPatchCall) Header() http.Header func (c *ProjectsLocationsOauthClientsCredentialsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.oauthclientcredential) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.oauthclientcredential) if err != nil { return nil, err } @@ -9044,8 +8997,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsCreateCall) Header() http.Header func (c *ProjectsLocationsWorkloadIdentityPoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workloadidentitypool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workloadidentitypool) if err != nil { return nil, err } @@ -9150,12 +9102,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsDeleteCall) Header() http.Header func (c *ProjectsLocationsWorkloadIdentityPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9257,12 +9208,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9389,12 +9339,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloadIdentityPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9515,8 +9464,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsPatchCall) Header() http.Header { func (c *ProjectsLocationsWorkloadIdentityPoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workloadidentitypool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workloadidentitypool) if err != nil { return nil, err } @@ -9617,8 +9565,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsUndeleteCall) Header() http.Heade func (c *ProjectsLocationsWorkloadIdentityPoolsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkloadidentitypoolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkloadidentitypoolrequest) if err != nil { return nil, err } @@ -9730,12 +9677,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsNamespacesManagedIdentitiesOperat if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9839,12 +9785,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsNamespacesManagedIdentitiesWorklo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9948,12 +9893,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsNamespacesOperationsGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10057,12 +10001,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10166,8 +10109,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersCreateCall) Header() htt func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workloadidentitypoolprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workloadidentitypoolprovider) if err != nil { return nil, err } @@ -10269,12 +10211,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersDeleteCall) Header() htt func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10376,12 +10317,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10509,12 +10449,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/providers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10635,8 +10574,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersPatchCall) Header() http func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workloadidentitypoolprovider) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workloadidentitypoolprovider) if err != nil { return nil, err } @@ -10737,8 +10675,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersUndeleteCall) Header() h func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkloadidentitypoolproviderrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkloadidentitypoolproviderrequest) if err != nil { return nil, err } @@ -10848,8 +10785,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysCreateCall) Header() func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workloadidentitypoolproviderkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workloadidentitypoolproviderkey) if err != nil { return nil, err } @@ -10948,12 +10884,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysDeleteCall) Header() func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11055,12 +10990,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11187,12 +11121,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11307,8 +11240,7 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysUndeleteCall) Header func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteworkloadidentitypoolproviderkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteworkloadidentitypoolproviderkeyrequest) if err != nil { return nil, err } @@ -11420,12 +11352,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersKeysOperationsGetCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11529,12 +11460,11 @@ func (c *ProjectsLocationsWorkloadIdentityPoolsProvidersOperationsGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11645,8 +11575,7 @@ func (c *ProjectsRolesCreateCall) Header() http.Header { func (c *ProjectsRolesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createrolerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createrolerequest) if err != nil { return nil, err } @@ -11782,12 +11711,11 @@ func (c *ProjectsRolesDeleteCall) Header() http.Header { func (c *ProjectsRolesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11915,12 +11843,11 @@ func (c *ProjectsRolesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12088,12 +12015,11 @@ func (c *ProjectsRolesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/roles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12235,8 +12161,7 @@ func (c *ProjectsRolesPatchCall) Header() http.Header { func (c *ProjectsRolesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.role) if err != nil { return nil, err } @@ -12357,8 +12282,7 @@ func (c *ProjectsRolesUndeleteCall) Header() http.Header { func (c *ProjectsRolesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleterolerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleterolerequest) if err != nil { return nil, err } @@ -12459,8 +12383,7 @@ func (c *ProjectsServiceAccountsCreateCall) Header() http.Header { func (c *ProjectsServiceAccountsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createserviceaccountrequest) if err != nil { return nil, err } @@ -12578,12 +12501,11 @@ func (c *ProjectsServiceAccountsDeleteCall) Header() http.Header { func (c *ProjectsServiceAccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12695,8 +12617,7 @@ func (c *ProjectsServiceAccountsDisableCall) Header() http.Header { func (c *ProjectsServiceAccountsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableserviceaccountrequest) if err != nil { return nil, err } @@ -12810,8 +12731,7 @@ func (c *ProjectsServiceAccountsEnableCall) Header() http.Header { func (c *ProjectsServiceAccountsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableserviceaccountrequest) if err != nil { return nil, err } @@ -12931,12 +12851,11 @@ func (c *ProjectsServiceAccountsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13053,12 +12972,11 @@ func (c *ProjectsServiceAccountsGetIamPolicyCall) Header() http.Header { func (c *ProjectsServiceAccountsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13178,12 +13096,11 @@ func (c *ProjectsServiceAccountsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/serviceAccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13307,8 +13224,7 @@ func (c *ProjectsServiceAccountsPatchCall) Header() http.Header { func (c *ProjectsServiceAccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.patchserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.patchserviceaccountrequest) if err != nil { return nil, err } @@ -13422,8 +13338,7 @@ func (c *ProjectsServiceAccountsSetIamPolicyCall) Header() http.Header { func (c *ProjectsServiceAccountsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13541,8 +13456,7 @@ func (c *ProjectsServiceAccountsSignBlobCall) Header() http.Header { func (c *ProjectsServiceAccountsSignBlobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signblobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signblobrequest) if err != nil { return nil, err } @@ -13661,8 +13575,7 @@ func (c *ProjectsServiceAccountsSignJwtCall) Header() http.Header { func (c *ProjectsServiceAccountsSignJwtCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signjwtrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signjwtrequest) if err != nil { return nil, err } @@ -13767,8 +13680,7 @@ func (c *ProjectsServiceAccountsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsServiceAccountsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -13883,8 +13795,7 @@ func (c *ProjectsServiceAccountsUndeleteCall) Header() http.Header { func (c *ProjectsServiceAccountsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteserviceaccountrequest) if err != nil { return nil, err } @@ -13997,8 +13908,7 @@ func (c *ProjectsServiceAccountsUpdateCall) Header() http.Header { func (c *ProjectsServiceAccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceaccount) if err != nil { return nil, err } @@ -14108,8 +14018,7 @@ func (c *ProjectsServiceAccountsKeysCreateCall) Header() http.Header { func (c *ProjectsServiceAccountsKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createserviceaccountkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createserviceaccountkeyrequest) if err != nil { return nil, err } @@ -14222,12 +14131,11 @@ func (c *ProjectsServiceAccountsKeysDeleteCall) Header() http.Header { func (c *ProjectsServiceAccountsKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14332,8 +14240,7 @@ func (c *ProjectsServiceAccountsKeysDisableCall) Header() http.Header { func (c *ProjectsServiceAccountsKeysDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableserviceaccountkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableserviceaccountkeyrequest) if err != nil { return nil, err } @@ -14445,8 +14352,7 @@ func (c *ProjectsServiceAccountsKeysEnableCall) Header() http.Header { func (c *ProjectsServiceAccountsKeysEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableserviceaccountkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableserviceaccountkeyrequest) if err != nil { return nil, err } @@ -14582,12 +14488,11 @@ func (c *ProjectsServiceAccountsKeysGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14717,12 +14622,11 @@ func (c *ProjectsServiceAccountsKeysListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/keys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14828,8 +14732,7 @@ func (c *ProjectsServiceAccountsKeysUploadCall) Header() http.Header { func (c *ProjectsServiceAccountsKeysUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadserviceaccountkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uploadserviceaccountkeyrequest) if err != nil { return nil, err } @@ -14966,12 +14869,11 @@ func (c *RolesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15139,12 +15041,11 @@ func (c *RolesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/roles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15253,8 +15154,7 @@ func (c *RolesQueryGrantableRolesCall) Header() http.Header { func (c *RolesQueryGrantableRolesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querygrantablerolesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querygrantablerolesrequest) if err != nil { return nil, err } diff --git a/iam/v2/iam-gen.go b/iam/v2/iam-gen.go index bb54c16f894..e9885221ca0 100644 --- a/iam/v2/iam-gen.go +++ b/iam/v2/iam-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Policies = NewPoliciesService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Policies = NewPoliciesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -974,8 +973,7 @@ func (c *PoliciesCreatePolicyCall) Header() http.Header { func (c *PoliciesCreatePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv2policy) if err != nil { return nil, err } @@ -1090,12 +1088,11 @@ func (c *PoliciesDeleteCall) Header() http.Header { func (c *PoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1205,12 +1202,11 @@ func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1337,12 +1333,11 @@ func (c *PoliciesListPoliciesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1469,8 +1464,7 @@ func (c *PoliciesUpdateCall) Header() http.Header { func (c *PoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv2policy) if err != nil { return nil, err } @@ -1583,12 +1577,11 @@ func (c *PoliciesOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/iam/v2beta/iam-gen.go b/iam/v2beta/iam-gen.go index 81b8f767d92..a8a2773064f 100644 --- a/iam/v2beta/iam-gen.go +++ b/iam/v2beta/iam-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Policies = NewPoliciesService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Policies = NewPoliciesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -974,8 +973,7 @@ func (c *PoliciesCreatePolicyCall) Header() http.Header { func (c *PoliciesCreatePolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv2betapolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv2betapolicy) if err != nil { return nil, err } @@ -1090,12 +1088,11 @@ func (c *PoliciesDeleteCall) Header() http.Header { func (c *PoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1205,12 +1202,11 @@ func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1337,12 +1333,11 @@ func (c *PoliciesListPoliciesCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1469,8 +1464,7 @@ func (c *PoliciesUpdateCall) Header() http.Header { func (c *PoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv2betapolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv2betapolicy) if err != nil { return nil, err } @@ -1583,12 +1577,11 @@ func (c *PoliciesOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/iamcredentials/v1/iamcredentials-gen.go b/iamcredentials/v1/iamcredentials-gen.go index 9c2d660815e..8edb17deb2d 100644 --- a/iamcredentials/v1/iamcredentials-gen.go +++ b/iamcredentials/v1/iamcredentials-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -524,8 +523,7 @@ func (c *ProjectsServiceAccountsGenerateAccessTokenCall) Header() http.Header { func (c *ProjectsServiceAccountsGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateaccesstokenrequest) if err != nil { return nil, err } @@ -629,8 +627,7 @@ func (c *ProjectsServiceAccountsGenerateIdTokenCall) Header() http.Header { func (c *ProjectsServiceAccountsGenerateIdTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateidtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateidtokenrequest) if err != nil { return nil, err } @@ -742,12 +739,11 @@ func (c *ProjectsServiceAccountsGetAllowedLocationsCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/allowedLocations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -843,8 +839,7 @@ func (c *ProjectsServiceAccountsSignBlobCall) Header() http.Header { func (c *ProjectsServiceAccountsSignBlobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signblobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signblobrequest) if err != nil { return nil, err } @@ -948,8 +943,7 @@ func (c *ProjectsServiceAccountsSignJwtCall) Header() http.Header { func (c *ProjectsServiceAccountsSignJwtCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signjwtrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signjwtrequest) if err != nil { return nil, err } diff --git a/iap/v1/iap-gen.go b/iap/v1/iap-gen.go index 6eb76075be8..b6454faa66f 100644 --- a/iap/v1/iap-gen.go +++ b/iap/v1/iap-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1558,8 +1557,7 @@ func (c *ProjectsBrandsCreateCall) Header() http.Header { func (c *ProjectsBrandsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.brand) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.brand) if err != nil { return nil, err } @@ -1670,12 +1668,11 @@ func (c *ProjectsBrandsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1778,12 +1775,11 @@ func (c *ProjectsBrandsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/brands") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1880,8 +1876,7 @@ func (c *ProjectsBrandsIdentityAwareProxyClientsCreateCall) Header() http.Header func (c *ProjectsBrandsIdentityAwareProxyClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identityawareproxyclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identityawareproxyclient) if err != nil { return nil, err } @@ -1986,12 +1981,11 @@ func (c *ProjectsBrandsIdentityAwareProxyClientsDeleteCall) Header() http.Header func (c *ProjectsBrandsIdentityAwareProxyClientsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2097,12 +2091,11 @@ func (c *ProjectsBrandsIdentityAwareProxyClientsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2225,12 +2218,11 @@ func (c *ProjectsBrandsIdentityAwareProxyClientsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/identityAwareProxyClients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2349,8 +2341,7 @@ func (c *ProjectsBrandsIdentityAwareProxyClientsResetSecretCall) Header() http.H func (c *ProjectsBrandsIdentityAwareProxyClientsResetSecretCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetidentityawareproxyclientsecretrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetidentityawareproxyclientsecretrequest) if err != nil { return nil, err } @@ -2461,8 +2452,7 @@ func (c *ProjectsIapTunnelLocationsDestGroupsCreateCall) Header() http.Header { func (c *ProjectsIapTunnelLocationsDestGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tunneldestgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tunneldestgroup) if err != nil { return nil, err } @@ -2563,12 +2553,11 @@ func (c *ProjectsIapTunnelLocationsDestGroupsDeleteCall) Header() http.Header { func (c *ProjectsIapTunnelLocationsDestGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2672,12 +2661,11 @@ func (c *ProjectsIapTunnelLocationsDestGroupsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2802,12 +2790,11 @@ func (c *ProjectsIapTunnelLocationsDestGroupsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/destGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2932,8 +2919,7 @@ func (c *ProjectsIapTunnelLocationsDestGroupsPatchCall) Header() http.Header { func (c *ProjectsIapTunnelLocationsDestGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tunneldestgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tunneldestgroup) if err != nil { return nil, err } @@ -3039,8 +3025,7 @@ func (c *V1GetIamPolicyCall) Header() http.Header { func (c *V1GetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -3152,12 +3137,11 @@ func (c *V1GetIapSettingsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:iapSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3254,8 +3238,7 @@ func (c *V1SetIamPolicyCall) Header() http.Header { func (c *V1SetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3361,8 +3344,7 @@ func (c *V1TestIamPermissionsCall) Header() http.Header { func (c *V1TestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3475,8 +3457,7 @@ func (c *V1UpdateIapSettingsCall) Header() http.Header { func (c *V1UpdateIapSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.iapsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.iapsettings) if err != nil { return nil, err } @@ -3584,12 +3565,11 @@ func (c *V1ValidateAttributeExpressionCall) Header() http.Header { func (c *V1ValidateAttributeExpressionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:validateAttributeExpression") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/iap/v1beta1/iap-gen.go b/iap/v1beta1/iap-gen.go index b43886d468e..ad48580f3a7 100644 --- a/iap/v1beta1/iap-gen.go +++ b/iap/v1beta1/iap-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.V1beta1 = NewV1beta1Service(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.V1beta1 = NewV1beta1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -581,8 +580,7 @@ func (c *V1beta1GetIamPolicyCall) Header() http.Header { func (c *V1beta1GetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -687,8 +685,7 @@ func (c *V1beta1SetIamPolicyCall) Header() http.Header { func (c *V1beta1SetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -796,8 +793,7 @@ func (c *V1beta1TestIamPermissionsCall) Header() http.Header { func (c *V1beta1TestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/identitytoolkit/v1/identitytoolkit-gen.go b/identitytoolkit/v1/identitytoolkit-gen.go index 4230777b891..3e1ca94726c 100644 --- a/identitytoolkit/v1/identitytoolkit-gen.go +++ b/identitytoolkit/v1/identitytoolkit-gen.go @@ -124,7 +124,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Projects = NewProjectsService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -143,11 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Projects = NewProjectsService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3139,8 +3138,7 @@ func (c *AccountsCreateAuthUriCall) Header() http.Header { func (c *AccountsCreateAuthUriCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1createauthurirequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1createauthurirequest) if err != nil { return nil, err } @@ -3234,8 +3232,7 @@ func (c *AccountsDeleteCall) Header() http.Header { func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1deleteaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1deleteaccountrequest) if err != nil { return nil, err } @@ -3329,8 +3326,7 @@ func (c *AccountsIssueSamlResponseCall) Header() http.Header { func (c *AccountsIssueSamlResponseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1issuesamlresponserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1issuesamlresponserequest) if err != nil { return nil, err } @@ -3427,8 +3423,7 @@ func (c *AccountsLookupCall) Header() http.Header { func (c *AccountsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1getaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1getaccountinforequest) if err != nil { return nil, err } @@ -3525,8 +3520,7 @@ func (c *AccountsResetPasswordCall) Header() http.Header { func (c *AccountsResetPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1resetpasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1resetpasswordrequest) if err != nil { return nil, err } @@ -3622,8 +3616,7 @@ func (c *AccountsSendOobCodeCall) Header() http.Header { func (c *AccountsSendOobCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1getoobcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1getoobcoderequest) if err != nil { return nil, err } @@ -3722,8 +3715,7 @@ func (c *AccountsSendVerificationCodeCall) Header() http.Header { func (c *AccountsSendVerificationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1sendverificationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1sendverificationcoderequest) if err != nil { return nil, err } @@ -3821,8 +3813,7 @@ func (c *AccountsSignInWithCustomTokenCall) Header() http.Header { func (c *AccountsSignInWithCustomTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signinwithcustomtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signinwithcustomtokenrequest) if err != nil { return nil, err } @@ -3921,8 +3912,7 @@ func (c *AccountsSignInWithEmailLinkCall) Header() http.Header { func (c *AccountsSignInWithEmailLinkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signinwithemaillinkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signinwithemaillinkrequest) if err != nil { return nil, err } @@ -4031,8 +4021,7 @@ func (c *AccountsSignInWithGameCenterCall) Header() http.Header { func (c *AccountsSignInWithGameCenterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signinwithgamecenterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signinwithgamecenterrequest) if err != nil { return nil, err } @@ -4137,8 +4126,7 @@ func (c *AccountsSignInWithIdpCall) Header() http.Header { func (c *AccountsSignInWithIdpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signinwithidprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signinwithidprequest) if err != nil { return nil, err } @@ -4236,8 +4224,7 @@ func (c *AccountsSignInWithPasswordCall) Header() http.Header { func (c *AccountsSignInWithPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signinwithpasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signinwithpasswordrequest) if err != nil { return nil, err } @@ -4340,8 +4327,7 @@ func (c *AccountsSignInWithPhoneNumberCall) Header() http.Header { func (c *AccountsSignInWithPhoneNumberCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signinwithphonenumberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signinwithphonenumberrequest) if err != nil { return nil, err } @@ -4441,8 +4427,7 @@ func (c *AccountsSignUpCall) Header() http.Header { func (c *AccountsSignUpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signuprequest) if err != nil { return nil, err } @@ -4538,8 +4523,7 @@ func (c *AccountsUpdateCall) Header() http.Header { func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1setaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1setaccountinforequest) if err != nil { return nil, err } @@ -4640,8 +4624,7 @@ func (c *AccountsVerifyIosClientCall) Header() http.Header { func (c *AccountsVerifyIosClientCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1verifyiosclientrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1verifyiosclientrequest) if err != nil { return nil, err } @@ -4750,8 +4733,7 @@ func (c *ProjectsAccountsCall) Header() http.Header { func (c *ProjectsAccountsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signuprequest) if err != nil { return nil, err } @@ -4854,8 +4836,7 @@ func (c *ProjectsCreateSessionCookieCall) Header() http.Header { func (c *ProjectsCreateSessionCookieCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1createsessioncookierequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1createsessioncookierequest) if err != nil { return nil, err } @@ -4957,8 +4938,7 @@ func (c *ProjectsQueryAccountsCall) Header() http.Header { func (c *ProjectsQueryAccountsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1queryuserinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1queryuserinforequest) if err != nil { return nil, err } @@ -5064,8 +5044,7 @@ func (c *ProjectsAccountsBatchCreateCall) Header() http.Header { func (c *ProjectsAccountsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1uploadaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1uploadaccountrequest) if err != nil { return nil, err } @@ -5172,8 +5151,7 @@ func (c *ProjectsAccountsBatchDeleteCall) Header() http.Header { func (c *ProjectsAccountsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1batchdeleteaccountsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1batchdeleteaccountsrequest) if err != nil { return nil, err } @@ -5321,12 +5299,11 @@ func (c *ProjectsAccountsBatchGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{+targetProjectId}/accounts:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5442,8 +5419,7 @@ func (c *ProjectsAccountsDeleteCall) Header() http.Header { func (c *ProjectsAccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1deleteaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1deleteaccountrequest) if err != nil { return nil, err } @@ -5551,8 +5527,7 @@ func (c *ProjectsAccountsLookupCall) Header() http.Header { func (c *ProjectsAccountsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1getaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1getaccountinforequest) if err != nil { return nil, err } @@ -5654,8 +5629,7 @@ func (c *ProjectsAccountsQueryCall) Header() http.Header { func (c *ProjectsAccountsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1queryuserinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1queryuserinforequest) if err != nil { return nil, err } @@ -5761,8 +5735,7 @@ func (c *ProjectsAccountsSendOobCodeCall) Header() http.Header { func (c *ProjectsAccountsSendOobCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1getoobcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1getoobcoderequest) if err != nil { return nil, err } @@ -5869,8 +5842,7 @@ func (c *ProjectsAccountsUpdateCall) Header() http.Header { func (c *ProjectsAccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1setaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1setaccountinforequest) if err != nil { return nil, err } @@ -5987,8 +5959,7 @@ func (c *ProjectsTenantsAccountsCall) Header() http.Header { func (c *ProjectsTenantsAccountsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1signuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1signuprequest) if err != nil { return nil, err } @@ -6096,8 +6067,7 @@ func (c *ProjectsTenantsCreateSessionCookieCall) Header() http.Header { func (c *ProjectsTenantsCreateSessionCookieCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1createsessioncookierequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1createsessioncookierequest) if err != nil { return nil, err } @@ -6207,8 +6177,7 @@ func (c *ProjectsTenantsAccountsBatchCreateCall) Header() http.Header { func (c *ProjectsTenantsAccountsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1uploadaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1uploadaccountrequest) if err != nil { return nil, err } @@ -6321,8 +6290,7 @@ func (c *ProjectsTenantsAccountsBatchDeleteCall) Header() http.Header { func (c *ProjectsTenantsAccountsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1batchdeleteaccountsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1batchdeleteaccountsrequest) if err != nil { return nil, err } @@ -6467,12 +6435,11 @@ func (c *ProjectsTenantsAccountsBatchGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{+targetProjectId}/tenants/{+tenantId}/accounts:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6595,8 +6562,7 @@ func (c *ProjectsTenantsAccountsDeleteCall) Header() http.Header { func (c *ProjectsTenantsAccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1deleteaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1deleteaccountrequest) if err != nil { return nil, err } @@ -6709,8 +6675,7 @@ func (c *ProjectsTenantsAccountsLookupCall) Header() http.Header { func (c *ProjectsTenantsAccountsLookupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1getaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1getaccountinforequest) if err != nil { return nil, err } @@ -6816,8 +6781,7 @@ func (c *ProjectsTenantsAccountsQueryCall) Header() http.Header { func (c *ProjectsTenantsAccountsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1queryuserinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1queryuserinforequest) if err != nil { return nil, err } @@ -6928,8 +6892,7 @@ func (c *ProjectsTenantsAccountsSendOobCodeCall) Header() http.Header { func (c *ProjectsTenantsAccountsSendOobCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1getoobcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1getoobcoderequest) if err != nil { return nil, err } @@ -7042,8 +7005,7 @@ func (c *ProjectsTenantsAccountsUpdateCall) Header() http.Header { func (c *ProjectsTenantsAccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv1setaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv1setaccountinforequest) if err != nil { return nil, err } @@ -7220,12 +7182,11 @@ func (c *V1GetProjectsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7323,12 +7284,11 @@ func (c *V1GetPublicKeysCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/publicKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7401,12 +7361,11 @@ func (c *V1GetRecaptchaParamsCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/recaptchaParams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7504,12 +7463,11 @@ func (c *V1GetSessionCookiePublicKeysCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/sessionCookiePublicKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/identitytoolkit/v2/identitytoolkit-gen.go b/identitytoolkit/v2/identitytoolkit-gen.go index 1402c1d36de..1c1aa92e215 100644 --- a/identitytoolkit/v2/identitytoolkit-gen.go +++ b/identitytoolkit/v2/identitytoolkit-gen.go @@ -124,7 +124,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.DefaultSupportedIdps = NewDefaultSupportedIdpsService(s) + s.Projects = NewProjectsService(s) + s.V2 = NewV2Service(s) if err != nil { return nil, err } @@ -143,12 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.DefaultSupportedIdps = NewDefaultSupportedIdpsService(s) - s.Projects = NewProjectsService(s) - s.V2 = NewV2Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3509,8 +3508,7 @@ func (c *AccountsRevokeTokenCall) Header() http.Header { func (c *AccountsRevokeTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv2revoketokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv2revoketokenrequest) if err != nil { return nil, err } @@ -3604,8 +3602,7 @@ func (c *AccountsMfaEnrollmentFinalizeCall) Header() http.Header { func (c *AccountsMfaEnrollmentFinalizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv2finalizemfaenrollmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv2finalizemfaenrollmentrequest) if err != nil { return nil, err } @@ -3700,8 +3697,7 @@ func (c *AccountsMfaEnrollmentStartCall) Header() http.Header { func (c *AccountsMfaEnrollmentStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv2startmfaenrollmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv2startmfaenrollmentrequest) if err != nil { return nil, err } @@ -3798,8 +3794,7 @@ func (c *AccountsMfaEnrollmentWithdrawCall) Header() http.Header { func (c *AccountsMfaEnrollmentWithdrawCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv2withdrawmfarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv2withdrawmfarequest) if err != nil { return nil, err } @@ -3893,8 +3888,7 @@ func (c *AccountsMfaSignInFinalizeCall) Header() http.Header { func (c *AccountsMfaSignInFinalizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv2finalizemfasigninrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv2finalizemfasigninrequest) if err != nil { return nil, err } @@ -3988,8 +3982,7 @@ func (c *AccountsMfaSignInStartCall) Header() http.Header { func (c *AccountsMfaSignInStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitv2startmfasigninrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitv2startmfasigninrequest) if err != nil { return nil, err } @@ -4107,12 +4100,11 @@ func (c *DefaultSupportedIdpsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/defaultSupportedIdps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4234,12 +4226,11 @@ func (c *ProjectsGetConfigCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4342,8 +4333,7 @@ func (c *ProjectsUpdateConfigCall) Header() http.Header { func (c *ProjectsUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2config) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2config) if err != nil { return nil, err } @@ -4454,8 +4444,7 @@ func (c *ProjectsDefaultSupportedIdpConfigsCreateCall) Header() http.Header { func (c *ProjectsDefaultSupportedIdpConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) if err != nil { return nil, err } @@ -4556,12 +4545,11 @@ func (c *ProjectsDefaultSupportedIdpConfigsDeleteCall) Header() http.Header { func (c *ProjectsDefaultSupportedIdpConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4666,12 +4654,11 @@ func (c *ProjectsDefaultSupportedIdpConfigsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4790,12 +4777,11 @@ func (c *ProjectsDefaultSupportedIdpConfigsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/defaultSupportedIdpConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4919,8 +4905,7 @@ func (c *ProjectsDefaultSupportedIdpConfigsPatchCall) Header() http.Header { func (c *ProjectsDefaultSupportedIdpConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) if err != nil { return nil, err } @@ -5026,8 +5011,7 @@ func (c *ProjectsIdentityPlatformInitializeAuthCall) Header() http.Header { func (c *ProjectsIdentityPlatformInitializeAuthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2initializeidentityplatformrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2initializeidentityplatformrequest) if err != nil { return nil, err } @@ -5137,8 +5121,7 @@ func (c *ProjectsInboundSamlConfigsCreateCall) Header() http.Header { func (c *ProjectsInboundSamlConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) if err != nil { return nil, err } @@ -5239,12 +5222,11 @@ func (c *ProjectsInboundSamlConfigsDeleteCall) Header() http.Header { func (c *ProjectsInboundSamlConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5348,12 +5330,11 @@ func (c *ProjectsInboundSamlConfigsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5471,12 +5452,11 @@ func (c *ProjectsInboundSamlConfigsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inboundSamlConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5601,8 +5581,7 @@ func (c *ProjectsInboundSamlConfigsPatchCall) Header() http.Header { func (c *ProjectsInboundSamlConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) if err != nil { return nil, err } @@ -5711,8 +5690,7 @@ func (c *ProjectsOauthIdpConfigsCreateCall) Header() http.Header { func (c *ProjectsOauthIdpConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2oauthidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2oauthidpconfig) if err != nil { return nil, err } @@ -5812,12 +5790,11 @@ func (c *ProjectsOauthIdpConfigsDeleteCall) Header() http.Header { func (c *ProjectsOauthIdpConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5921,12 +5898,11 @@ func (c *ProjectsOauthIdpConfigsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6044,12 +6020,11 @@ func (c *ProjectsOauthIdpConfigsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/oauthIdpConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6174,8 +6149,7 @@ func (c *ProjectsOauthIdpConfigsPatchCall) Header() http.Header { func (c *ProjectsOauthIdpConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2oauthidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2oauthidpconfig) if err != nil { return nil, err } @@ -6277,8 +6251,7 @@ func (c *ProjectsTenantsCreateCall) Header() http.Header { func (c *ProjectsTenantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2tenant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2tenant) if err != nil { return nil, err } @@ -6377,12 +6350,11 @@ func (c *ProjectsTenantsDeleteCall) Header() http.Header { func (c *ProjectsTenantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6485,12 +6457,11 @@ func (c *ProjectsTenantsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6588,8 +6559,7 @@ func (c *ProjectsTenantsGetIamPolicyCall) Header() http.Header { func (c *ProjectsTenantsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1getiampolicyrequest) if err != nil { return nil, err } @@ -6716,12 +6686,11 @@ func (c *ProjectsTenantsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tenants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6845,8 +6814,7 @@ func (c *ProjectsTenantsPatchCall) Header() http.Header { func (c *ProjectsTenantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2tenant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2tenant) if err != nil { return nil, err } @@ -6951,8 +6919,7 @@ func (c *ProjectsTenantsSetIamPolicyCall) Header() http.Header { func (c *ProjectsTenantsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -7058,8 +7025,7 @@ func (c *ProjectsTenantsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsTenantsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -7170,8 +7136,7 @@ func (c *ProjectsTenantsDefaultSupportedIdpConfigsCreateCall) Header() http.Head func (c *ProjectsTenantsDefaultSupportedIdpConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) if err != nil { return nil, err } @@ -7272,12 +7237,11 @@ func (c *ProjectsTenantsDefaultSupportedIdpConfigsDeleteCall) Header() http.Head func (c *ProjectsTenantsDefaultSupportedIdpConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7382,12 +7346,11 @@ func (c *ProjectsTenantsDefaultSupportedIdpConfigsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7506,12 +7469,11 @@ func (c *ProjectsTenantsDefaultSupportedIdpConfigsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/defaultSupportedIdpConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7635,8 +7597,7 @@ func (c *ProjectsTenantsDefaultSupportedIdpConfigsPatchCall) Header() http.Heade func (c *ProjectsTenantsDefaultSupportedIdpConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig) if err != nil { return nil, err } @@ -7746,8 +7707,7 @@ func (c *ProjectsTenantsInboundSamlConfigsCreateCall) Header() http.Header { func (c *ProjectsTenantsInboundSamlConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) if err != nil { return nil, err } @@ -7848,12 +7808,11 @@ func (c *ProjectsTenantsInboundSamlConfigsDeleteCall) Header() http.Header { func (c *ProjectsTenantsInboundSamlConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7957,12 +7916,11 @@ func (c *ProjectsTenantsInboundSamlConfigsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8080,12 +8038,11 @@ func (c *ProjectsTenantsInboundSamlConfigsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inboundSamlConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8210,8 +8167,7 @@ func (c *ProjectsTenantsInboundSamlConfigsPatchCall) Header() http.Header { func (c *ProjectsTenantsInboundSamlConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2inboundsamlconfig) if err != nil { return nil, err } @@ -8320,8 +8276,7 @@ func (c *ProjectsTenantsOauthIdpConfigsCreateCall) Header() http.Header { func (c *ProjectsTenantsOauthIdpConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2oauthidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2oauthidpconfig) if err != nil { return nil, err } @@ -8421,12 +8376,11 @@ func (c *ProjectsTenantsOauthIdpConfigsDeleteCall) Header() http.Header { func (c *ProjectsTenantsOauthIdpConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8530,12 +8484,11 @@ func (c *ProjectsTenantsOauthIdpConfigsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8653,12 +8606,11 @@ func (c *ProjectsTenantsOauthIdpConfigsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/oauthIdpConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8783,8 +8735,7 @@ func (c *ProjectsTenantsOauthIdpConfigsPatchCall) Header() http.Header { func (c *ProjectsTenantsOauthIdpConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudidentitytoolkitadminv2oauthidpconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudidentitytoolkitadminv2oauthidpconfig) if err != nil { return nil, err } @@ -8897,12 +8848,11 @@ func (c *V2GetPasswordPolicyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/passwordPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9030,12 +8980,11 @@ func (c *V2GetRecaptchaConfigCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/recaptchaConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/identitytoolkit/v3/identitytoolkit-gen.go b/identitytoolkit/v3/identitytoolkit-gen.go index a71e5947be0..153e854606b 100644 --- a/identitytoolkit/v3/identitytoolkit-gen.go +++ b/identitytoolkit/v3/identitytoolkit-gen.go @@ -121,7 +121,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Relyingparty = NewRelyingpartyService(s) if err != nil { return nil, err } @@ -140,9 +141,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Relyingparty = NewRelyingpartyService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1876,8 +1875,7 @@ func (c *RelyingpartyCreateAuthUriCall) Header() http.Header { func (c *RelyingpartyCreateAuthUriCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartycreateauthurirequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartycreateauthurirequest) if err != nil { return nil, err } @@ -1971,8 +1969,7 @@ func (c *RelyingpartyDeleteAccountCall) Header() http.Header { func (c *RelyingpartyDeleteAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartydeleteaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartydeleteaccountrequest) if err != nil { return nil, err } @@ -2066,8 +2063,7 @@ func (c *RelyingpartyDownloadAccountCall) Header() http.Header { func (c *RelyingpartyDownloadAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartydownloadaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartydownloadaccountrequest) if err != nil { return nil, err } @@ -2182,8 +2178,7 @@ func (c *RelyingpartyEmailLinkSigninCall) Header() http.Header { func (c *RelyingpartyEmailLinkSigninCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyemaillinksigninrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyemaillinksigninrequest) if err != nil { return nil, err } @@ -2277,8 +2272,7 @@ func (c *RelyingpartyGetAccountInfoCall) Header() http.Header { func (c *RelyingpartyGetAccountInfoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartygetaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartygetaccountinforequest) if err != nil { return nil, err } @@ -2372,8 +2366,7 @@ func (c *RelyingpartyGetOobConfirmationCodeCall) Header() http.Header { func (c *RelyingpartyGetOobConfirmationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.relyingparty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.relyingparty) if err != nil { return nil, err } @@ -2491,12 +2484,11 @@ func (c *RelyingpartyGetProjectConfigCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "getProjectConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2592,12 +2584,11 @@ func (c *RelyingpartyGetPublicKeysCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "publicKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2674,12 +2665,11 @@ func (c *RelyingpartyGetRecaptchaParamCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "getRecaptchaParam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2765,8 +2755,7 @@ func (c *RelyingpartyResetPasswordCall) Header() http.Header { func (c *RelyingpartyResetPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyresetpasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyresetpasswordrequest) if err != nil { return nil, err } @@ -2860,8 +2849,7 @@ func (c *RelyingpartySendVerificationCodeCall) Header() http.Header { func (c *RelyingpartySendVerificationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartysendverificationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartysendverificationcoderequest) if err != nil { return nil, err } @@ -2955,8 +2943,7 @@ func (c *RelyingpartySetAccountInfoCall) Header() http.Header { func (c *RelyingpartySetAccountInfoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartysetaccountinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartysetaccountinforequest) if err != nil { return nil, err } @@ -3050,8 +3037,7 @@ func (c *RelyingpartySetProjectConfigCall) Header() http.Header { func (c *RelyingpartySetProjectConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartysetprojectconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartysetprojectconfigrequest) if err != nil { return nil, err } @@ -3145,8 +3131,7 @@ func (c *RelyingpartySignOutUserCall) Header() http.Header { func (c *RelyingpartySignOutUserCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartysignoutuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartysignoutuserrequest) if err != nil { return nil, err } @@ -3240,8 +3225,7 @@ func (c *RelyingpartySignupNewUserCall) Header() http.Header { func (c *RelyingpartySignupNewUserCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartysignupnewuserrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartysignupnewuserrequest) if err != nil { return nil, err } @@ -3335,8 +3319,7 @@ func (c *RelyingpartyUploadAccountCall) Header() http.Header { func (c *RelyingpartyUploadAccountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyuploadaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyuploadaccountrequest) if err != nil { return nil, err } @@ -3430,8 +3413,7 @@ func (c *RelyingpartyVerifyAssertionCall) Header() http.Header { func (c *RelyingpartyVerifyAssertionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyverifyassertionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyverifyassertionrequest) if err != nil { return nil, err } @@ -3525,8 +3507,7 @@ func (c *RelyingpartyVerifyCustomTokenCall) Header() http.Header { func (c *RelyingpartyVerifyCustomTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyverifycustomtokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyverifycustomtokenrequest) if err != nil { return nil, err } @@ -3620,8 +3601,7 @@ func (c *RelyingpartyVerifyPasswordCall) Header() http.Header { func (c *RelyingpartyVerifyPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyverifypasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyverifypasswordrequest) if err != nil { return nil, err } @@ -3716,8 +3696,7 @@ func (c *RelyingpartyVerifyPhoneNumberCall) Header() http.Header { func (c *RelyingpartyVerifyPhoneNumberCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyverifyphonenumberrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.identitytoolkitrelyingpartyverifyphonenumberrequest) if err != nil { return nil, err } diff --git a/ids/v1/ids-gen.go b/ids/v1/ids-gen.go index 2ff3e90f554..fe701dd65c4 100644 --- a/ids/v1/ids-gen.go +++ b/ids/v1/ids-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -974,12 +973,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1105,12 +1103,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1250,8 +1247,7 @@ func (c *ProjectsLocationsEndpointsCreateCall) Header() http.Header { func (c *ProjectsLocationsEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } @@ -1365,12 +1361,11 @@ func (c *ProjectsLocationsEndpointsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1473,12 +1468,11 @@ func (c *ProjectsLocationsEndpointsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1600,12 +1594,11 @@ func (c *ProjectsLocationsEndpointsGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1737,12 +1730,11 @@ func (c *ProjectsLocationsEndpointsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1882,8 +1874,7 @@ func (c *ProjectsLocationsEndpointsPatchCall) Header() http.Header { func (c *ProjectsLocationsEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } @@ -1987,8 +1978,7 @@ func (c *ProjectsLocationsEndpointsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsEndpointsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2095,8 +2085,7 @@ func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2205,8 +2194,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -2307,12 +2295,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2416,12 +2403,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2544,12 +2530,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/indexing/v3/indexing-gen.go b/indexing/v3/indexing-gen.go index 66a024daff0..1fbd8f5a91e 100644 --- a/indexing/v3/indexing-gen.go +++ b/indexing/v3/indexing-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.UrlNotifications = NewUrlNotificationsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.UrlNotifications = NewUrlNotificationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -311,12 +310,11 @@ func (c *UrlNotificationsGetMetadataCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/urlNotifications/metadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -402,8 +400,7 @@ func (c *UrlNotificationsPublishCall) Header() http.Header { func (c *UrlNotificationsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlnotification) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urlnotification) if err != nil { return nil, err } diff --git a/internal/gensupport/media.go b/internal/gensupport/media.go index 0861d4d3c87..8c7435de3e6 100644 --- a/internal/gensupport/media.go +++ b/internal/gensupport/media.go @@ -200,6 +200,9 @@ func (mi *MediaInfo) UploadType() string { // UploadRequest sets up an HTTP request for media upload. It adds headers // as necessary, and returns a replacement for the body and a function for http.Request.GetBody. func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newBody io.Reader, getBody func() (io.ReadCloser, error), cleanup func()) { + if body == nil { + body = new(bytes.Buffer) + } cleanup = func() {} if mi == nil { return body, nil, cleanup diff --git a/jobs/v3/jobs-gen.go b/jobs/v3/jobs-gen.go index ed287af79aa..80b18527251 100644 --- a/jobs/v3/jobs-gen.go +++ b/jobs/v3/jobs-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3079,12 +3078,11 @@ func (c *ProjectsCompleteCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:complete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3182,8 +3180,7 @@ func (c *ProjectsClientEventsCreateCall) Header() http.Header { func (c *ProjectsClientEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclienteventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createclienteventrequest) if err != nil { return nil, err } @@ -3285,8 +3282,7 @@ func (c *ProjectsCompaniesCreateCall) Header() http.Header { func (c *ProjectsCompaniesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcompanyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcompanyrequest) if err != nil { return nil, err } @@ -3387,12 +3383,11 @@ func (c *ProjectsCompaniesDeleteCall) Header() http.Header { func (c *ProjectsCompaniesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3496,12 +3491,11 @@ func (c *ProjectsCompaniesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3629,12 +3623,11 @@ func (c *ProjectsCompaniesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/companies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3753,8 +3746,7 @@ func (c *ProjectsCompaniesPatchCall) Header() http.Header { func (c *ProjectsCompaniesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecompanyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecompanyrequest) if err != nil { return nil, err } @@ -3856,8 +3848,7 @@ func (c *ProjectsJobsBatchDeleteCall) Header() http.Header { func (c *ProjectsJobsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletejobsrequest) if err != nil { return nil, err } @@ -3960,8 +3951,7 @@ func (c *ProjectsJobsCreateCall) Header() http.Header { func (c *ProjectsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createjobrequest) if err != nil { return nil, err } @@ -4062,12 +4052,11 @@ func (c *ProjectsJobsDeleteCall) Header() http.Header { func (c *ProjectsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4172,12 +4161,11 @@ func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4344,12 +4332,11 @@ func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4469,8 +4456,7 @@ func (c *ProjectsJobsPatchCall) Header() http.Header { func (c *ProjectsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatejobrequest) if err != nil { return nil, err } @@ -4573,8 +4559,7 @@ func (c *ProjectsJobsSearchCall) Header() http.Header { func (c *ProjectsJobsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchjobsrequest) if err != nil { return nil, err } @@ -4703,8 +4688,7 @@ func (c *ProjectsJobsSearchForAlertCall) Header() http.Header { func (c *ProjectsJobsSearchForAlertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchjobsrequest) if err != nil { return nil, err } diff --git a/jobs/v3p1beta1/jobs-gen.go b/jobs/v3p1beta1/jobs-gen.go index a6b4b4dfcd3..f97f8120fc9 100644 --- a/jobs/v3p1beta1/jobs-gen.go +++ b/jobs/v3p1beta1/jobs-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3375,12 +3374,11 @@ func (c *ProjectsCompleteCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+name}:complete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3478,8 +3476,7 @@ func (c *ProjectsClientEventsCreateCall) Header() http.Header { func (c *ProjectsClientEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclienteventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createclienteventrequest) if err != nil { return nil, err } @@ -3581,8 +3578,7 @@ func (c *ProjectsCompaniesCreateCall) Header() http.Header { func (c *ProjectsCompaniesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcompanyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcompanyrequest) if err != nil { return nil, err } @@ -3683,12 +3679,11 @@ func (c *ProjectsCompaniesDeleteCall) Header() http.Header { func (c *ProjectsCompaniesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3792,12 +3787,11 @@ func (c *ProjectsCompaniesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3925,12 +3919,11 @@ func (c *ProjectsCompaniesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+parent}/companies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4049,8 +4042,7 @@ func (c *ProjectsCompaniesPatchCall) Header() http.Header { func (c *ProjectsCompaniesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecompanyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecompanyrequest) if err != nil { return nil, err } @@ -4152,8 +4144,7 @@ func (c *ProjectsJobsBatchDeleteCall) Header() http.Header { func (c *ProjectsJobsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletejobsrequest) if err != nil { return nil, err } @@ -4256,8 +4247,7 @@ func (c *ProjectsJobsCreateCall) Header() http.Header { func (c *ProjectsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createjobrequest) if err != nil { return nil, err } @@ -4358,12 +4348,11 @@ func (c *ProjectsJobsDeleteCall) Header() http.Header { func (c *ProjectsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4468,12 +4457,11 @@ func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4640,12 +4628,11 @@ func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4765,8 +4752,7 @@ func (c *ProjectsJobsPatchCall) Header() http.Header { func (c *ProjectsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatejobrequest) if err != nil { return nil, err } @@ -4869,8 +4855,7 @@ func (c *ProjectsJobsSearchCall) Header() http.Header { func (c *ProjectsJobsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchjobsrequest) if err != nil { return nil, err } @@ -4999,8 +4984,7 @@ func (c *ProjectsJobsSearchForAlertCall) Header() http.Header { func (c *ProjectsJobsSearchForAlertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchjobsrequest) if err != nil { return nil, err } @@ -5134,12 +5118,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/jobs/v4/jobs-gen.go b/jobs/v4/jobs-gen.go index 1a7fc151e1a..44d9966b78a 100644 --- a/jobs/v4/jobs-gen.go +++ b/jobs/v4/jobs-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3023,12 +3022,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3207,12 +3205,11 @@ func (c *ProjectsTenantsCompleteQueryCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+tenant}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3306,8 +3303,7 @@ func (c *ProjectsTenantsCreateCall) Header() http.Header { func (c *ProjectsTenantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tenant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tenant) if err != nil { return nil, err } @@ -3407,12 +3403,11 @@ func (c *ProjectsTenantsDeleteCall) Header() http.Header { func (c *ProjectsTenantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3516,12 +3511,11 @@ func (c *ProjectsTenantsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3639,12 +3633,11 @@ func (c *ProjectsTenantsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/tenants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3771,8 +3764,7 @@ func (c *ProjectsTenantsPatchCall) Header() http.Header { func (c *ProjectsTenantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tenant) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tenant) if err != nil { return nil, err } @@ -3879,8 +3871,7 @@ func (c *ProjectsTenantsClientEventsCreateCall) Header() http.Header { func (c *ProjectsTenantsClientEventsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientevent) if err != nil { return nil, err } @@ -3982,8 +3973,7 @@ func (c *ProjectsTenantsCompaniesCreateCall) Header() http.Header { func (c *ProjectsTenantsCompaniesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.company) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.company) if err != nil { return nil, err } @@ -4084,12 +4074,11 @@ func (c *ProjectsTenantsCompaniesDeleteCall) Header() http.Header { func (c *ProjectsTenantsCompaniesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4193,12 +4182,11 @@ func (c *ProjectsTenantsCompaniesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4326,12 +4314,11 @@ func (c *ProjectsTenantsCompaniesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/companies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4458,8 +4445,7 @@ func (c *ProjectsTenantsCompaniesPatchCall) Header() http.Header { func (c *ProjectsTenantsCompaniesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.company) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.company) if err != nil { return nil, err } @@ -4561,8 +4547,7 @@ func (c *ProjectsTenantsJobsBatchCreateCall) Header() http.Header { func (c *ProjectsTenantsJobsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatejobsrequest) if err != nil { return nil, err } @@ -4665,8 +4650,7 @@ func (c *ProjectsTenantsJobsBatchDeleteCall) Header() http.Header { func (c *ProjectsTenantsJobsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletejobsrequest) if err != nil { return nil, err } @@ -4768,8 +4752,7 @@ func (c *ProjectsTenantsJobsBatchUpdateCall) Header() http.Header { func (c *ProjectsTenantsJobsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatejobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatejobsrequest) if err != nil { return nil, err } @@ -4872,8 +4855,7 @@ func (c *ProjectsTenantsJobsCreateCall) Header() http.Header { func (c *ProjectsTenantsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -4974,12 +4956,11 @@ func (c *ProjectsTenantsJobsDeleteCall) Header() http.Header { func (c *ProjectsTenantsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5084,12 +5065,11 @@ func (c *ProjectsTenantsJobsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5256,12 +5236,11 @@ func (c *ProjectsTenantsJobsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5391,8 +5370,7 @@ func (c *ProjectsTenantsJobsPatchCall) Header() http.Header { func (c *ProjectsTenantsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -5496,8 +5474,7 @@ func (c *ProjectsTenantsJobsSearchCall) Header() http.Header { func (c *ProjectsTenantsJobsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchjobsrequest) if err != nil { return nil, err } @@ -5627,8 +5604,7 @@ func (c *ProjectsTenantsJobsSearchForAlertCall) Header() http.Header { func (c *ProjectsTenantsJobsSearchForAlertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchjobsrequest) if err != nil { return nil, err } diff --git a/keep/v1/keep-gen.go b/keep/v1/keep-gen.go index ec4001a53d3..54f524d2908 100644 --- a/keep/v1/keep-gen.go +++ b/keep/v1/keep-gen.go @@ -123,7 +123,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Media = NewMediaService(s) + s.Notes = NewNotesService(s) if err != nil { return nil, err } @@ -142,10 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Media = NewMediaService(s) - s.Notes = NewNotesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -667,12 +666,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -776,8 +774,7 @@ func (c *NotesCreateCall) Header() http.Header { func (c *NotesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.note) if err != nil { return nil, err } @@ -874,12 +871,11 @@ func (c *NotesDeleteCall) Header() http.Header { func (c *NotesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -981,12 +977,11 @@ func (c *NotesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1115,12 +1110,11 @@ func (c *NotesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/notes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1235,8 +1229,7 @@ func (c *NotesPermissionsBatchCreateCall) Header() http.Header { func (c *NotesPermissionsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatepermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatepermissionsrequest) if err != nil { return nil, err } @@ -1344,8 +1337,7 @@ func (c *NotesPermissionsBatchDeleteCall) Header() http.Header { func (c *NotesPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletepermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletepermissionsrequest) if err != nil { return nil, err } diff --git a/kgsearch/v1/kgsearch-gen.go b/kgsearch/v1/kgsearch-gen.go index 482ab150476..fcc7f5d9416 100644 --- a/kgsearch/v1/kgsearch-gen.go +++ b/kgsearch/v1/kgsearch-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Entities = NewEntitiesService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Entities = NewEntitiesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -281,12 +280,11 @@ func (c *EntitiesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entities:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/kmsinventory/v1/kmsinventory-gen.go b/kmsinventory/v1/kmsinventory-gen.go index fb9c82de902..a7bbf7d4538 100644 --- a/kmsinventory/v1/kmsinventory-gen.go +++ b/kmsinventory/v1/kmsinventory-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1023,12 +1022,11 @@ func (c *OrganizationsProtectedResourcesSearchCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}/protectedResources:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1171,12 +1169,11 @@ func (c *ProjectsCryptoKeysListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1304,12 +1301,11 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/protectedResourcesSummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/language/v1/language-gen.go b/language/v1/language-gen.go index 8a9a89cfe45..6292b4fb1de 100644 --- a/language/v1/language-gen.go +++ b/language/v1/language-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Documents = NewDocumentsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Documents = NewDocumentsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6269,8 +6268,7 @@ func (c *DocumentsAnalyzeEntitiesCall) Header() http.Header { func (c *DocumentsAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitiesrequest) if err != nil { return nil, err } @@ -6365,8 +6363,7 @@ func (c *DocumentsAnalyzeEntitySentimentCall) Header() http.Header { func (c *DocumentsAnalyzeEntitySentimentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitysentimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitysentimentrequest) if err != nil { return nil, err } @@ -6460,8 +6457,7 @@ func (c *DocumentsAnalyzeSentimentCall) Header() http.Header { func (c *DocumentsAnalyzeSentimentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesentimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzesentimentrequest) if err != nil { return nil, err } @@ -6557,8 +6553,7 @@ func (c *DocumentsAnalyzeSyntaxCall) Header() http.Header { func (c *DocumentsAnalyzeSyntaxCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesyntaxrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzesyntaxrequest) if err != nil { return nil, err } @@ -6653,8 +6648,7 @@ func (c *DocumentsAnnotateTextCall) Header() http.Header { func (c *DocumentsAnnotateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotatetextrequest) if err != nil { return nil, err } @@ -6748,8 +6742,7 @@ func (c *DocumentsClassifyTextCall) Header() http.Header { func (c *DocumentsClassifyTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.classifytextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.classifytextrequest) if err != nil { return nil, err } @@ -6843,8 +6836,7 @@ func (c *DocumentsModerateTextCall) Header() http.Header { func (c *DocumentsModerateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moderatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moderatetextrequest) if err != nil { return nil, err } diff --git a/language/v1beta2/language-gen.go b/language/v1beta2/language-gen.go index 59f4580fc7c..5e94aecea7e 100644 --- a/language/v1beta2/language-gen.go +++ b/language/v1beta2/language-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Documents = NewDocumentsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Documents = NewDocumentsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6281,8 +6280,7 @@ func (c *DocumentsAnalyzeEntitiesCall) Header() http.Header { func (c *DocumentsAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitiesrequest) if err != nil { return nil, err } @@ -6377,8 +6375,7 @@ func (c *DocumentsAnalyzeEntitySentimentCall) Header() http.Header { func (c *DocumentsAnalyzeEntitySentimentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitysentimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitysentimentrequest) if err != nil { return nil, err } @@ -6472,8 +6469,7 @@ func (c *DocumentsAnalyzeSentimentCall) Header() http.Header { func (c *DocumentsAnalyzeSentimentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesentimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzesentimentrequest) if err != nil { return nil, err } @@ -6569,8 +6565,7 @@ func (c *DocumentsAnalyzeSyntaxCall) Header() http.Header { func (c *DocumentsAnalyzeSyntaxCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesyntaxrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzesyntaxrequest) if err != nil { return nil, err } @@ -6665,8 +6660,7 @@ func (c *DocumentsAnnotateTextCall) Header() http.Header { func (c *DocumentsAnnotateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotatetextrequest) if err != nil { return nil, err } @@ -6760,8 +6754,7 @@ func (c *DocumentsClassifyTextCall) Header() http.Header { func (c *DocumentsClassifyTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.classifytextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.classifytextrequest) if err != nil { return nil, err } @@ -6855,8 +6848,7 @@ func (c *DocumentsModerateTextCall) Header() http.Header { func (c *DocumentsModerateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moderatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moderatetextrequest) if err != nil { return nil, err } diff --git a/language/v2/language-gen.go b/language/v2/language-gen.go index 919dd2b5cb8..a3df21d3e02 100644 --- a/language/v2/language-gen.go +++ b/language/v2/language-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Documents = NewDocumentsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Documents = NewDocumentsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5791,8 +5790,7 @@ func (c *DocumentsAnalyzeEntitiesCall) Header() http.Header { func (c *DocumentsAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzeentitiesrequest) if err != nil { return nil, err } @@ -5886,8 +5884,7 @@ func (c *DocumentsAnalyzeSentimentCall) Header() http.Header { func (c *DocumentsAnalyzeSentimentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesentimentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzesentimentrequest) if err != nil { return nil, err } @@ -5981,8 +5978,7 @@ func (c *DocumentsAnnotateTextCall) Header() http.Header { func (c *DocumentsAnnotateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotatetextrequest) if err != nil { return nil, err } @@ -6076,8 +6072,7 @@ func (c *DocumentsClassifyTextCall) Header() http.Header { func (c *DocumentsClassifyTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.classifytextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.classifytextrequest) if err != nil { return nil, err } @@ -6171,8 +6166,7 @@ func (c *DocumentsModerateTextCall) Header() http.Header { func (c *DocumentsModerateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moderatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moderatetextrequest) if err != nil { return nil, err } diff --git a/libraryagent/v1/libraryagent-gen.go b/libraryagent/v1/libraryagent-gen.go index 6767c4e6ded..f32aa6f636a 100644 --- a/libraryagent/v1/libraryagent-gen.go +++ b/libraryagent/v1/libraryagent-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Shelves = NewShelvesService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Shelves = NewShelvesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -351,12 +350,11 @@ func (c *ShelvesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -473,12 +471,11 @@ func (c *ShelvesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/shelves") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -590,12 +587,11 @@ func (c *ShelvesBooksBorrowCall) Header() http.Header { func (c *ShelvesBooksBorrowCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:borrow") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -698,12 +694,11 @@ func (c *ShelvesBooksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -825,12 +820,11 @@ func (c *ShelvesBooksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/books") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -944,12 +938,11 @@ func (c *ShelvesBooksReturnCall) Header() http.Header { func (c *ShelvesBooksReturnCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:return") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/licensing/v1/licensing-gen.go b/licensing/v1/licensing-gen.go index 4cdf29b165c..9be5c699fba 100644 --- a/licensing/v1/licensing-gen.go +++ b/licensing/v1/licensing-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.LicenseAssignments = NewLicenseAssignmentsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.LicenseAssignments = NewLicenseAssignmentsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -326,12 +325,11 @@ func (c *LicenseAssignmentsDeleteCall) Header() http.Header { func (c *LicenseAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -447,12 +445,11 @@ func (c *LicenseAssignmentsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -552,8 +549,7 @@ func (c *LicenseAssignmentsInsertCall) Header() http.Header { func (c *LicenseAssignmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.licenseassignmentinsert) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.licenseassignmentinsert) if err != nil { return nil, err } @@ -688,12 +684,11 @@ func (c *LicenseAssignmentsListForProductCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/licensing/v1/product/{productId}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -845,12 +840,11 @@ func (c *LicenseAssignmentsListForProductAndSkuCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/licensing/v1/product/{productId}/sku/{skuId}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -978,8 +972,7 @@ func (c *LicenseAssignmentsPatchCall) Header() http.Header { func (c *LicenseAssignmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.licenseassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.licenseassignment) if err != nil { return nil, err } @@ -1095,8 +1088,7 @@ func (c *LicenseAssignmentsUpdateCall) Header() http.Header { func (c *LicenseAssignmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.licenseassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.licenseassignment) if err != nil { return nil, err } diff --git a/lifesciences/v2beta/lifesciences-gen.go b/lifesciences/v2beta/lifesciences-gen.go index 903c77f4b20..0bf2d8776f2 100644 --- a/lifesciences/v2beta/lifesciences-gen.go +++ b/lifesciences/v2beta/lifesciences-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1520,12 +1519,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1651,12 +1649,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1776,8 +1773,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1890,12 +1886,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2027,12 +2022,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2157,8 +2151,7 @@ func (c *ProjectsLocationsPipelinesRunCall) Header() http.Header { func (c *ProjectsLocationsPipelinesRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runpipelinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runpipelinerequest) if err != nil { return nil, err } diff --git a/localservices/v1/localservices-gen.go b/localservices/v1/localservices-gen.go index cfc5be7d02f..c7be6d119d2 100644 --- a/localservices/v1/localservices-gen.go +++ b/localservices/v1/localservices-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AccountReports = NewAccountReportsService(s) + s.DetailedLeadReports = NewDetailedLeadReportsService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AccountReports = NewAccountReportsService(s) - s.DetailedLeadReports = NewDetailedLeadReportsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -680,12 +679,11 @@ func (c *AccountReportsSearchCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accountReports:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -878,12 +876,11 @@ func (c *DetailedLeadReportsSearchCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/detailedLeadReports:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/logging/v2/logging-gen.go b/logging/v2/logging-gen.go index b0088107928..9484a1d7e22 100644 --- a/logging/v2/logging-gen.go +++ b/logging/v2/logging-gen.go @@ -139,7 +139,18 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) + s.Entries = NewEntriesService(s) + s.Exclusions = NewExclusionsService(s) + s.Folders = NewFoldersService(s) + s.Locations = NewLocationsService(s) + s.Logs = NewLogsService(s) + s.MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + s.Sinks = NewSinksService(s) + s.V2 = NewV2Service(s) if err != nil { return nil, err } @@ -158,19 +169,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - s.Entries = NewEntriesService(s) - s.Exclusions = NewExclusionsService(s) - s.Folders = NewFoldersService(s) - s.Locations = NewLocationsService(s) - s.Logs = NewLogsService(s) - s.MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - s.Sinks = NewSinksService(s) - s.V2 = NewV2Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4778,12 +4777,11 @@ func (c *BillingAccountsGetCmekSettingsCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4895,12 +4893,11 @@ func (c *BillingAccountsGetSettingsCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4997,8 +4994,7 @@ func (c *BillingAccountsExclusionsCreateCall) Header() http.Header { func (c *BillingAccountsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -5101,12 +5097,11 @@ func (c *BillingAccountsExclusionsDeleteCall) Header() http.Header { func (c *BillingAccountsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5213,12 +5208,11 @@ func (c *BillingAccountsExclusionsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5340,12 +5334,11 @@ func (c *BillingAccountsExclusionsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5476,8 +5469,7 @@ func (c *BillingAccountsExclusionsPatchCall) Header() http.Header { func (c *BillingAccountsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -5587,12 +5579,11 @@ func (c *BillingAccountsLocationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5718,12 +5709,11 @@ func (c *BillingAccountsLocationsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5849,8 +5839,7 @@ func (c *BillingAccountsLocationsBucketsCreateCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -5963,8 +5952,7 @@ func (c *BillingAccountsLocationsBucketsCreateAsyncCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -6070,12 +6058,11 @@ func (c *BillingAccountsLocationsBucketsDeleteCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6183,12 +6170,11 @@ func (c *BillingAccountsLocationsBucketsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6314,12 +6300,11 @@ func (c *BillingAccountsLocationsBucketsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6452,8 +6437,7 @@ func (c *BillingAccountsLocationsBucketsPatchCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -6560,8 +6544,7 @@ func (c *BillingAccountsLocationsBucketsUndeleteCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletebucketrequest) if err != nil { return nil, err } @@ -6681,8 +6664,7 @@ func (c *BillingAccountsLocationsBucketsUpdateAsyncCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -6797,8 +6779,7 @@ func (c *BillingAccountsLocationsBucketsLinksCreateCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.link) if err != nil { return nil, err } @@ -6905,12 +6886,11 @@ func (c *BillingAccountsLocationsBucketsLinksDeleteCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7020,12 +7000,11 @@ func (c *BillingAccountsLocationsBucketsLinksGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7147,12 +7126,11 @@ func (c *BillingAccountsLocationsBucketsLinksListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7277,8 +7255,7 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -7382,12 +7359,11 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7493,12 +7469,11 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7619,12 +7594,11 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7757,8 +7731,7 @@ func (c *BillingAccountsLocationsBucketsViewsPatchCall) Header() http.Header { func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -7907,12 +7880,11 @@ func (c *BillingAccountsLocationsBucketsViewsLogsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8034,8 +8006,7 @@ func (c *BillingAccountsLocationsOperationsCancelCall) Header() http.Header { func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -8147,12 +8118,11 @@ func (c *BillingAccountsLocationsOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8275,12 +8245,11 @@ func (c *BillingAccountsLocationsOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8439,12 +8408,11 @@ func (c *BillingAccountsLocationsRecentQueriesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8576,8 +8544,7 @@ func (c *BillingAccountsLocationsSavedQueriesCreateCall) Header() http.Header { func (c *BillingAccountsLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -8684,12 +8651,11 @@ func (c *BillingAccountsLocationsSavedQueriesDeleteCall) Header() http.Header { func (c *BillingAccountsLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8799,12 +8765,11 @@ func (c *BillingAccountsLocationsSavedQueriesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8948,12 +8913,11 @@ func (c *BillingAccountsLocationsSavedQueriesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9085,8 +9049,7 @@ func (c *BillingAccountsLocationsSavedQueriesPatchCall) Header() http.Header { func (c *BillingAccountsLocationsSavedQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -9194,12 +9157,11 @@ func (c *BillingAccountsLogsDeleteCall) Header() http.Header { func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9340,12 +9302,11 @@ func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9493,8 +9454,7 @@ func (c *BillingAccountsSinksCreateCall) Header() http.Header { func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -9599,12 +9559,11 @@ func (c *BillingAccountsSinksDeleteCall) Header() http.Header { func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9711,12 +9670,11 @@ func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9851,12 +9809,11 @@ func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10020,8 +9977,7 @@ func (c *BillingAccountsSinksPatchCall) Header() http.Header { func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -10171,8 +10127,7 @@ func (c *BillingAccountsSinksUpdateCall) Header() http.Header { func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -10269,8 +10224,7 @@ func (c *EntriesCopyCall) Header() http.Header { func (c *EntriesCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copylogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.copylogentriesrequest) if err != nil { return nil, err } @@ -10366,8 +10320,7 @@ func (c *EntriesListCall) Header() http.Header { func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.listlogentriesrequest) if err != nil { return nil, err } @@ -10483,8 +10436,7 @@ func (c *EntriesTailCall) Header() http.Header { func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.taillogentriesrequest) if err != nil { return nil, err } @@ -10584,8 +10536,7 @@ func (c *EntriesWriteCall) Header() http.Header { func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writelogentriesrequest) if err != nil { return nil, err } @@ -10688,8 +10639,7 @@ func (c *ExclusionsCreateCall) Header() http.Header { func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -10792,12 +10742,11 @@ func (c *ExclusionsDeleteCall) Header() http.Header { func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10904,12 +10853,11 @@ func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11031,12 +10979,11 @@ func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11167,8 +11114,7 @@ func (c *ExclusionsPatchCall) Header() http.Header { func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -11292,12 +11238,11 @@ func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11409,12 +11354,11 @@ func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11528,8 +11472,7 @@ func (c *FoldersUpdateSettingsCall) Header() http.Header { func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } @@ -11634,8 +11577,7 @@ func (c *FoldersExclusionsCreateCall) Header() http.Header { func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -11738,12 +11680,11 @@ func (c *FoldersExclusionsDeleteCall) Header() http.Header { func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11850,12 +11791,11 @@ func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11977,12 +11917,11 @@ func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12113,8 +12052,7 @@ func (c *FoldersExclusionsPatchCall) Header() http.Header { func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -12224,12 +12162,11 @@ func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12355,12 +12292,11 @@ func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12486,8 +12422,7 @@ func (c *FoldersLocationsBucketsCreateCall) Header() http.Header { func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -12600,8 +12535,7 @@ func (c *FoldersLocationsBucketsCreateAsyncCall) Header() http.Header { func (c *FoldersLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -12707,12 +12641,11 @@ func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header { func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12820,12 +12753,11 @@ func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12951,12 +12883,11 @@ func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13089,8 +13020,7 @@ func (c *FoldersLocationsBucketsPatchCall) Header() http.Header { func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -13197,8 +13127,7 @@ func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header { func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletebucketrequest) if err != nil { return nil, err } @@ -13318,8 +13247,7 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Header() http.Header { func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -13434,8 +13362,7 @@ func (c *FoldersLocationsBucketsLinksCreateCall) Header() http.Header { func (c *FoldersLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.link) if err != nil { return nil, err } @@ -13542,12 +13469,11 @@ func (c *FoldersLocationsBucketsLinksDeleteCall) Header() http.Header { func (c *FoldersLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13657,12 +13583,11 @@ func (c *FoldersLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13784,12 +13709,11 @@ func (c *FoldersLocationsBucketsLinksListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13914,8 +13838,7 @@ func (c *FoldersLocationsBucketsViewsCreateCall) Header() http.Header { func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -14019,12 +13942,11 @@ func (c *FoldersLocationsBucketsViewsDeleteCall) Header() http.Header { func (c *FoldersLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14130,12 +14052,11 @@ func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14230,8 +14151,7 @@ func (c *FoldersLocationsBucketsViewsGetIamPolicyCall) Header() http.Header { func (c *FoldersLocationsBucketsViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -14360,12 +14280,11 @@ func (c *FoldersLocationsBucketsViewsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14498,8 +14417,7 @@ func (c *FoldersLocationsBucketsViewsPatchCall) Header() http.Header { func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -14603,8 +14521,7 @@ func (c *FoldersLocationsBucketsViewsSetIamPolicyCall) Header() http.Header { func (c *FoldersLocationsBucketsViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -14711,8 +14628,7 @@ func (c *FoldersLocationsBucketsViewsTestIamPermissionsCall) Header() http.Heade func (c *FoldersLocationsBucketsViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -14862,12 +14778,11 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14992,8 +14907,7 @@ func (c *FoldersLocationsLogScopesCreateCall) Header() http.Header { func (c *FoldersLocationsLogScopesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logscope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logscope) if err != nil { return nil, err } @@ -15093,12 +15007,11 @@ func (c *FoldersLocationsLogScopesDeleteCall) Header() http.Header { func (c *FoldersLocationsLogScopesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15202,12 +15115,11 @@ func (c *FoldersLocationsLogScopesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15328,12 +15240,11 @@ func (c *FoldersLocationsLogScopesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logScopes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15460,8 +15371,7 @@ func (c *FoldersLocationsLogScopesPatchCall) Header() http.Header { func (c *FoldersLocationsLogScopesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logscope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logscope) if err != nil { return nil, err } @@ -15569,8 +15479,7 @@ func (c *FoldersLocationsOperationsCancelCall) Header() http.Header { func (c *FoldersLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -15682,12 +15591,11 @@ func (c *FoldersLocationsOperationsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15810,12 +15718,11 @@ func (c *FoldersLocationsOperationsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15974,12 +15881,11 @@ func (c *FoldersLocationsRecentQueriesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16111,8 +16017,7 @@ func (c *FoldersLocationsSavedQueriesCreateCall) Header() http.Header { func (c *FoldersLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -16219,12 +16124,11 @@ func (c *FoldersLocationsSavedQueriesDeleteCall) Header() http.Header { func (c *FoldersLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16334,12 +16238,11 @@ func (c *FoldersLocationsSavedQueriesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16483,12 +16386,11 @@ func (c *FoldersLocationsSavedQueriesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16620,8 +16522,7 @@ func (c *FoldersLocationsSavedQueriesPatchCall) Header() http.Header { func (c *FoldersLocationsSavedQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -16729,12 +16630,11 @@ func (c *FoldersLogsDeleteCall) Header() http.Header { func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16875,12 +16775,11 @@ func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17028,8 +16927,7 @@ func (c *FoldersSinksCreateCall) Header() http.Header { func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -17134,12 +17032,11 @@ func (c *FoldersSinksDeleteCall) Header() http.Header { func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17246,12 +17143,11 @@ func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17386,12 +17282,11 @@ func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17555,8 +17450,7 @@ func (c *FoldersSinksPatchCall) Header() http.Header { func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -17706,8 +17600,7 @@ func (c *FoldersSinksUpdateCall) Header() http.Header { func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -17817,12 +17710,11 @@ func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17948,12 +17840,11 @@ func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18079,8 +17970,7 @@ func (c *LocationsBucketsCreateCall) Header() http.Header { func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -18193,8 +18083,7 @@ func (c *LocationsBucketsCreateAsyncCall) Header() http.Header { func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -18300,12 +18189,11 @@ func (c *LocationsBucketsDeleteCall) Header() http.Header { func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18413,12 +18301,11 @@ func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18544,12 +18431,11 @@ func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18682,8 +18568,7 @@ func (c *LocationsBucketsPatchCall) Header() http.Header { func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -18790,8 +18675,7 @@ func (c *LocationsBucketsUndeleteCall) Header() http.Header { func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletebucketrequest) if err != nil { return nil, err } @@ -18911,8 +18795,7 @@ func (c *LocationsBucketsUpdateAsyncCall) Header() http.Header { func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -19027,8 +18910,7 @@ func (c *LocationsBucketsLinksCreateCall) Header() http.Header { func (c *LocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.link) if err != nil { return nil, err } @@ -19135,12 +19017,11 @@ func (c *LocationsBucketsLinksDeleteCall) Header() http.Header { func (c *LocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19250,12 +19131,11 @@ func (c *LocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19377,12 +19257,11 @@ func (c *LocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19507,8 +19386,7 @@ func (c *LocationsBucketsViewsCreateCall) Header() http.Header { func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -19612,12 +19490,11 @@ func (c *LocationsBucketsViewsDeleteCall) Header() http.Header { func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19723,12 +19600,11 @@ func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19823,8 +19699,7 @@ func (c *LocationsBucketsViewsGetIamPolicyCall) Header() http.Header { func (c *LocationsBucketsViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -19953,12 +19828,11 @@ func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20091,8 +19965,7 @@ func (c *LocationsBucketsViewsPatchCall) Header() http.Header { func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -20196,8 +20069,7 @@ func (c *LocationsBucketsViewsSetIamPolicyCall) Header() http.Header { func (c *LocationsBucketsViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -20304,8 +20176,7 @@ func (c *LocationsBucketsViewsTestIamPermissionsCall) Header() http.Header { func (c *LocationsBucketsViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -20414,8 +20285,7 @@ func (c *LocationsOperationsCancelCall) Header() http.Header { func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -20527,12 +20397,11 @@ func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20655,12 +20524,11 @@ func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20782,12 +20650,11 @@ func (c *LogsDeleteCall) Header() http.Header { func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20928,12 +20795,11 @@ func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21071,12 +20937,11 @@ func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21211,12 +21076,11 @@ func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21328,12 +21192,11 @@ func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21452,8 +21315,7 @@ func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header { func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cmeksettings) if err != nil { return nil, err } @@ -21575,8 +21437,7 @@ func (c *OrganizationsUpdateSettingsCall) Header() http.Header { func (c *OrganizationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } @@ -21681,8 +21542,7 @@ func (c *OrganizationsExclusionsCreateCall) Header() http.Header { func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -21785,12 +21645,11 @@ func (c *OrganizationsExclusionsDeleteCall) Header() http.Header { func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21897,12 +21756,11 @@ func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22024,12 +21882,11 @@ func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22160,8 +22017,7 @@ func (c *OrganizationsExclusionsPatchCall) Header() http.Header { func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -22271,12 +22127,11 @@ func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22402,12 +22257,11 @@ func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22533,8 +22387,7 @@ func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header { func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -22647,8 +22500,7 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Header() http.Header { func (c *OrganizationsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -22754,12 +22606,11 @@ func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22867,12 +22718,11 @@ func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22998,12 +22848,11 @@ func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23136,8 +22985,7 @@ func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header { func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -23244,8 +23092,7 @@ func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header { func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletebucketrequest) if err != nil { return nil, err } @@ -23365,8 +23212,7 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Header() http.Header { func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -23481,8 +23327,7 @@ func (c *OrganizationsLocationsBucketsLinksCreateCall) Header() http.Header { func (c *OrganizationsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.link) if err != nil { return nil, err } @@ -23589,12 +23434,11 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) Header() http.Header { func (c *OrganizationsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23704,12 +23548,11 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23831,12 +23674,11 @@ func (c *OrganizationsLocationsBucketsLinksListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23961,8 +23803,7 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header { func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -24066,12 +23907,11 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -24177,12 +24017,11 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24277,8 +24116,7 @@ func (c *OrganizationsLocationsBucketsViewsGetIamPolicyCall) Header() http.Heade func (c *OrganizationsLocationsBucketsViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -24407,12 +24245,11 @@ func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24545,8 +24382,7 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header { func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -24650,8 +24486,7 @@ func (c *OrganizationsLocationsBucketsViewsSetIamPolicyCall) Header() http.Heade func (c *OrganizationsLocationsBucketsViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -24758,8 +24593,7 @@ func (c *OrganizationsLocationsBucketsViewsTestIamPermissionsCall) Header() http func (c *OrganizationsLocationsBucketsViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -24909,12 +24743,11 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25039,8 +24872,7 @@ func (c *OrganizationsLocationsLogScopesCreateCall) Header() http.Header { func (c *OrganizationsLocationsLogScopesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logscope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logscope) if err != nil { return nil, err } @@ -25140,12 +24972,11 @@ func (c *OrganizationsLocationsLogScopesDeleteCall) Header() http.Header { func (c *OrganizationsLocationsLogScopesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -25249,12 +25080,11 @@ func (c *OrganizationsLocationsLogScopesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25375,12 +25205,11 @@ func (c *OrganizationsLocationsLogScopesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logScopes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25507,8 +25336,7 @@ func (c *OrganizationsLocationsLogScopesPatchCall) Header() http.Header { func (c *OrganizationsLocationsLogScopesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logscope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logscope) if err != nil { return nil, err } @@ -25616,8 +25444,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -25729,12 +25556,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25857,12 +25683,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26021,12 +25846,11 @@ func (c *OrganizationsLocationsRecentQueriesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26158,8 +25982,7 @@ func (c *OrganizationsLocationsSavedQueriesCreateCall) Header() http.Header { func (c *OrganizationsLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -26266,12 +26089,11 @@ func (c *OrganizationsLocationsSavedQueriesDeleteCall) Header() http.Header { func (c *OrganizationsLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26381,12 +26203,11 @@ func (c *OrganizationsLocationsSavedQueriesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26530,12 +26351,11 @@ func (c *OrganizationsLocationsSavedQueriesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26667,8 +26487,7 @@ func (c *OrganizationsLocationsSavedQueriesPatchCall) Header() http.Header { func (c *OrganizationsLocationsSavedQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -26776,12 +26595,11 @@ func (c *OrganizationsLogsDeleteCall) Header() http.Header { func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -26922,12 +26740,11 @@ func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27075,8 +26892,7 @@ func (c *OrganizationsSinksCreateCall) Header() http.Header { func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -27181,12 +26997,11 @@ func (c *OrganizationsSinksDeleteCall) Header() http.Header { func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -27293,12 +27108,11 @@ func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27433,12 +27247,11 @@ func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27602,8 +27415,7 @@ func (c *OrganizationsSinksPatchCall) Header() http.Header { func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -27753,8 +27565,7 @@ func (c *OrganizationsSinksUpdateCall) Header() http.Header { func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -27878,12 +27689,11 @@ func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27995,12 +27805,11 @@ func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28097,8 +27906,7 @@ func (c *ProjectsExclusionsCreateCall) Header() http.Header { func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -28201,12 +28009,11 @@ func (c *ProjectsExclusionsDeleteCall) Header() http.Header { func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28313,12 +28120,11 @@ func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28440,12 +28246,11 @@ func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28576,8 +28381,7 @@ func (c *ProjectsExclusionsPatchCall) Header() http.Header { func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logexclusion) if err != nil { return nil, err } @@ -28687,12 +28491,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28818,12 +28621,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28949,8 +28751,7 @@ func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header { func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -29063,8 +28864,7 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Header() http.Header { func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -29170,12 +28970,11 @@ func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29283,12 +29082,11 @@ func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29414,12 +29212,11 @@ func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29552,8 +29349,7 @@ func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header { func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -29660,8 +29456,7 @@ func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header { func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletebucketrequest) if err != nil { return nil, err } @@ -29781,8 +29576,7 @@ func (c *ProjectsLocationsBucketsUpdateAsyncCall) Header() http.Header { func (c *ProjectsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logbucket) if err != nil { return nil, err } @@ -29897,8 +29691,7 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) Header() http.Header { func (c *ProjectsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.link) if err != nil { return nil, err } @@ -30005,12 +29798,11 @@ func (c *ProjectsLocationsBucketsLinksDeleteCall) Header() http.Header { func (c *ProjectsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30120,12 +29912,11 @@ func (c *ProjectsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30247,12 +30038,11 @@ func (c *ProjectsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30377,8 +30167,7 @@ func (c *ProjectsLocationsBucketsViewsCreateCall) Header() http.Header { func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -30482,12 +30271,11 @@ func (c *ProjectsLocationsBucketsViewsDeleteCall) Header() http.Header { func (c *ProjectsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30593,12 +30381,11 @@ func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30693,8 +30480,7 @@ func (c *ProjectsLocationsBucketsViewsGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsBucketsViewsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -30823,12 +30609,11 @@ func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30961,8 +30746,7 @@ func (c *ProjectsLocationsBucketsViewsPatchCall) Header() http.Header { func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logview) if err != nil { return nil, err } @@ -31066,8 +30850,7 @@ func (c *ProjectsLocationsBucketsViewsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsBucketsViewsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -31174,8 +30957,7 @@ func (c *ProjectsLocationsBucketsViewsTestIamPermissionsCall) Header() http.Head func (c *ProjectsLocationsBucketsViewsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -31325,12 +31107,11 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31455,8 +31236,7 @@ func (c *ProjectsLocationsLogScopesCreateCall) Header() http.Header { func (c *ProjectsLocationsLogScopesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logscope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logscope) if err != nil { return nil, err } @@ -31556,12 +31336,11 @@ func (c *ProjectsLocationsLogScopesDeleteCall) Header() http.Header { func (c *ProjectsLocationsLogScopesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31665,12 +31444,11 @@ func (c *ProjectsLocationsLogScopesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31791,12 +31569,11 @@ func (c *ProjectsLocationsLogScopesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logScopes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31923,8 +31700,7 @@ func (c *ProjectsLocationsLogScopesPatchCall) Header() http.Header { func (c *ProjectsLocationsLogScopesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logscope) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logscope) if err != nil { return nil, err } @@ -32032,8 +31808,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -32145,12 +31920,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32273,12 +32047,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32437,12 +32210,11 @@ func (c *ProjectsLocationsRecentQueriesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32574,8 +32346,7 @@ func (c *ProjectsLocationsSavedQueriesCreateCall) Header() http.Header { func (c *ProjectsLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -32682,12 +32453,11 @@ func (c *ProjectsLocationsSavedQueriesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -32797,12 +32567,11 @@ func (c *ProjectsLocationsSavedQueriesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32946,12 +32715,11 @@ func (c *ProjectsLocationsSavedQueriesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33083,8 +32851,7 @@ func (c *ProjectsLocationsSavedQueriesPatchCall) Header() http.Header { func (c *ProjectsLocationsSavedQueriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -33192,12 +32959,11 @@ func (c *ProjectsLogsDeleteCall) Header() http.Header { func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33338,12 +33104,11 @@ func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33458,8 +33223,7 @@ func (c *ProjectsMetricsCreateCall) Header() http.Header { func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logmetric) if err != nil { return nil, err } @@ -33558,12 +33322,11 @@ func (c *ProjectsMetricsDeleteCall) Header() http.Header { func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -33666,12 +33429,11 @@ func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33792,12 +33554,11 @@ func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33915,8 +33676,7 @@ func (c *ProjectsMetricsUpdateCall) Header() http.Header { func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logmetric) if err != nil { return nil, err } @@ -34050,8 +33810,7 @@ func (c *ProjectsSinksCreateCall) Header() http.Header { func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -34156,12 +33915,11 @@ func (c *ProjectsSinksDeleteCall) Header() http.Header { func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -34268,12 +34026,11 @@ func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34408,12 +34165,11 @@ func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -34577,8 +34333,7 @@ func (c *ProjectsSinksPatchCall) Header() http.Header { func (c *ProjectsSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -34728,8 +34483,7 @@ func (c *ProjectsSinksUpdateCall) Header() http.Header { func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -34863,8 +34617,7 @@ func (c *SinksCreateCall) Header() http.Header { func (c *SinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -34969,12 +34722,11 @@ func (c *SinksDeleteCall) Header() http.Header { func (c *SinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -35081,12 +34833,11 @@ func (c *SinksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35221,12 +34972,11 @@ func (c *SinksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35390,8 +35140,7 @@ func (c *SinksUpdateCall) Header() http.Header { func (c *SinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.logsink) if err != nil { return nil, err } @@ -35515,12 +35264,11 @@ func (c *V2GetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35632,12 +35380,11 @@ func (c *V2GetSettingsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -35756,8 +35503,7 @@ func (c *V2UpdateCmekSettingsCall) Header() http.Header { func (c *V2UpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cmeksettings) if err != nil { return nil, err } @@ -35879,8 +35625,7 @@ func (c *V2UpdateSettingsCall) Header() http.Header { func (c *V2UpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } diff --git a/looker/v1/looker-gen.go b/looker/v1/looker-gen.go index 6b21970289f..bdbac2ab93a 100644 --- a/looker/v1/looker-gen.go +++ b/looker/v1/looker-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1551,12 +1550,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1682,12 +1680,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1810,8 +1807,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -1917,12 +1913,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2015,8 +2010,7 @@ func (c *ProjectsLocationsInstancesExportCall) Header() http.Header { func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportinstancerequest) if err != nil { return nil, err } @@ -2127,12 +2121,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2254,12 +2247,11 @@ func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2352,8 +2344,7 @@ func (c *ProjectsLocationsInstancesImportCall) Header() http.Header { func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importinstancerequest) if err != nil { return nil, err } @@ -2478,12 +2469,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2607,8 +2597,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2709,8 +2698,7 @@ func (c *ProjectsLocationsInstancesRestartCall) Header() http.Header { func (c *ProjectsLocationsInstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest) if err != nil { return nil, err } @@ -2814,8 +2802,7 @@ func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2922,8 +2909,7 @@ func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3054,12 +3040,11 @@ func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3155,8 +3140,7 @@ func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3263,8 +3247,7 @@ func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3373,8 +3356,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3475,12 +3457,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3584,12 +3565,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3712,12 +3692,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/managedidentities/v1/managedidentities-gen.go b/managedidentities/v1/managedidentities-gen.go index 883a24130c9..f4ec8bb32f3 100644 --- a/managedidentities/v1/managedidentities-gen.go +++ b/managedidentities/v1/managedidentities-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2511,12 +2510,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2642,12 +2640,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2762,8 +2759,7 @@ func (c *ProjectsLocationsGlobalDomainsAttachTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsAttachTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attachtrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attachtrustrequest) if err != nil { return nil, err } @@ -2865,8 +2861,7 @@ func (c *ProjectsLocationsGlobalDomainsCheckMigrationPermissionCall) Header() ht func (c *ProjectsLocationsGlobalDomainsCheckMigrationPermissionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkmigrationpermissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkmigrationpermissionrequest) if err != nil { return nil, err } @@ -2981,8 +2976,7 @@ func (c *ProjectsLocationsGlobalDomainsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -3081,12 +3075,11 @@ func (c *ProjectsLocationsGlobalDomainsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3179,8 +3172,7 @@ func (c *ProjectsLocationsGlobalDomainsDetachTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsDetachTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detachtrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detachtrustrequest) if err != nil { return nil, err } @@ -3281,8 +3273,7 @@ func (c *ProjectsLocationsGlobalDomainsDisableMigrationCall) Header() http.Heade func (c *ProjectsLocationsGlobalDomainsDisableMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablemigrationrequest) if err != nil { return nil, err } @@ -3384,8 +3375,7 @@ func (c *ProjectsLocationsGlobalDomainsDomainJoinMachineCall) Header() http.Head func (c *ProjectsLocationsGlobalDomainsDomainJoinMachineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainjoinmachinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainjoinmachinerequest) if err != nil { return nil, err } @@ -3487,8 +3477,7 @@ func (c *ProjectsLocationsGlobalDomainsEnableMigrationCall) Header() http.Header func (c *ProjectsLocationsGlobalDomainsEnableMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablemigrationrequest) if err != nil { return nil, err } @@ -3589,8 +3578,7 @@ func (c *ProjectsLocationsGlobalDomainsExtendSchemaCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsExtendSchemaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.extendschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.extendschemarequest) if err != nil { return nil, err } @@ -3701,12 +3689,11 @@ func (c *ProjectsLocationsGlobalDomainsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3828,12 +3815,11 @@ func (c *ProjectsLocationsGlobalDomainsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3936,12 +3922,11 @@ func (c *ProjectsLocationsGlobalDomainsGetLdapssettingsCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/ldapssettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4077,12 +4062,11 @@ func (c *ProjectsLocationsGlobalDomainsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4206,8 +4190,7 @@ func (c *ProjectsLocationsGlobalDomainsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -4308,8 +4291,7 @@ func (c *ProjectsLocationsGlobalDomainsReconfigureTrustCall) Header() http.Heade func (c *ProjectsLocationsGlobalDomainsReconfigureTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reconfiguretrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reconfiguretrustrequest) if err != nil { return nil, err } @@ -4410,8 +4392,7 @@ func (c *ProjectsLocationsGlobalDomainsResetAdminPasswordCall) Header() http.Hea func (c *ProjectsLocationsGlobalDomainsResetAdminPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetadminpasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetadminpasswordrequest) if err != nil { return nil, err } @@ -4513,8 +4494,7 @@ func (c *ProjectsLocationsGlobalDomainsRestoreCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoredomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoredomainrequest) if err != nil { return nil, err } @@ -4618,8 +4598,7 @@ func (c *ProjectsLocationsGlobalDomainsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4726,8 +4705,7 @@ func (c *ProjectsLocationsGlobalDomainsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsGlobalDomainsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4838,8 +4816,7 @@ func (c *ProjectsLocationsGlobalDomainsUpdateLdapssettingsCall) Header() http.He func (c *ProjectsLocationsGlobalDomainsUpdateLdapssettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ldapssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ldapssettings) if err != nil { return nil, err } @@ -4941,8 +4918,7 @@ func (c *ProjectsLocationsGlobalDomainsValidateTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsValidateTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatetrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validatetrustrequest) if err != nil { return nil, err } @@ -5053,8 +5029,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5154,12 +5129,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5263,12 +5237,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5390,12 +5363,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5530,12 +5502,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5660,8 +5631,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5765,8 +5735,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsGlobalDomainsBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5873,8 +5842,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsTestIamPermissionsCall) Header() h func (c *ProjectsLocationsGlobalDomainsBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5987,12 +5955,11 @@ func (c *ProjectsLocationsGlobalDomainsSqlIntegrationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6127,12 +6094,11 @@ func (c *ProjectsLocationsGlobalDomainsSqlIntegrationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sqlIntegrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6254,8 +6220,7 @@ func (c *ProjectsLocationsGlobalOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6356,12 +6321,11 @@ func (c *ProjectsLocationsGlobalOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6465,12 +6429,11 @@ func (c *ProjectsLocationsGlobalOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6593,12 +6556,11 @@ func (c *ProjectsLocationsGlobalOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6721,8 +6683,7 @@ func (c *ProjectsLocationsGlobalPeeringsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peering) if err != nil { return nil, err } @@ -6821,12 +6782,11 @@ func (c *ProjectsLocationsGlobalPeeringsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6929,12 +6889,11 @@ func (c *ProjectsLocationsGlobalPeeringsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7056,12 +7015,11 @@ func (c *ProjectsLocationsGlobalPeeringsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7198,12 +7156,11 @@ func (c *ProjectsLocationsGlobalPeeringsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/peerings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7328,8 +7285,7 @@ func (c *ProjectsLocationsGlobalPeeringsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peering) if err != nil { return nil, err } @@ -7433,8 +7389,7 @@ func (c *ProjectsLocationsGlobalPeeringsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7541,8 +7496,7 @@ func (c *ProjectsLocationsGlobalPeeringsTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsGlobalPeeringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/managedidentities/v1alpha1/managedidentities-gen.go b/managedidentities/v1alpha1/managedidentities-gen.go index 5c39e24db2c..6c1f1476f2c 100644 --- a/managedidentities/v1alpha1/managedidentities-gen.go +++ b/managedidentities/v1alpha1/managedidentities-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2509,12 +2508,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2640,12 +2638,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2760,8 +2757,7 @@ func (c *ProjectsLocationsGlobalDomainsAttachTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsAttachTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attachtrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attachtrustrequest) if err != nil { return nil, err } @@ -2863,8 +2859,7 @@ func (c *ProjectsLocationsGlobalDomainsCheckMigrationPermissionCall) Header() ht func (c *ProjectsLocationsGlobalDomainsCheckMigrationPermissionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkmigrationpermissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkmigrationpermissionrequest) if err != nil { return nil, err } @@ -2979,8 +2974,7 @@ func (c *ProjectsLocationsGlobalDomainsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -3079,12 +3073,11 @@ func (c *ProjectsLocationsGlobalDomainsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3177,8 +3170,7 @@ func (c *ProjectsLocationsGlobalDomainsDetachTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsDetachTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detachtrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detachtrustrequest) if err != nil { return nil, err } @@ -3279,8 +3271,7 @@ func (c *ProjectsLocationsGlobalDomainsDisableMigrationCall) Header() http.Heade func (c *ProjectsLocationsGlobalDomainsDisableMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablemigrationrequest) if err != nil { return nil, err } @@ -3382,8 +3373,7 @@ func (c *ProjectsLocationsGlobalDomainsDomainJoinMachineCall) Header() http.Head func (c *ProjectsLocationsGlobalDomainsDomainJoinMachineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainjoinmachinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainjoinmachinerequest) if err != nil { return nil, err } @@ -3485,8 +3475,7 @@ func (c *ProjectsLocationsGlobalDomainsEnableMigrationCall) Header() http.Header func (c *ProjectsLocationsGlobalDomainsEnableMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablemigrationrequest) if err != nil { return nil, err } @@ -3587,8 +3576,7 @@ func (c *ProjectsLocationsGlobalDomainsExtendSchemaCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsExtendSchemaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.extendschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.extendschemarequest) if err != nil { return nil, err } @@ -3699,12 +3687,11 @@ func (c *ProjectsLocationsGlobalDomainsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3826,12 +3813,11 @@ func (c *ProjectsLocationsGlobalDomainsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3934,12 +3920,11 @@ func (c *ProjectsLocationsGlobalDomainsGetLdapssettingsCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/ldapssettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4074,12 +4059,11 @@ func (c *ProjectsLocationsGlobalDomainsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4205,8 +4189,7 @@ func (c *ProjectsLocationsGlobalDomainsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -4307,8 +4290,7 @@ func (c *ProjectsLocationsGlobalDomainsReconfigureTrustCall) Header() http.Heade func (c *ProjectsLocationsGlobalDomainsReconfigureTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reconfiguretrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reconfiguretrustrequest) if err != nil { return nil, err } @@ -4410,8 +4392,7 @@ func (c *ProjectsLocationsGlobalDomainsResetAdminPasswordCall) Header() http.Hea func (c *ProjectsLocationsGlobalDomainsResetAdminPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetadminpasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetadminpasswordrequest) if err != nil { return nil, err } @@ -4513,8 +4494,7 @@ func (c *ProjectsLocationsGlobalDomainsRestoreCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoredomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoredomainrequest) if err != nil { return nil, err } @@ -4618,8 +4598,7 @@ func (c *ProjectsLocationsGlobalDomainsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4726,8 +4705,7 @@ func (c *ProjectsLocationsGlobalDomainsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsGlobalDomainsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4838,8 +4816,7 @@ func (c *ProjectsLocationsGlobalDomainsUpdateLdapssettingsCall) Header() http.He func (c *ProjectsLocationsGlobalDomainsUpdateLdapssettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ldapssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ldapssettings) if err != nil { return nil, err } @@ -4940,8 +4917,7 @@ func (c *ProjectsLocationsGlobalDomainsValidateTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsValidateTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatetrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validatetrustrequest) if err != nil { return nil, err } @@ -5052,8 +5028,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5153,12 +5128,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5262,12 +5236,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5389,12 +5362,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5529,12 +5501,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5658,8 +5629,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5763,8 +5733,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsGlobalDomainsBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5871,8 +5840,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsTestIamPermissionsCall) Header() h func (c *ProjectsLocationsGlobalDomainsBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5984,12 +5952,11 @@ func (c *ProjectsLocationsGlobalDomainsSqlIntegrationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6124,12 +6091,11 @@ func (c *ProjectsLocationsGlobalDomainsSqlIntegrationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/sqlIntegrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6251,8 +6217,7 @@ func (c *ProjectsLocationsGlobalOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6353,12 +6318,11 @@ func (c *ProjectsLocationsGlobalOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6462,12 +6426,11 @@ func (c *ProjectsLocationsGlobalOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6590,12 +6553,11 @@ func (c *ProjectsLocationsGlobalOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6717,8 +6679,7 @@ func (c *ProjectsLocationsGlobalPeeringsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peering) if err != nil { return nil, err } @@ -6817,12 +6778,11 @@ func (c *ProjectsLocationsGlobalPeeringsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6925,12 +6885,11 @@ func (c *ProjectsLocationsGlobalPeeringsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7052,12 +7011,11 @@ func (c *ProjectsLocationsGlobalPeeringsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7193,12 +7151,11 @@ func (c *ProjectsLocationsGlobalPeeringsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/peerings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7323,8 +7280,7 @@ func (c *ProjectsLocationsGlobalPeeringsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peering) if err != nil { return nil, err } @@ -7428,8 +7384,7 @@ func (c *ProjectsLocationsGlobalPeeringsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7536,8 +7491,7 @@ func (c *ProjectsLocationsGlobalPeeringsTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsGlobalPeeringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/managedidentities/v1beta1/managedidentities-gen.go b/managedidentities/v1beta1/managedidentities-gen.go index 673e0a57ad4..64ff401c125 100644 --- a/managedidentities/v1beta1/managedidentities-gen.go +++ b/managedidentities/v1beta1/managedidentities-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2520,12 +2519,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2651,12 +2649,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2771,8 +2768,7 @@ func (c *ProjectsLocationsGlobalDomainsAttachTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsAttachTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attachtrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attachtrustrequest) if err != nil { return nil, err } @@ -2874,8 +2870,7 @@ func (c *ProjectsLocationsGlobalDomainsCheckMigrationPermissionCall) Header() ht func (c *ProjectsLocationsGlobalDomainsCheckMigrationPermissionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkmigrationpermissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkmigrationpermissionrequest) if err != nil { return nil, err } @@ -2989,8 +2984,7 @@ func (c *ProjectsLocationsGlobalDomainsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -3089,12 +3083,11 @@ func (c *ProjectsLocationsGlobalDomainsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3187,8 +3180,7 @@ func (c *ProjectsLocationsGlobalDomainsDetachTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsDetachTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detachtrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detachtrustrequest) if err != nil { return nil, err } @@ -3289,8 +3281,7 @@ func (c *ProjectsLocationsGlobalDomainsDisableMigrationCall) Header() http.Heade func (c *ProjectsLocationsGlobalDomainsDisableMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablemigrationrequest) if err != nil { return nil, err } @@ -3392,8 +3383,7 @@ func (c *ProjectsLocationsGlobalDomainsDomainJoinMachineCall) Header() http.Head func (c *ProjectsLocationsGlobalDomainsDomainJoinMachineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainjoinmachinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainjoinmachinerequest) if err != nil { return nil, err } @@ -3495,8 +3485,7 @@ func (c *ProjectsLocationsGlobalDomainsEnableMigrationCall) Header() http.Header func (c *ProjectsLocationsGlobalDomainsEnableMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablemigrationrequest) if err != nil { return nil, err } @@ -3597,8 +3586,7 @@ func (c *ProjectsLocationsGlobalDomainsExtendSchemaCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsExtendSchemaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.extendschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.extendschemarequest) if err != nil { return nil, err } @@ -3709,12 +3697,11 @@ func (c *ProjectsLocationsGlobalDomainsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3836,12 +3823,11 @@ func (c *ProjectsLocationsGlobalDomainsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3944,12 +3930,11 @@ func (c *ProjectsLocationsGlobalDomainsGetLdapssettingsCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/ldapssettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4085,12 +4070,11 @@ func (c *ProjectsLocationsGlobalDomainsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/domains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4214,8 +4198,7 @@ func (c *ProjectsLocationsGlobalDomainsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domain) if err != nil { return nil, err } @@ -4316,8 +4299,7 @@ func (c *ProjectsLocationsGlobalDomainsReconfigureTrustCall) Header() http.Heade func (c *ProjectsLocationsGlobalDomainsReconfigureTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reconfiguretrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reconfiguretrustrequest) if err != nil { return nil, err } @@ -4418,8 +4400,7 @@ func (c *ProjectsLocationsGlobalDomainsResetAdminPasswordCall) Header() http.Hea func (c *ProjectsLocationsGlobalDomainsResetAdminPasswordCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetadminpasswordrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetadminpasswordrequest) if err != nil { return nil, err } @@ -4520,8 +4501,7 @@ func (c *ProjectsLocationsGlobalDomainsRestoreCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoredomainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoredomainrequest) if err != nil { return nil, err } @@ -4625,8 +4605,7 @@ func (c *ProjectsLocationsGlobalDomainsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4733,8 +4712,7 @@ func (c *ProjectsLocationsGlobalDomainsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsGlobalDomainsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4845,8 +4823,7 @@ func (c *ProjectsLocationsGlobalDomainsUpdateLdapssettingsCall) Header() http.He func (c *ProjectsLocationsGlobalDomainsUpdateLdapssettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ldapssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ldapssettings) if err != nil { return nil, err } @@ -4948,8 +4925,7 @@ func (c *ProjectsLocationsGlobalDomainsValidateTrustCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsValidateTrustCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatetrustrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validatetrustrequest) if err != nil { return nil, err } @@ -5060,8 +5036,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5161,12 +5136,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5270,12 +5244,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5397,12 +5370,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5537,12 +5509,11 @@ func (c *ProjectsLocationsGlobalDomainsBackupsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5666,8 +5637,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalDomainsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -5771,8 +5741,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsGlobalDomainsBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5879,8 +5848,7 @@ func (c *ProjectsLocationsGlobalDomainsBackupsTestIamPermissionsCall) Header() h func (c *ProjectsLocationsGlobalDomainsBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5992,12 +5960,11 @@ func (c *ProjectsLocationsGlobalDomainsSqlIntegrationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6132,12 +6099,11 @@ func (c *ProjectsLocationsGlobalDomainsSqlIntegrationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/sqlIntegrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6259,8 +6225,7 @@ func (c *ProjectsLocationsGlobalOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6361,12 +6326,11 @@ func (c *ProjectsLocationsGlobalOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6470,12 +6434,11 @@ func (c *ProjectsLocationsGlobalOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6598,12 +6561,11 @@ func (c *ProjectsLocationsGlobalOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6725,8 +6687,7 @@ func (c *ProjectsLocationsGlobalPeeringsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peering) if err != nil { return nil, err } @@ -6825,12 +6786,11 @@ func (c *ProjectsLocationsGlobalPeeringsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6933,12 +6893,11 @@ func (c *ProjectsLocationsGlobalPeeringsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7060,12 +7019,11 @@ func (c *ProjectsLocationsGlobalPeeringsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7201,12 +7159,11 @@ func (c *ProjectsLocationsGlobalPeeringsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/peerings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7331,8 +7288,7 @@ func (c *ProjectsLocationsGlobalPeeringsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peering) if err != nil { return nil, err } @@ -7436,8 +7392,7 @@ func (c *ProjectsLocationsGlobalPeeringsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalPeeringsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7544,8 +7499,7 @@ func (c *ProjectsLocationsGlobalPeeringsTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsGlobalPeeringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/manufacturers/v1/manufacturers-gen.go b/manufacturers/v1/manufacturers-gen.go index eb63c667ae5..1f91d3b96df 100644 --- a/manufacturers/v1/manufacturers-gen.go +++ b/manufacturers/v1/manufacturers-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1192,12 +1191,11 @@ func (c *AccountsLanguagesProductCertificationsDeleteCall) Header() http.Header func (c *AccountsLanguagesProductCertificationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1301,12 +1299,11 @@ func (c *AccountsLanguagesProductCertificationsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1430,12 +1427,11 @@ func (c *AccountsLanguagesProductCertificationsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productCertifications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1564,8 +1560,7 @@ func (c *AccountsLanguagesProductCertificationsPatchCall) Header() http.Header { func (c *AccountsLanguagesProductCertificationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productcertification) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productcertification) if err != nil { return nil, err } @@ -1674,12 +1669,11 @@ func (c *AccountsProductsDeleteCall) Header() http.Header { func (c *AccountsProductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1810,12 +1804,11 @@ func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1947,12 +1940,11 @@ func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2086,8 +2078,7 @@ func (c *AccountsProductsUpdateCall) Header() http.Header { func (c *AccountsProductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributes) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributes) if err != nil { return nil, err } diff --git a/marketingplatformadmin/v1alpha/marketingplatformadmin-gen.go b/marketingplatformadmin/v1alpha/marketingplatformadmin-gen.go index 5bb1151ee9f..f4484a11969 100644 --- a/marketingplatformadmin/v1alpha/marketingplatformadmin-gen.go +++ b/marketingplatformadmin/v1alpha/marketingplatformadmin-gen.go @@ -123,7 +123,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) if err != nil { return nil, err } @@ -142,9 +143,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -391,12 +390,11 @@ func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -493,8 +491,7 @@ func (c *OrganizationsAnalyticsAccountLinksCreateCall) Header() http.Header { func (c *OrganizationsAnalyticsAccountLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsaccountlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyticsaccountlink) if err != nil { return nil, err } @@ -596,12 +593,11 @@ func (c *OrganizationsAnalyticsAccountLinksDeleteCall) Header() http.Header { func (c *OrganizationsAnalyticsAccountLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -725,12 +721,11 @@ func (c *OrganizationsAnalyticsAccountLinksListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/analyticsAccountLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -847,8 +842,7 @@ func (c *OrganizationsAnalyticsAccountLinksSetPropertyServiceLevelCall) Header() func (c *OrganizationsAnalyticsAccountLinksSetPropertyServiceLevelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setpropertyservicelevelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setpropertyservicelevelrequest) if err != nil { return nil, err } diff --git a/meet/v2/meet-gen.go b/meet/v2/meet-gen.go index 0fec71e193c..7459d5fd7da 100644 --- a/meet/v2/meet-gen.go +++ b/meet/v2/meet-gen.go @@ -124,7 +124,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.ConferenceRecords = NewConferenceRecordsService(s) + s.Spaces = NewSpacesService(s) if err != nil { return nil, err } @@ -143,10 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.ConferenceRecords = NewConferenceRecordsService(s) - s.Spaces = NewSpacesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -979,12 +978,11 @@ func (c *ConferenceRecordsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1114,12 +1112,11 @@ func (c *ConferenceRecordsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/conferenceRecords") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1240,12 +1237,11 @@ func (c *ConferenceRecordsParticipantsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1379,12 +1375,11 @@ func (c *ConferenceRecordsParticipantsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/participants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1508,12 +1503,11 @@ func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1649,12 +1643,11 @@ func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/participantSessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1778,12 +1771,11 @@ func (c *ConferenceRecordsRecordingsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1902,12 +1894,11 @@ func (c *ConferenceRecordsRecordingsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recordings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2031,12 +2022,11 @@ func (c *ConferenceRecordsTranscriptsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2155,12 +2145,11 @@ func (c *ConferenceRecordsTranscriptsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/transcripts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2287,12 +2276,11 @@ func (c *ConferenceRecordsTranscriptsEntriesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2416,12 +2404,11 @@ func (c *ConferenceRecordsTranscriptsEntriesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2531,8 +2518,7 @@ func (c *SpacesCreateCall) Header() http.Header { func (c *SpacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.space) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.space) if err != nil { return nil, err } @@ -2635,8 +2621,7 @@ func (c *SpacesEndActiveConferenceCall) Header() http.Header { func (c *SpacesEndActiveConferenceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endactiveconferencerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endactiveconferencerequest) if err != nil { return nil, err } @@ -2760,12 +2745,11 @@ func (c *SpacesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2874,8 +2858,7 @@ func (c *SpacesPatchCall) Header() http.Header { func (c *SpacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.space) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.space) if err != nil { return nil, err } diff --git a/memcache/v1/memcache-gen.go b/memcache/v1/memcache-gen.go index 8b9a6807cc1..a8fcfd78edc 100644 --- a/memcache/v1/memcache-gen.go +++ b/memcache/v1/memcache-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2165,12 +2164,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2296,12 +2294,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2418,8 +2415,7 @@ func (c *ProjectsLocationsInstancesApplyParametersCall) Header() http.Header { func (c *ProjectsLocationsInstancesApplyParametersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applyparametersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applyparametersrequest) if err != nil { return nil, err } @@ -2532,8 +2528,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2633,12 +2628,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2742,12 +2736,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2883,12 +2876,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3015,8 +3007,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3118,8 +3109,7 @@ func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Head func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reschedulemaintenancerequest) if err != nil { return nil, err } @@ -3223,8 +3213,7 @@ func (c *ProjectsLocationsInstancesUpdateParametersCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpdateParametersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateparametersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateparametersrequest) if err != nil { return nil, err } @@ -3327,8 +3316,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmemcachev1upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmemcachev1upgradeinstancerequest) if err != nil { return nil, err } @@ -3436,8 +3424,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3538,12 +3525,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3647,12 +3633,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3775,12 +3760,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/memcache/v1beta2/memcache-gen.go b/memcache/v1beta2/memcache-gen.go index a80a1c16d41..1df3c190ec3 100644 --- a/memcache/v1beta2/memcache-gen.go +++ b/memcache/v1beta2/memcache-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2200,12 +2199,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2331,12 +2329,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2453,8 +2450,7 @@ func (c *ProjectsLocationsInstancesApplyParametersCall) Header() http.Header { func (c *ProjectsLocationsInstancesApplyParametersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applyparametersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applyparametersrequest) if err != nil { return nil, err } @@ -2555,8 +2551,7 @@ func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) Header() http.Header func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applysoftwareupdaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applysoftwareupdaterequest) if err != nil { return nil, err } @@ -2669,8 +2664,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2770,12 +2764,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2879,12 +2872,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3020,12 +3012,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3152,8 +3143,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3256,8 +3246,7 @@ func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Head func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reschedulemaintenancerequest) if err != nil { return nil, err } @@ -3361,8 +3350,7 @@ func (c *ProjectsLocationsInstancesUpdateParametersCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpdateParametersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateparametersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateparametersrequest) if err != nil { return nil, err } @@ -3465,8 +3453,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmemcachev1beta2upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmemcachev1beta2upgradeinstancerequest) if err != nil { return nil, err } @@ -3574,8 +3561,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3676,12 +3662,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3785,12 +3770,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3913,12 +3897,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/accounts_v1beta/merchantapi-gen.go b/merchantapi/accounts_v1beta/merchantapi-gen.go index c86b58e702f..861d8ce25c6 100644 --- a/merchantapi/accounts_v1beta/merchantapi-gen.go +++ b/merchantapi/accounts_v1beta/merchantapi-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.TermsOfService = NewTermsOfServiceService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.TermsOfService = NewTermsOfServiceService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -3145,8 +3144,7 @@ func (c *AccountsCreateAndConfigureCall) Header() http.Header { func (c *AccountsCreateAndConfigureCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createandconfigureaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createandconfigureaccountrequest) if err != nil { return nil, err } @@ -3254,12 +3252,11 @@ func (c *AccountsDeleteCall) Header() http.Header { func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3363,12 +3360,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3498,12 +3494,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3647,12 +3642,11 @@ func (c *AccountsListSubaccountsCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+provider}:listSubaccounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3777,8 +3771,7 @@ func (c *AccountsPatchCall) Header() http.Header { func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -3889,12 +3882,11 @@ func (c *AccountsAutofeedSettingsGetAutofeedSettingsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3995,8 +3987,7 @@ func (c *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) Header() http.Heade func (c *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autofeedsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autofeedsettings) if err != nil { return nil, err } @@ -4108,12 +4099,11 @@ func (c *AccountsBusinessIdentityGetBusinessIdentityCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4217,8 +4207,7 @@ func (c *AccountsBusinessIdentityUpdateBusinessIdentityCall) Header() http.Heade func (c *AccountsBusinessIdentityUpdateBusinessIdentityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.businessidentity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.businessidentity) if err != nil { return nil, err } @@ -4330,12 +4319,11 @@ func (c *AccountsBusinessInfoGetBusinessInfoCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4438,8 +4426,7 @@ func (c *AccountsBusinessInfoUpdateBusinessInfoCall) Header() http.Header { func (c *AccountsBusinessInfoUpdateBusinessInfoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.businessinfo) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.businessinfo) if err != nil { return nil, err } @@ -4554,12 +4541,11 @@ func (c *AccountsEmailPreferencesGetEmailPreferencesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4667,8 +4653,7 @@ func (c *AccountsEmailPreferencesUpdateEmailPreferencesCall) Header() http.Heade func (c *AccountsEmailPreferencesUpdateEmailPreferencesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.emailpreferences) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.emailpreferences) if err != nil { return nil, err } @@ -4779,8 +4764,7 @@ func (c *AccountsHomepageClaimCall) Header() http.Header { func (c *AccountsHomepageClaimCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimhomepagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.claimhomepagerequest) if err != nil { return nil, err } @@ -4891,12 +4875,11 @@ func (c *AccountsHomepageGetHomepageCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4990,8 +4973,7 @@ func (c *AccountsHomepageUnclaimCall) Header() http.Header { func (c *AccountsHomepageUnclaimCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimhomepagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unclaimhomepagerequest) if err != nil { return nil, err } @@ -5101,8 +5083,7 @@ func (c *AccountsHomepageUpdateHomepageCall) Header() http.Header { func (c *AccountsHomepageUpdateHomepageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.homepage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.homepage) if err != nil { return nil, err } @@ -5249,12 +5230,11 @@ func (c *AccountsIssuesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/issues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5379,12 +5359,11 @@ func (c *AccountsOnlineReturnPoliciesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5510,12 +5489,11 @@ func (c *AccountsOnlineReturnPoliciesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/onlineReturnPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5631,8 +5609,7 @@ func (c *AccountsProgramsDisableCall) Header() http.Header { func (c *AccountsProgramsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableprogramrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableprogramrequest) if err != nil { return nil, err } @@ -5734,8 +5711,7 @@ func (c *AccountsProgramsEnableCall) Header() http.Header { func (c *AccountsProgramsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableprogramrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableprogramrequest) if err != nil { return nil, err } @@ -5846,12 +5822,11 @@ func (c *AccountsProgramsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5971,12 +5946,11 @@ func (c *AccountsProgramsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/programs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6098,8 +6072,7 @@ func (c *AccountsRegionsCreateCall) Header() http.Header { func (c *AccountsRegionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.region) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.region) if err != nil { return nil, err } @@ -6199,12 +6172,11 @@ func (c *AccountsRegionsDeleteCall) Header() http.Header { func (c *AccountsRegionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6307,12 +6279,11 @@ func (c *AccountsRegionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6432,12 +6403,11 @@ func (c *AccountsRegionsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/regions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6561,8 +6531,7 @@ func (c *AccountsRegionsPatchCall) Header() http.Header { func (c *AccountsRegionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.region) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.region) if err != nil { return nil, err } @@ -6673,12 +6642,11 @@ func (c *AccountsShippingSettingsGetShippingSettingsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6773,8 +6741,7 @@ func (c *AccountsShippingSettingsInsertCall) Header() http.Header { func (c *AccountsShippingSettingsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.shippingsettings) if err != nil { return nil, err } @@ -6887,12 +6854,11 @@ func (c *AccountsTermsOfServiceAgreementStatesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6997,12 +6963,11 @@ func (c *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/termsOfServiceAgreementStates:retrieveForApplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7104,8 +7069,7 @@ func (c *AccountsUsersCreateCall) Header() http.Header { func (c *AccountsUsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -7209,12 +7173,11 @@ func (c *AccountsUsersDeleteCall) Header() http.Header { func (c *AccountsUsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7319,12 +7282,11 @@ func (c *AccountsUsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7445,12 +7407,11 @@ func (c *AccountsUsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7575,8 +7536,7 @@ func (c *AccountsUsersPatchCall) Header() http.Header { func (c *AccountsUsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -7704,12 +7664,11 @@ func (c *TermsOfServiceAcceptCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}:accept") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7812,12 +7771,11 @@ func (c *TermsOfServiceGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7937,12 +7895,11 @@ func (c *TermsOfServiceRetrieveLatestCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/termsOfService:retrieveLatest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/conversions_v1beta/merchantapi-gen.go b/merchantapi/conversions_v1beta/merchantapi-gen.go index cddc913a770..0185e719eb2 100644 --- a/merchantapi/conversions_v1beta/merchantapi-gen.go +++ b/merchantapi/conversions_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -569,8 +568,7 @@ func (c *AccountsConversionSourcesCreateCall) Header() http.Header { func (c *AccountsConversionSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionsource) if err != nil { return nil, err } @@ -673,12 +671,11 @@ func (c *AccountsConversionSourcesDeleteCall) Header() http.Header { func (c *AccountsConversionSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -781,12 +778,11 @@ func (c *AccountsConversionSourcesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -913,12 +909,11 @@ func (c *AccountsConversionSourcesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+parent}/conversionSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1047,8 +1042,7 @@ func (c *AccountsConversionSourcesPatchCall) Header() http.Header { func (c *AccountsConversionSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.conversionsource) if err != nil { return nil, err } @@ -1151,8 +1145,7 @@ func (c *AccountsConversionSourcesUndeleteCall) Header() http.Header { func (c *AccountsConversionSourcesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteconversionsourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteconversionsourcerequest) if err != nil { return nil, err } diff --git a/merchantapi/datasources_v1beta/merchantapi-gen.go b/merchantapi/datasources_v1beta/merchantapi-gen.go index 556ab852e81..78b66e46023 100644 --- a/merchantapi/datasources_v1beta/merchantapi-gen.go +++ b/merchantapi/datasources_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -959,8 +958,7 @@ func (c *AccountsDataSourcesCreateCall) Header() http.Header { func (c *AccountsDataSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -1059,12 +1057,11 @@ func (c *AccountsDataSourcesDeleteCall) Header() http.Header { func (c *AccountsDataSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1161,8 +1158,7 @@ func (c *AccountsDataSourcesFetchCall) Header() http.Header { func (c *AccountsDataSourcesFetchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchdatasourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchdatasourcerequest) if err != nil { return nil, err } @@ -1273,12 +1269,11 @@ func (c *AccountsDataSourcesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1398,12 +1393,11 @@ func (c *AccountsDataSourcesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+parent}/dataSources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1529,8 +1523,7 @@ func (c *AccountsDataSourcesPatchCall) Header() http.Header { func (c *AccountsDataSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasource) if err != nil { return nil, err } @@ -1642,12 +1635,11 @@ func (c *AccountsDataSourcesFileUploadsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/inventories_v1beta/merchantapi-gen.go b/merchantapi/inventories_v1beta/merchantapi-gen.go index 61e7f9cad2a..92e1671ff15 100644 --- a/merchantapi/inventories_v1beta/merchantapi-gen.go +++ b/merchantapi/inventories_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -642,12 +641,11 @@ func (c *AccountsProductsLocalInventoriesDeleteCall) Header() http.Header { func (c *AccountsProductsLocalInventoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -744,8 +742,7 @@ func (c *AccountsProductsLocalInventoriesInsertCall) Header() http.Header { func (c *AccountsProductsLocalInventoriesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.localinventory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.localinventory) if err != nil { return nil, err } @@ -881,12 +878,11 @@ func (c *AccountsProductsLocalInventoriesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+parent}/localInventories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1003,12 +999,11 @@ func (c *AccountsProductsRegionalInventoriesDeleteCall) Header() http.Header { func (c *AccountsProductsRegionalInventoriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1104,8 +1099,7 @@ func (c *AccountsProductsRegionalInventoriesInsertCall) Header() http.Header { func (c *AccountsProductsRegionalInventoriesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionalinventory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionalinventory) if err != nil { return nil, err } @@ -1243,12 +1237,11 @@ func (c *AccountsProductsRegionalInventoriesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+parent}/regionalInventories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/lfp_v1beta/merchantapi-gen.go b/merchantapi/lfp_v1beta/merchantapi-gen.go index 90176a27e83..134f343b9cc 100644 --- a/merchantapi/lfp_v1beta/merchantapi-gen.go +++ b/merchantapi/lfp_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -636,8 +635,7 @@ func (c *AccountsLfpInventoriesInsertCall) Header() http.Header { func (c *AccountsLfpInventoriesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lfpinventory) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lfpinventory) if err != nil { return nil, err } @@ -737,8 +735,7 @@ func (c *AccountsLfpSalesInsertCall) Header() http.Header { func (c *AccountsLfpSalesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lfpsale) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lfpsale) if err != nil { return nil, err } @@ -837,12 +834,11 @@ func (c *AccountsLfpStoresDeleteCall) Header() http.Header { func (c *AccountsLfpStoresDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -945,12 +941,11 @@ func (c *AccountsLfpStoresGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1043,8 +1038,7 @@ func (c *AccountsLfpStoresInsertCall) Header() http.Header { func (c *AccountsLfpStoresInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lfpstore) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lfpstore) if err != nil { return nil, err } @@ -1183,12 +1177,11 @@ func (c *AccountsLfpStoresListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+parent}/lfpStores") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/notifications_v1beta/merchantapi-gen.go b/merchantapi/notifications_v1beta/merchantapi-gen.go index 043f07f2c6b..890cd6c8b18 100644 --- a/merchantapi/notifications_v1beta/merchantapi-gen.go +++ b/merchantapi/notifications_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -433,8 +432,7 @@ func (c *AccountsNotificationsubscriptionsCreateCall) Header() http.Header { func (c *AccountsNotificationsubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationsubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationsubscription) if err != nil { return nil, err } @@ -533,12 +531,11 @@ func (c *AccountsNotificationsubscriptionsDeleteCall) Header() http.Header { func (c *AccountsNotificationsubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -640,12 +637,11 @@ func (c *AccountsNotificationsubscriptionsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -766,12 +762,11 @@ func (c *AccountsNotificationsubscriptionsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1beta/{+parent}/notificationsubscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -896,8 +891,7 @@ func (c *AccountsNotificationsubscriptionsPatchCall) Header() http.Header { func (c *AccountsNotificationsubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationsubscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationsubscription) if err != nil { return nil, err } diff --git a/merchantapi/products_v1beta/merchantapi-gen.go b/merchantapi/products_v1beta/merchantapi-gen.go index 7807f0fb601..78c49a1104f 100644 --- a/merchantapi/products_v1beta/merchantapi-gen.go +++ b/merchantapi/products_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1837,12 +1836,11 @@ func (c *AccountsProductInputsDeleteCall) Header() http.Header { func (c *AccountsProductInputsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1948,8 +1946,7 @@ func (c *AccountsProductInputsInsertCall) Header() http.Header { func (c *AccountsProductInputsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productinput) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productinput) if err != nil { return nil, err } @@ -2064,12 +2061,11 @@ func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2194,12 +2190,11 @@ func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1beta/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/promotions_v1beta/merchantapi-gen.go b/merchantapi/promotions_v1beta/merchantapi-gen.go index 128c4213433..9efb4d85ab9 100644 --- a/merchantapi/promotions_v1beta/merchantapi-gen.go +++ b/merchantapi/promotions_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1010,12 +1009,11 @@ func (c *AccountsPromotionsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "promotions/v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1109,8 +1107,7 @@ func (c *AccountsPromotionsInsertCall) Header() http.Header { func (c *AccountsPromotionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertpromotionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.insertpromotionrequest) if err != nil { return nil, err } @@ -1243,12 +1240,11 @@ func (c *AccountsPromotionsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "promotions/v1beta/{+parent}/promotions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/quota_v1beta/merchantapi-gen.go b/merchantapi/quota_v1beta/merchantapi-gen.go index 7b0a9ca327f..92fa9832beb 100644 --- a/merchantapi/quota_v1beta/merchantapi-gen.go +++ b/merchantapi/quota_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -460,12 +459,11 @@ func (c *AccountsQuotasListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "quota/v1beta/{+parent}/quotas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/merchantapi/reports_v1beta/merchantapi-gen.go b/merchantapi/reports_v1beta/merchantapi-gen.go index 49df7897f6d..20a7aadf762 100644 --- a/merchantapi/reports_v1beta/merchantapi-gen.go +++ b/merchantapi/reports_v1beta/merchantapi-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1702,8 +1701,7 @@ func (c *AccountsReportsSearchCall) Header() http.Header { func (c *AccountsReportsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchrequest) if err != nil { return nil, err } diff --git a/metastore/v1/metastore-gen.go b/metastore/v1/metastore-gen.go index 352fe6830ed..f0f774a88d7 100644 --- a/metastore/v1/metastore-gen.go +++ b/metastore/v1/metastore-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -2747,12 +2746,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2878,12 +2876,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3023,8 +3020,7 @@ func (c *ProjectsLocationsFederationsCreateCall) Header() http.Header { func (c *ProjectsLocationsFederationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.federation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.federation) if err != nil { return nil, err } @@ -3139,12 +3135,11 @@ func (c *ProjectsLocationsFederationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFederationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3249,12 +3244,11 @@ func (c *ProjectsLocationsFederationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3376,12 +3370,11 @@ func (c *ProjectsLocationsFederationsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3520,12 +3513,11 @@ func (c *ProjectsLocationsFederationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/federations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3666,8 +3658,7 @@ func (c *ProjectsLocationsFederationsPatchCall) Header() http.Header { func (c *ProjectsLocationsFederationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.federation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.federation) if err != nil { return nil, err } @@ -3771,8 +3762,7 @@ func (c *ProjectsLocationsFederationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFederationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3879,8 +3869,7 @@ func (c *ProjectsLocationsFederationsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsFederationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3989,8 +3978,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4091,12 +4079,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4200,12 +4187,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4328,12 +4314,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4452,8 +4437,7 @@ func (c *ProjectsLocationsServicesAlterLocationCall) Header() http.Header { func (c *ProjectsLocationsServicesAlterLocationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.altermetadataresourcelocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.altermetadataresourcelocationrequest) if err != nil { return nil, err } @@ -4555,8 +4539,7 @@ func (c *ProjectsLocationsServicesAlterTablePropertiesCall) Header() http.Header func (c *ProjectsLocationsServicesAlterTablePropertiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.altertablepropertiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.altertablepropertiesrequest) if err != nil { return nil, err } @@ -4658,8 +4641,7 @@ func (c *ProjectsLocationsServicesCancelMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesCancelMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelmigrationrequest) if err != nil { return nil, err } @@ -4763,8 +4745,7 @@ func (c *ProjectsLocationsServicesCompleteMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesCompleteMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completemigrationrequest) if err != nil { return nil, err } @@ -4890,8 +4871,7 @@ func (c *ProjectsLocationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -5006,12 +4986,11 @@ func (c *ProjectsLocationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5105,8 +5084,7 @@ func (c *ProjectsLocationsServicesExportMetadataCall) Header() http.Header { func (c *ProjectsLocationsServicesExportMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportmetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportmetadatarequest) if err != nil { return nil, err } @@ -5219,12 +5197,11 @@ func (c *ProjectsLocationsServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5346,12 +5323,11 @@ func (c *ProjectsLocationsServicesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5491,12 +5467,11 @@ func (c *ProjectsLocationsServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5612,8 +5587,7 @@ func (c *ProjectsLocationsServicesMoveTableToDatabaseCall) Header() http.Header func (c *ProjectsLocationsServicesMoveTableToDatabaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movetabletodatabaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movetabletodatabaserequest) if err != nil { return nil, err } @@ -5740,8 +5714,7 @@ func (c *ProjectsLocationsServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -5843,8 +5816,7 @@ func (c *ProjectsLocationsServicesQueryMetadataCall) Header() http.Header { func (c *ProjectsLocationsServicesQueryMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querymetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querymetadatarequest) if err != nil { return nil, err } @@ -5946,8 +5918,7 @@ func (c *ProjectsLocationsServicesRestoreCall) Header() http.Header { func (c *ProjectsLocationsServicesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreservicerequest) if err != nil { return nil, err } @@ -6051,8 +6022,7 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6154,8 +6124,7 @@ func (c *ProjectsLocationsServicesStartMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesStartMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationrequest) if err != nil { return nil, err } @@ -6262,8 +6231,7 @@ func (c *ProjectsLocationsServicesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6390,8 +6358,7 @@ func (c *ProjectsLocationsServicesBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -6505,12 +6472,11 @@ func (c *ProjectsLocationsServicesBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6615,12 +6581,11 @@ func (c *ProjectsLocationsServicesBackupsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6742,12 +6707,11 @@ func (c *ProjectsLocationsServicesBackupsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6888,12 +6852,11 @@ func (c *ProjectsLocationsServicesBackupsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7011,8 +6974,7 @@ func (c *ProjectsLocationsServicesBackupsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsServicesBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7142,12 +7104,11 @@ func (c *ProjectsLocationsServicesDatabasesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7243,8 +7204,7 @@ func (c *ProjectsLocationsServicesDatabasesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsServicesDatabasesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7374,12 +7334,11 @@ func (c *ProjectsLocationsServicesDatabasesTablesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7475,8 +7434,7 @@ func (c *ProjectsLocationsServicesDatabasesTablesSetIamPolicyCall) Header() http func (c *ProjectsLocationsServicesDatabasesTablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7603,8 +7561,7 @@ func (c *ProjectsLocationsServicesMetadataImportsCreateCall) Header() http.Heade func (c *ProjectsLocationsServicesMetadataImportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadataimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadataimport) if err != nil { return nil, err } @@ -7717,12 +7674,11 @@ func (c *ProjectsLocationsServicesMetadataImportsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7863,12 +7819,11 @@ func (c *ProjectsLocationsServicesMetadataImportsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/metadataImports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8009,8 +7964,7 @@ func (c *ProjectsLocationsServicesMetadataImportsPatchCall) Header() http.Header func (c *ProjectsLocationsServicesMetadataImportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadataimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadataimport) if err != nil { return nil, err } @@ -8125,12 +8079,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Header() http.H func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8235,12 +8188,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8382,12 +8334,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/migrationExecutions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/metastore/v1alpha/metastore-gen.go b/metastore/v1alpha/metastore-gen.go index 5b72491f8ad..7a44e67a6dc 100644 --- a/metastore/v1alpha/metastore-gen.go +++ b/metastore/v1alpha/metastore-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -2986,12 +2985,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3117,12 +3115,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3262,8 +3259,7 @@ func (c *ProjectsLocationsFederationsCreateCall) Header() http.Header { func (c *ProjectsLocationsFederationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.federation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.federation) if err != nil { return nil, err } @@ -3378,12 +3374,11 @@ func (c *ProjectsLocationsFederationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFederationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3488,12 +3483,11 @@ func (c *ProjectsLocationsFederationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3615,12 +3609,11 @@ func (c *ProjectsLocationsFederationsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3759,12 +3752,11 @@ func (c *ProjectsLocationsFederationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/federations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3905,8 +3897,7 @@ func (c *ProjectsLocationsFederationsPatchCall) Header() http.Header { func (c *ProjectsLocationsFederationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.federation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.federation) if err != nil { return nil, err } @@ -4010,8 +4001,7 @@ func (c *ProjectsLocationsFederationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFederationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4118,8 +4108,7 @@ func (c *ProjectsLocationsFederationsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsFederationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4228,8 +4217,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4330,12 +4318,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4439,12 +4426,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4567,12 +4553,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4691,8 +4676,7 @@ func (c *ProjectsLocationsServicesAlterLocationCall) Header() http.Header { func (c *ProjectsLocationsServicesAlterLocationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.altermetadataresourcelocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.altermetadataresourcelocationrequest) if err != nil { return nil, err } @@ -4794,8 +4778,7 @@ func (c *ProjectsLocationsServicesAlterTablePropertiesCall) Header() http.Header func (c *ProjectsLocationsServicesAlterTablePropertiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.altertablepropertiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.altertablepropertiesrequest) if err != nil { return nil, err } @@ -4897,8 +4880,7 @@ func (c *ProjectsLocationsServicesCancelMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesCancelMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelmigrationrequest) if err != nil { return nil, err } @@ -5002,8 +4984,7 @@ func (c *ProjectsLocationsServicesCompleteMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesCompleteMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completemigrationrequest) if err != nil { return nil, err } @@ -5129,8 +5110,7 @@ func (c *ProjectsLocationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -5245,12 +5225,11 @@ func (c *ProjectsLocationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5344,8 +5323,7 @@ func (c *ProjectsLocationsServicesExportMetadataCall) Header() http.Header { func (c *ProjectsLocationsServicesExportMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportmetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportmetadatarequest) if err != nil { return nil, err } @@ -5458,12 +5436,11 @@ func (c *ProjectsLocationsServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5585,12 +5562,11 @@ func (c *ProjectsLocationsServicesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5730,12 +5706,11 @@ func (c *ProjectsLocationsServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5851,8 +5826,7 @@ func (c *ProjectsLocationsServicesMoveTableToDatabaseCall) Header() http.Header func (c *ProjectsLocationsServicesMoveTableToDatabaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movetabletodatabaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movetabletodatabaserequest) if err != nil { return nil, err } @@ -5979,8 +5953,7 @@ func (c *ProjectsLocationsServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -6082,8 +6055,7 @@ func (c *ProjectsLocationsServicesQueryMetadataCall) Header() http.Header { func (c *ProjectsLocationsServicesQueryMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querymetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querymetadatarequest) if err != nil { return nil, err } @@ -6188,8 +6160,7 @@ func (c *ProjectsLocationsServicesRemoveIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesRemoveIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeiampolicyrequest) if err != nil { return nil, err } @@ -6292,8 +6263,7 @@ func (c *ProjectsLocationsServicesRestoreCall) Header() http.Header { func (c *ProjectsLocationsServicesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreservicerequest) if err != nil { return nil, err } @@ -6397,8 +6367,7 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6500,8 +6469,7 @@ func (c *ProjectsLocationsServicesStartMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesStartMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationrequest) if err != nil { return nil, err } @@ -6608,8 +6576,7 @@ func (c *ProjectsLocationsServicesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6736,8 +6703,7 @@ func (c *ProjectsLocationsServicesBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -6851,12 +6817,11 @@ func (c *ProjectsLocationsServicesBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6961,12 +6926,11 @@ func (c *ProjectsLocationsServicesBackupsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7088,12 +7052,11 @@ func (c *ProjectsLocationsServicesBackupsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7234,12 +7197,11 @@ func (c *ProjectsLocationsServicesBackupsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7357,8 +7319,7 @@ func (c *ProjectsLocationsServicesBackupsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsServicesBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7465,8 +7426,7 @@ func (c *ProjectsLocationsServicesBackupsTestIamPermissionsCall) Header() http.H func (c *ProjectsLocationsServicesBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7597,12 +7557,11 @@ func (c *ProjectsLocationsServicesDatabasesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7698,8 +7657,7 @@ func (c *ProjectsLocationsServicesDatabasesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsServicesDatabasesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7806,8 +7764,7 @@ func (c *ProjectsLocationsServicesDatabasesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsServicesDatabasesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7938,12 +7895,11 @@ func (c *ProjectsLocationsServicesDatabasesTablesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8039,8 +7995,7 @@ func (c *ProjectsLocationsServicesDatabasesTablesSetIamPolicyCall) Header() http func (c *ProjectsLocationsServicesDatabasesTablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8147,8 +8102,7 @@ func (c *ProjectsLocationsServicesDatabasesTablesTestIamPermissionsCall) Header( func (c *ProjectsLocationsServicesDatabasesTablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8276,8 +8230,7 @@ func (c *ProjectsLocationsServicesMetadataImportsCreateCall) Header() http.Heade func (c *ProjectsLocationsServicesMetadataImportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadataimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadataimport) if err != nil { return nil, err } @@ -8390,12 +8343,11 @@ func (c *ProjectsLocationsServicesMetadataImportsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8536,12 +8488,11 @@ func (c *ProjectsLocationsServicesMetadataImportsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/metadataImports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8682,8 +8633,7 @@ func (c *ProjectsLocationsServicesMetadataImportsPatchCall) Header() http.Header func (c *ProjectsLocationsServicesMetadataImportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadataimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadataimport) if err != nil { return nil, err } @@ -8798,12 +8748,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Header() http.H func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8908,12 +8857,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9055,12 +9003,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/migrationExecutions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/metastore/v1beta/metastore-gen.go b/metastore/v1beta/metastore-gen.go index 274af995d52..cd619b7b01b 100644 --- a/metastore/v1beta/metastore-gen.go +++ b/metastore/v1beta/metastore-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -2986,12 +2985,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3117,12 +3115,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3262,8 +3259,7 @@ func (c *ProjectsLocationsFederationsCreateCall) Header() http.Header { func (c *ProjectsLocationsFederationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.federation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.federation) if err != nil { return nil, err } @@ -3378,12 +3374,11 @@ func (c *ProjectsLocationsFederationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsFederationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3488,12 +3483,11 @@ func (c *ProjectsLocationsFederationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3615,12 +3609,11 @@ func (c *ProjectsLocationsFederationsGetIamPolicyCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3759,12 +3752,11 @@ func (c *ProjectsLocationsFederationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/federations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3905,8 +3897,7 @@ func (c *ProjectsLocationsFederationsPatchCall) Header() http.Header { func (c *ProjectsLocationsFederationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.federation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.federation) if err != nil { return nil, err } @@ -4010,8 +4001,7 @@ func (c *ProjectsLocationsFederationsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsFederationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4118,8 +4108,7 @@ func (c *ProjectsLocationsFederationsTestIamPermissionsCall) Header() http.Heade func (c *ProjectsLocationsFederationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4228,8 +4217,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4330,12 +4318,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4439,12 +4426,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4567,12 +4553,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4691,8 +4676,7 @@ func (c *ProjectsLocationsServicesAlterLocationCall) Header() http.Header { func (c *ProjectsLocationsServicesAlterLocationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.altermetadataresourcelocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.altermetadataresourcelocationrequest) if err != nil { return nil, err } @@ -4794,8 +4778,7 @@ func (c *ProjectsLocationsServicesAlterTablePropertiesCall) Header() http.Header func (c *ProjectsLocationsServicesAlterTablePropertiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.altertablepropertiesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.altertablepropertiesrequest) if err != nil { return nil, err } @@ -4897,8 +4880,7 @@ func (c *ProjectsLocationsServicesCancelMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesCancelMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelmigrationrequest) if err != nil { return nil, err } @@ -5002,8 +4984,7 @@ func (c *ProjectsLocationsServicesCompleteMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesCompleteMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completemigrationrequest) if err != nil { return nil, err } @@ -5129,8 +5110,7 @@ func (c *ProjectsLocationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -5245,12 +5225,11 @@ func (c *ProjectsLocationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5344,8 +5323,7 @@ func (c *ProjectsLocationsServicesExportMetadataCall) Header() http.Header { func (c *ProjectsLocationsServicesExportMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportmetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportmetadatarequest) if err != nil { return nil, err } @@ -5458,12 +5436,11 @@ func (c *ProjectsLocationsServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5585,12 +5562,11 @@ func (c *ProjectsLocationsServicesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5730,12 +5706,11 @@ func (c *ProjectsLocationsServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5851,8 +5826,7 @@ func (c *ProjectsLocationsServicesMoveTableToDatabaseCall) Header() http.Header func (c *ProjectsLocationsServicesMoveTableToDatabaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.movetabletodatabaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.movetabletodatabaserequest) if err != nil { return nil, err } @@ -5979,8 +5953,7 @@ func (c *ProjectsLocationsServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -6082,8 +6055,7 @@ func (c *ProjectsLocationsServicesQueryMetadataCall) Header() http.Header { func (c *ProjectsLocationsServicesQueryMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querymetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querymetadatarequest) if err != nil { return nil, err } @@ -6188,8 +6160,7 @@ func (c *ProjectsLocationsServicesRemoveIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesRemoveIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeiampolicyrequest) if err != nil { return nil, err } @@ -6292,8 +6263,7 @@ func (c *ProjectsLocationsServicesRestoreCall) Header() http.Header { func (c *ProjectsLocationsServicesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreservicerequest) if err != nil { return nil, err } @@ -6397,8 +6367,7 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6500,8 +6469,7 @@ func (c *ProjectsLocationsServicesStartMigrationCall) Header() http.Header { func (c *ProjectsLocationsServicesStartMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationrequest) if err != nil { return nil, err } @@ -6608,8 +6576,7 @@ func (c *ProjectsLocationsServicesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6736,8 +6703,7 @@ func (c *ProjectsLocationsServicesBackupsCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -6851,12 +6817,11 @@ func (c *ProjectsLocationsServicesBackupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6961,12 +6926,11 @@ func (c *ProjectsLocationsServicesBackupsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7088,12 +7052,11 @@ func (c *ProjectsLocationsServicesBackupsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7234,12 +7197,11 @@ func (c *ProjectsLocationsServicesBackupsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7357,8 +7319,7 @@ func (c *ProjectsLocationsServicesBackupsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsServicesBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7465,8 +7426,7 @@ func (c *ProjectsLocationsServicesBackupsTestIamPermissionsCall) Header() http.H func (c *ProjectsLocationsServicesBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7597,12 +7557,11 @@ func (c *ProjectsLocationsServicesDatabasesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7698,8 +7657,7 @@ func (c *ProjectsLocationsServicesDatabasesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsServicesDatabasesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7806,8 +7764,7 @@ func (c *ProjectsLocationsServicesDatabasesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsServicesDatabasesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7938,12 +7895,11 @@ func (c *ProjectsLocationsServicesDatabasesTablesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8039,8 +7995,7 @@ func (c *ProjectsLocationsServicesDatabasesTablesSetIamPolicyCall) Header() http func (c *ProjectsLocationsServicesDatabasesTablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8147,8 +8102,7 @@ func (c *ProjectsLocationsServicesDatabasesTablesTestIamPermissionsCall) Header( func (c *ProjectsLocationsServicesDatabasesTablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8276,8 +8230,7 @@ func (c *ProjectsLocationsServicesMetadataImportsCreateCall) Header() http.Heade func (c *ProjectsLocationsServicesMetadataImportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadataimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadataimport) if err != nil { return nil, err } @@ -8390,12 +8343,11 @@ func (c *ProjectsLocationsServicesMetadataImportsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8536,12 +8488,11 @@ func (c *ProjectsLocationsServicesMetadataImportsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/metadataImports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8682,8 +8633,7 @@ func (c *ProjectsLocationsServicesMetadataImportsPatchCall) Header() http.Header func (c *ProjectsLocationsServicesMetadataImportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadataimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metadataimport) if err != nil { return nil, err } @@ -8798,12 +8748,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Header() http.H func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8908,12 +8857,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9055,12 +9003,11 @@ func (c *ProjectsLocationsServicesMigrationExecutionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/migrationExecutions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/migrationcenter/v1/migrationcenter-gen.go b/migrationcenter/v1/migrationcenter-gen.go index 5d89cb59a6e..72ef2a2517d 100644 --- a/migrationcenter/v1/migrationcenter-gen.go +++ b/migrationcenter/v1/migrationcenter-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5922,12 +5921,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6029,12 +6027,11 @@ func (c *ProjectsLocationsGetSettingsCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6160,12 +6157,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6305,8 +6301,7 @@ func (c *ProjectsLocationsUpdateSettingsCall) Header() http.Header { func (c *ProjectsLocationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } @@ -6406,8 +6401,7 @@ func (c *ProjectsLocationsAssetsAggregateValuesCall) Header() http.Header { func (c *ProjectsLocationsAssetsAggregateValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.aggregateassetsvaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.aggregateassetsvaluesrequest) if err != nil { return nil, err } @@ -6508,8 +6502,7 @@ func (c *ProjectsLocationsAssetsBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsAssetsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleteassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeleteassetsrequest) if err != nil { return nil, err } @@ -6609,8 +6602,7 @@ func (c *ProjectsLocationsAssetsBatchUpdateCall) Header() http.Header { func (c *ProjectsLocationsAssetsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdateassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdateassetsrequest) if err != nil { return nil, err } @@ -6725,12 +6717,11 @@ func (c *ProjectsLocationsAssetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAssetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6853,12 +6844,11 @@ func (c *ProjectsLocationsAssetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7009,12 +6999,11 @@ func (c *ProjectsLocationsAssetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7154,8 +7143,7 @@ func (c *ProjectsLocationsAssetsPatchCall) Header() http.Header { func (c *ProjectsLocationsAssetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asset) if err != nil { return nil, err } @@ -7262,8 +7250,7 @@ func (c *ProjectsLocationsAssetsReportAssetFramesCall) Header() http.Header { func (c *ProjectsLocationsAssetsReportAssetFramesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.frames) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.frames) if err != nil { return nil, err } @@ -7391,8 +7378,7 @@ func (c *ProjectsLocationsDiscoveryClientsCreateCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.discoveryclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.discoveryclient) if err != nil { return nil, err } @@ -7506,12 +7492,11 @@ func (c *ProjectsLocationsDiscoveryClientsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryClientsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7613,12 +7598,11 @@ func (c *ProjectsLocationsDiscoveryClientsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7751,12 +7735,11 @@ func (c *ProjectsLocationsDiscoveryClientsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/discoveryClients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7897,8 +7880,7 @@ func (c *ProjectsLocationsDiscoveryClientsPatchCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryClientsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.discoveryclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.discoveryclient) if err != nil { return nil, err } @@ -7999,8 +7981,7 @@ func (c *ProjectsLocationsDiscoveryClientsSendHeartbeatCall) Header() http.Heade func (c *ProjectsLocationsDiscoveryClientsSendHeartbeatCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.senddiscoveryclientheartbeatrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.senddiscoveryclientheartbeatrequest) if err != nil { return nil, err } @@ -8100,8 +8081,7 @@ func (c *ProjectsLocationsGroupsAddAssetsCall) Header() http.Header { func (c *ProjectsLocationsGroupsAddAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addassetstogrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addassetstogrouprequest) if err != nil { return nil, err } @@ -8227,8 +8207,7 @@ func (c *ProjectsLocationsGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -8342,12 +8321,11 @@ func (c *ProjectsLocationsGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8449,12 +8427,11 @@ func (c *ProjectsLocationsGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8584,12 +8561,11 @@ func (c *ProjectsLocationsGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8729,8 +8705,7 @@ func (c *ProjectsLocationsGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -8830,8 +8805,7 @@ func (c *ProjectsLocationsGroupsRemoveAssetsCall) Header() http.Header { func (c *ProjectsLocationsGroupsRemoveAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeassetsfromgrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeassetsfromgrouprequest) if err != nil { return nil, err } @@ -8954,8 +8928,7 @@ func (c *ProjectsLocationsImportJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsImportJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importjob) if err != nil { return nil, err } @@ -9077,12 +9050,11 @@ func (c *ProjectsLocationsImportJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsImportJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9205,12 +9177,11 @@ func (c *ProjectsLocationsImportJobsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9361,12 +9332,11 @@ func (c *ProjectsLocationsImportJobsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/importJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9506,8 +9476,7 @@ func (c *ProjectsLocationsImportJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsImportJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importjob) if err != nil { return nil, err } @@ -9607,8 +9576,7 @@ func (c *ProjectsLocationsImportJobsRunCall) Header() http.Header { func (c *ProjectsLocationsImportJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runimportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runimportjobrequest) if err != nil { return nil, err } @@ -9708,8 +9676,7 @@ func (c *ProjectsLocationsImportJobsValidateCall) Header() http.Header { func (c *ProjectsLocationsImportJobsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateimportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateimportjobrequest) if err != nil { return nil, err } @@ -9832,8 +9799,7 @@ func (c *ProjectsLocationsImportJobsImportDataFilesCreateCall) Header() http.Hea func (c *ProjectsLocationsImportJobsImportDataFilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdatafile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdatafile) if err != nil { return nil, err } @@ -9947,12 +9913,11 @@ func (c *ProjectsLocationsImportJobsImportDataFilesDeleteCall) Header() http.Hea func (c *ProjectsLocationsImportJobsImportDataFilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10054,12 +10019,11 @@ func (c *ProjectsLocationsImportJobsImportDataFilesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10192,12 +10156,11 @@ func (c *ProjectsLocationsImportJobsImportDataFilesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/importDataFiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10319,8 +10282,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -10421,12 +10383,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10530,12 +10491,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10658,12 +10618,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10804,8 +10763,7 @@ func (c *ProjectsLocationsPreferenceSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsPreferenceSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.preferenceset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.preferenceset) if err != nil { return nil, err } @@ -10919,12 +10877,11 @@ func (c *ProjectsLocationsPreferenceSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPreferenceSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11026,12 +10983,11 @@ func (c *ProjectsLocationsPreferenceSetsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11156,12 +11112,11 @@ func (c *ProjectsLocationsPreferenceSetsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/preferenceSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11301,8 +11256,7 @@ func (c *ProjectsLocationsPreferenceSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsPreferenceSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.preferenceset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.preferenceset) if err != nil { return nil, err } @@ -11429,8 +11383,7 @@ func (c *ProjectsLocationsReportConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportconfig) if err != nil { return nil, err } @@ -11552,12 +11505,11 @@ func (c *ProjectsLocationsReportConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11659,12 +11611,11 @@ func (c *ProjectsLocationsReportConfigsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11794,12 +11745,11 @@ func (c *ProjectsLocationsReportConfigsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reportConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11939,8 +11889,7 @@ func (c *ProjectsLocationsReportConfigsReportsCreateCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report) if err != nil { return nil, err } @@ -12054,12 +12003,11 @@ func (c *ProjectsLocationsReportConfigsReportsDeleteCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12186,12 +12134,11 @@ func (c *ProjectsLocationsReportConfigsReportsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12346,12 +12293,11 @@ func (c *ProjectsLocationsReportConfigsReportsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12491,8 +12437,7 @@ func (c *ProjectsLocationsSourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -12606,12 +12551,11 @@ func (c *ProjectsLocationsSourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12713,12 +12657,11 @@ func (c *ProjectsLocationsSourcesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12848,12 +12791,11 @@ func (c *ProjectsLocationsSourcesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12993,8 +12935,7 @@ func (c *ProjectsLocationsSourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -13125,12 +13066,11 @@ func (c *ProjectsLocationsSourcesErrorFramesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13266,12 +13206,11 @@ func (c *ProjectsLocationsSourcesErrorFramesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/errorFrames") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/migrationcenter/v1alpha1/migrationcenter-gen.go b/migrationcenter/v1alpha1/migrationcenter-gen.go index dbc58a67893..9194375b529 100644 --- a/migrationcenter/v1alpha1/migrationcenter-gen.go +++ b/migrationcenter/v1alpha1/migrationcenter-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -7620,12 +7619,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7727,12 +7725,11 @@ func (c *ProjectsLocationsGetSettingsCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7858,12 +7855,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8003,8 +7999,7 @@ func (c *ProjectsLocationsUpdateSettingsCall) Header() http.Header { func (c *ProjectsLocationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) if err != nil { return nil, err } @@ -8104,8 +8099,7 @@ func (c *ProjectsLocationsAssetsAggregateValuesCall) Header() http.Header { func (c *ProjectsLocationsAssetsAggregateValuesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.aggregateassetsvaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.aggregateassetsvaluesrequest) if err != nil { return nil, err } @@ -8206,8 +8200,7 @@ func (c *ProjectsLocationsAssetsBatchDeleteCall) Header() http.Header { func (c *ProjectsLocationsAssetsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleteassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeleteassetsrequest) if err != nil { return nil, err } @@ -8307,8 +8300,7 @@ func (c *ProjectsLocationsAssetsBatchUpdateCall) Header() http.Header { func (c *ProjectsLocationsAssetsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdateassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdateassetsrequest) if err != nil { return nil, err } @@ -8423,12 +8415,11 @@ func (c *ProjectsLocationsAssetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAssetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8555,12 +8546,11 @@ func (c *ProjectsLocationsAssetsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8723,12 +8713,11 @@ func (c *ProjectsLocationsAssetsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8868,8 +8857,7 @@ func (c *ProjectsLocationsAssetsPatchCall) Header() http.Header { func (c *ProjectsLocationsAssetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asset) if err != nil { return nil, err } @@ -8976,8 +8964,7 @@ func (c *ProjectsLocationsAssetsReportAssetFramesCall) Header() http.Header { func (c *ProjectsLocationsAssetsReportAssetFramesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.frames) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.frames) if err != nil { return nil, err } @@ -9101,8 +9088,7 @@ func (c *ProjectsLocationsAssetsExportJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsAssetsExportJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.assetsexportjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.assetsexportjob) if err != nil { return nil, err } @@ -9200,12 +9186,11 @@ func (c *ProjectsLocationsAssetsExportJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAssetsExportJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9307,12 +9292,11 @@ func (c *ProjectsLocationsAssetsExportJobsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9430,12 +9414,11 @@ func (c *ProjectsLocationsAssetsExportJobsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/assetsExportJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9549,8 +9532,7 @@ func (c *ProjectsLocationsAssetsExportJobsRunCall) Header() http.Header { func (c *ProjectsLocationsAssetsExportJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetsexportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runassetsexportjobrequest) if err != nil { return nil, err } @@ -9677,8 +9659,7 @@ func (c *ProjectsLocationsDiscoveryClientsCreateCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.discoveryclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.discoveryclient) if err != nil { return nil, err } @@ -9792,12 +9773,11 @@ func (c *ProjectsLocationsDiscoveryClientsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryClientsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9899,12 +9879,11 @@ func (c *ProjectsLocationsDiscoveryClientsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10037,12 +10016,11 @@ func (c *ProjectsLocationsDiscoveryClientsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/discoveryClients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10183,8 +10161,7 @@ func (c *ProjectsLocationsDiscoveryClientsPatchCall) Header() http.Header { func (c *ProjectsLocationsDiscoveryClientsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.discoveryclient) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.discoveryclient) if err != nil { return nil, err } @@ -10285,8 +10262,7 @@ func (c *ProjectsLocationsDiscoveryClientsSendHeartbeatCall) Header() http.Heade func (c *ProjectsLocationsDiscoveryClientsSendHeartbeatCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.senddiscoveryclientheartbeatrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.senddiscoveryclientheartbeatrequest) if err != nil { return nil, err } @@ -10386,8 +10362,7 @@ func (c *ProjectsLocationsGroupsAddAssetsCall) Header() http.Header { func (c *ProjectsLocationsGroupsAddAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addassetstogrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addassetstogrouprequest) if err != nil { return nil, err } @@ -10513,8 +10488,7 @@ func (c *ProjectsLocationsGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -10628,12 +10602,11 @@ func (c *ProjectsLocationsGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10735,12 +10708,11 @@ func (c *ProjectsLocationsGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10870,12 +10842,11 @@ func (c *ProjectsLocationsGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11015,8 +10986,7 @@ func (c *ProjectsLocationsGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -11116,8 +11086,7 @@ func (c *ProjectsLocationsGroupsRemoveAssetsCall) Header() http.Header { func (c *ProjectsLocationsGroupsRemoveAssetsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeassetsfromgrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeassetsfromgrouprequest) if err != nil { return nil, err } @@ -11240,8 +11209,7 @@ func (c *ProjectsLocationsImportJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsImportJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importjob) if err != nil { return nil, err } @@ -11363,12 +11331,11 @@ func (c *ProjectsLocationsImportJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsImportJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11491,12 +11458,11 @@ func (c *ProjectsLocationsImportJobsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11647,12 +11613,11 @@ func (c *ProjectsLocationsImportJobsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/importJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11792,8 +11757,7 @@ func (c *ProjectsLocationsImportJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsImportJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importjob) if err != nil { return nil, err } @@ -11893,8 +11857,7 @@ func (c *ProjectsLocationsImportJobsRunCall) Header() http.Header { func (c *ProjectsLocationsImportJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runimportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runimportjobrequest) if err != nil { return nil, err } @@ -11994,8 +11957,7 @@ func (c *ProjectsLocationsImportJobsValidateCall) Header() http.Header { func (c *ProjectsLocationsImportJobsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateimportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateimportjobrequest) if err != nil { return nil, err } @@ -12118,8 +12080,7 @@ func (c *ProjectsLocationsImportJobsImportDataFilesCreateCall) Header() http.Hea func (c *ProjectsLocationsImportJobsImportDataFilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdatafile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdatafile) if err != nil { return nil, err } @@ -12233,12 +12194,11 @@ func (c *ProjectsLocationsImportJobsImportDataFilesDeleteCall) Header() http.Hea func (c *ProjectsLocationsImportJobsImportDataFilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12340,12 +12300,11 @@ func (c *ProjectsLocationsImportJobsImportDataFilesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12478,12 +12437,11 @@ func (c *ProjectsLocationsImportJobsImportDataFilesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/importDataFiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12605,8 +12563,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12707,12 +12664,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12816,12 +12772,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12944,12 +12899,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13085,8 +13039,7 @@ func (c *ProjectsLocationsPreferenceSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsPreferenceSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.preferenceset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.preferenceset) if err != nil { return nil, err } @@ -13200,12 +13153,11 @@ func (c *ProjectsLocationsPreferenceSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPreferenceSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13307,12 +13259,11 @@ func (c *ProjectsLocationsPreferenceSetsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13437,12 +13388,11 @@ func (c *ProjectsLocationsPreferenceSetsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/preferenceSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13582,8 +13532,7 @@ func (c *ProjectsLocationsPreferenceSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsPreferenceSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.preferenceset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.preferenceset) if err != nil { return nil, err } @@ -13693,12 +13642,11 @@ func (c *ProjectsLocationsRelationsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13828,12 +13776,11 @@ func (c *ProjectsLocationsRelationsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/relations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13974,8 +13921,7 @@ func (c *ProjectsLocationsReportConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportconfig) if err != nil { return nil, err } @@ -14097,12 +14043,11 @@ func (c *ProjectsLocationsReportConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14204,12 +14149,11 @@ func (c *ProjectsLocationsReportConfigsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14339,12 +14283,11 @@ func (c *ProjectsLocationsReportConfigsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/reportConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14484,8 +14427,7 @@ func (c *ProjectsLocationsReportConfigsReportsCreateCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report) if err != nil { return nil, err } @@ -14599,12 +14541,11 @@ func (c *ProjectsLocationsReportConfigsReportsDeleteCall) Header() http.Header { func (c *ProjectsLocationsReportConfigsReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14731,12 +14672,11 @@ func (c *ProjectsLocationsReportConfigsReportsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14891,12 +14831,11 @@ func (c *ProjectsLocationsReportConfigsReportsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15036,8 +14975,7 @@ func (c *ProjectsLocationsSourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -15151,12 +15089,11 @@ func (c *ProjectsLocationsSourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15258,12 +15195,11 @@ func (c *ProjectsLocationsSourcesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15393,12 +15329,11 @@ func (c *ProjectsLocationsSourcesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15538,8 +15473,7 @@ func (c *ProjectsLocationsSourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -15670,12 +15604,11 @@ func (c *ProjectsLocationsSourcesErrorFramesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15811,12 +15744,11 @@ func (c *ProjectsLocationsSourcesErrorFramesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/errorFrames") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/ml/v1/ml-gen.go b/ml/v1/ml-gen.go index 5d11b81bb8c..35e96be6b49 100644 --- a/ml/v1/ml-gen.go +++ b/ml/v1/ml-gen.go @@ -125,7 +125,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -144,9 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4005,8 +4004,7 @@ func (c *ProjectsExplainCall) Header() http.Header { func (c *ProjectsExplainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__explainrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__explainrequest) if err != nil { return nil, err } @@ -4120,12 +4118,11 @@ func (c *ProjectsGetConfigCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4220,8 +4217,7 @@ func (c *ProjectsPredictCall) Header() http.Header { func (c *ProjectsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body = strings.NewReader(c.googlecloudmlv1__predictrequest.HttpBody.Data) + body := bytes.NewBufferString(c.googlecloudmlv1__predictrequest.HttpBody.Data) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:predict") @@ -4327,8 +4323,7 @@ func (c *ProjectsJobsCancelCall) Header() http.Header { func (c *ProjectsJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__canceljobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__canceljobrequest) if err != nil { return nil, err } @@ -4429,8 +4424,7 @@ func (c *ProjectsJobsCreateCall) Header() http.Header { func (c *ProjectsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__job) if err != nil { return nil, err } @@ -4541,12 +4535,11 @@ func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4669,12 +4662,11 @@ func (c *ProjectsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4808,12 +4800,11 @@ func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4944,8 +4935,7 @@ func (c *ProjectsJobsPatchCall) Header() http.Header { func (c *ProjectsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__job) if err != nil { return nil, err } @@ -5050,8 +5040,7 @@ func (c *ProjectsJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__setiampolicyrequest) if err != nil { return nil, err } @@ -5159,8 +5148,7 @@ func (c *ProjectsJobsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__testiampermissionsrequest) if err != nil { return nil, err } @@ -5272,12 +5260,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5399,12 +5386,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5524,12 +5510,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5634,12 +5619,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5741,8 +5725,7 @@ func (c *ProjectsLocationsStudiesCreateCall) Header() http.Header { func (c *ProjectsLocationsStudiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__study) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__study) if err != nil { return nil, err } @@ -5841,12 +5824,11 @@ func (c *ProjectsLocationsStudiesDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5949,12 +5931,11 @@ func (c *ProjectsLocationsStudiesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6058,12 +6039,11 @@ func (c *ProjectsLocationsStudiesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/studies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6157,8 +6137,7 @@ func (c *ProjectsLocationsStudiesTrialsAddMeasurementCall) Header() http.Header func (c *ProjectsLocationsStudiesTrialsAddMeasurementCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__addtrialmeasurementrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__addtrialmeasurementrequest) if err != nil { return nil, err } @@ -6261,8 +6240,7 @@ func (c *ProjectsLocationsStudiesTrialsCheckEarlyStoppingStateCall) Header() htt func (c *ProjectsLocationsStudiesTrialsCheckEarlyStoppingStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__checktrialearlystoppingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__checktrialearlystoppingstaterequest) if err != nil { return nil, err } @@ -6363,8 +6341,7 @@ func (c *ProjectsLocationsStudiesTrialsCompleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__completetrialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__completetrialrequest) if err != nil { return nil, err } @@ -6465,8 +6442,7 @@ func (c *ProjectsLocationsStudiesTrialsCreateCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__trial) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__trial) if err != nil { return nil, err } @@ -6565,12 +6541,11 @@ func (c *ProjectsLocationsStudiesTrialsDeleteCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6673,12 +6648,11 @@ func (c *ProjectsLocationsStudiesTrialsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6781,12 +6755,11 @@ func (c *ProjectsLocationsStudiesTrialsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/trials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6882,8 +6855,7 @@ func (c *ProjectsLocationsStudiesTrialsListOptimalTrialsCall) Header() http.Head func (c *ProjectsLocationsStudiesTrialsListOptimalTrialsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__listoptimaltrialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__listoptimaltrialsrequest) if err != nil { return nil, err } @@ -6984,8 +6956,7 @@ func (c *ProjectsLocationsStudiesTrialsStopCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__stoptrialrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__stoptrialrequest) if err != nil { return nil, err } @@ -7089,8 +7060,7 @@ func (c *ProjectsLocationsStudiesTrialsSuggestCall) Header() http.Header { func (c *ProjectsLocationsStudiesTrialsSuggestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__suggesttrialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__suggesttrialsrequest) if err != nil { return nil, err } @@ -7193,8 +7163,7 @@ func (c *ProjectsModelsCreateCall) Header() http.Header { func (c *ProjectsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__model) if err != nil { return nil, err } @@ -7295,12 +7264,11 @@ func (c *ProjectsModelsDeleteCall) Header() http.Header { func (c *ProjectsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7405,12 +7373,11 @@ func (c *ProjectsModelsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7533,12 +7500,11 @@ func (c *ProjectsModelsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7669,12 +7635,11 @@ func (c *ProjectsModelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7802,8 +7767,7 @@ func (c *ProjectsModelsPatchCall) Header() http.Header { func (c *ProjectsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__model) if err != nil { return nil, err } @@ -7908,8 +7872,7 @@ func (c *ProjectsModelsSetIamPolicyCall) Header() http.Header { func (c *ProjectsModelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__setiampolicyrequest) if err != nil { return nil, err } @@ -8017,8 +7980,7 @@ func (c *ProjectsModelsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsModelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1__testiampermissionsrequest) if err != nil { return nil, err } @@ -8124,8 +8086,7 @@ func (c *ProjectsModelsVersionsCreateCall) Header() http.Header { func (c *ProjectsModelsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__version) if err != nil { return nil, err } @@ -8228,12 +8189,11 @@ func (c *ProjectsModelsVersionsDeleteCall) Header() http.Header { func (c *ProjectsModelsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8338,12 +8298,11 @@ func (c *ProjectsModelsVersionsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8475,12 +8434,11 @@ func (c *ProjectsModelsVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8611,8 +8569,7 @@ func (c *ProjectsModelsVersionsPatchCall) Header() http.Header { func (c *ProjectsModelsVersionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__version) if err != nil { return nil, err } @@ -8719,8 +8676,7 @@ func (c *ProjectsModelsVersionsSetDefaultCall) Header() http.Header { func (c *ProjectsModelsVersionsSetDefaultCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__setdefaultversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudmlv1__setdefaultversionrequest) if err != nil { return nil, err } @@ -8827,12 +8783,11 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8937,12 +8892,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9066,12 +9020,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/monitoring/v1/monitoring-gen.go b/monitoring/v1/monitoring-gen.go index 6bcc33e3d35..3dfec75106c 100644 --- a/monitoring/v1/monitoring-gen.go +++ b/monitoring/v1/monitoring-gen.go @@ -133,7 +133,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Locations = NewLocationsService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -152,11 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Locations = NewLocationsService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3193,12 +3192,11 @@ func (c *LocationsGlobalMetricsScopesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3307,12 +3305,11 @@ func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3405,8 +3402,7 @@ func (c *LocationsGlobalMetricsScopesProjectsCreateCall) Header() http.Header { func (c *LocationsGlobalMetricsScopesProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.monitoredproject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.monitoredproject) if err != nil { return nil, err } @@ -3508,12 +3504,11 @@ func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) Header() http.Header { func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3617,12 +3612,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3728,8 +3722,7 @@ func (c *ProjectsDashboardsCreateCall) Header() http.Header { func (c *ProjectsDashboardsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dashboard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dashboard) if err != nil { return nil, err } @@ -3831,12 +3824,11 @@ func (c *ProjectsDashboardsDeleteCall) Header() http.Header { func (c *ProjectsDashboardsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3944,12 +3936,11 @@ func (c *ProjectsDashboardsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4072,12 +4063,11 @@ func (c *ProjectsDashboardsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dashboards") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4201,8 +4191,7 @@ func (c *ProjectsDashboardsPatchCall) Header() http.Header { func (c *ProjectsDashboardsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dashboard) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dashboard) if err != nil { return nil, err } @@ -4308,8 +4297,7 @@ func (c *ProjectsLocationPrometheusApiV1LabelsCall) Header() http.Header { func (c *ProjectsLocationPrometheusApiV1LabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querylabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querylabelsrequest) if err != nil { return nil, err } @@ -4417,8 +4405,7 @@ func (c *ProjectsLocationPrometheusApiV1QueryCall) Header() http.Header { func (c *ProjectsLocationPrometheusApiV1QueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryinstantrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryinstantrequest) if err != nil { return nil, err } @@ -4526,8 +4513,7 @@ func (c *ProjectsLocationPrometheusApiV1QueryExemplarsCall) Header() http.Header func (c *ProjectsLocationPrometheusApiV1QueryExemplarsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryexemplarsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryexemplarsrequest) if err != nil { return nil, err } @@ -4635,8 +4621,7 @@ func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) Header() http.Header { func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryrangerequest) if err != nil { return nil, err } @@ -4744,8 +4729,7 @@ func (c *ProjectsLocationPrometheusApiV1SeriesCall) Header() http.Header { func (c *ProjectsLocationPrometheusApiV1SeriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queryseriesrequest) if err != nil { return nil, err } @@ -4888,12 +4872,11 @@ func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/label/{label}/values") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5018,12 +5001,11 @@ func (c *ProjectsLocationPrometheusApiV1MetadataListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/metadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/monitoring/v3/monitoring-gen.go b/monitoring/v3/monitoring-gen.go index 77d1ddf4e13..49273b8feb8 100644 --- a/monitoring/v3/monitoring-gen.go +++ b/monitoring/v3/monitoring-gen.go @@ -135,7 +135,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + s.Services = NewServicesService(s) + s.UptimeCheckIps = NewUptimeCheckIpsService(s) if err != nil { return nil, err } @@ -154,13 +159,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - s.Services = NewServicesService(s) - s.UptimeCheckIps = NewUptimeCheckIpsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6559,12 +6558,11 @@ func (c *FoldersTimeSeriesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7327,12 +7325,11 @@ func (c *OrganizationsTimeSeriesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7458,8 +7455,7 @@ func (c *ProjectsAlertPoliciesCreateCall) Header() http.Header { func (c *ProjectsAlertPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.alertpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.alertpolicy) if err != nil { return nil, err } @@ -7562,12 +7558,11 @@ func (c *ProjectsAlertPoliciesDeleteCall) Header() http.Header { func (c *ProjectsAlertPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7670,12 +7665,11 @@ func (c *ProjectsAlertPoliciesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7818,12 +7812,11 @@ func (c *ProjectsAlertPoliciesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/alertPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7968,8 +7961,7 @@ func (c *ProjectsAlertPoliciesPatchCall) Header() http.Header { func (c *ProjectsAlertPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.alertpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.alertpolicy) if err != nil { return nil, err } @@ -8073,8 +8065,7 @@ func (c *ProjectsCollectdTimeSeriesCreateCall) Header() http.Header { func (c *ProjectsCollectdTimeSeriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcollectdtimeseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcollectdtimeseriesrequest) if err != nil { return nil, err } @@ -8184,8 +8175,7 @@ func (c *ProjectsGroupsCreateCall) Header() http.Header { func (c *ProjectsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -8293,12 +8283,11 @@ func (c *ProjectsGroupsDeleteCall) Header() http.Header { func (c *ProjectsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8401,12 +8390,11 @@ func (c *ProjectsGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8556,12 +8544,11 @@ func (c *ProjectsGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8687,8 +8674,7 @@ func (c *ProjectsGroupsUpdateCall) Header() http.Header { func (c *ProjectsGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -8841,12 +8827,11 @@ func (c *ProjectsGroupsMembersListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/members") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8966,8 +8951,7 @@ func (c *ProjectsMetricDescriptorsCreateCall) Header() http.Header { func (c *ProjectsMetricDescriptorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metricdescriptor) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.metricdescriptor) if err != nil { return nil, err } @@ -9069,12 +9053,11 @@ func (c *ProjectsMetricDescriptorsDeleteCall) Header() http.Header { func (c *ProjectsMetricDescriptorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9179,12 +9162,11 @@ func (c *ProjectsMetricDescriptorsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9319,12 +9301,11 @@ func (c *ProjectsMetricDescriptorsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/metricDescriptors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9450,12 +9431,11 @@ func (c *ProjectsMonitoredResourceDescriptorsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9587,12 +9567,11 @@ func (c *ProjectsMonitoredResourceDescriptorsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/monitoredResourceDescriptors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9719,12 +9698,11 @@ func (c *ProjectsNotificationChannelDescriptorsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9850,12 +9828,11 @@ func (c *ProjectsNotificationChannelDescriptorsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/notificationChannelDescriptors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9980,8 +9957,7 @@ func (c *ProjectsNotificationChannelsCreateCall) Header() http.Header { func (c *ProjectsNotificationChannelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationchannel) if err != nil { return nil, err } @@ -10093,12 +10069,11 @@ func (c *ProjectsNotificationChannelsDeleteCall) Header() http.Header { func (c *ProjectsNotificationChannelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10205,12 +10180,11 @@ func (c *ProjectsNotificationChannelsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10322,8 +10296,7 @@ func (c *ProjectsNotificationChannelsGetVerificationCodeCall) Header() http.Head func (c *ProjectsNotificationChannelsGetVerificationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getnotificationchannelverificationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getnotificationchannelverificationcoderequest) if err != nil { return nil, err } @@ -10476,12 +10449,11 @@ func (c *ProjectsNotificationChannelsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/notificationChannels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10607,8 +10579,7 @@ func (c *ProjectsNotificationChannelsPatchCall) Header() http.Header { func (c *ProjectsNotificationChannelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationchannel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationchannel) if err != nil { return nil, err } @@ -10711,8 +10682,7 @@ func (c *ProjectsNotificationChannelsSendVerificationCodeCall) Header() http.Hea func (c *ProjectsNotificationChannelsSendVerificationCodeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendnotificationchannelverificationcoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendnotificationchannelverificationcoderequest) if err != nil { return nil, err } @@ -10814,8 +10784,7 @@ func (c *ProjectsNotificationChannelsVerifyCall) Header() http.Header { func (c *ProjectsNotificationChannelsVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifynotificationchannelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifynotificationchannelrequest) if err != nil { return nil, err } @@ -10920,8 +10889,7 @@ func (c *ProjectsSnoozesCreateCall) Header() http.Header { func (c *ProjectsSnoozesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snooze) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snooze) if err != nil { return nil, err } @@ -11032,12 +11000,11 @@ func (c *ProjectsSnoozesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11169,12 +11136,11 @@ func (c *ProjectsSnoozesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/snoozes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11308,8 +11274,7 @@ func (c *ProjectsSnoozesPatchCall) Header() http.Header { func (c *ProjectsSnoozesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snooze) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.snooze) if err != nil { return nil, err } @@ -11416,8 +11381,7 @@ func (c *ProjectsTimeSeriesCreateCall) Header() http.Header { func (c *ProjectsTimeSeriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtimeseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtimeseriesrequest) if err != nil { return nil, err } @@ -11525,8 +11489,7 @@ func (c *ProjectsTimeSeriesCreateServiceCall) Header() http.Header { func (c *ProjectsTimeSeriesCreateServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtimeseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtimeseriesrequest) if err != nil { return nil, err } @@ -12275,12 +12238,11 @@ func (c *ProjectsTimeSeriesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12399,8 +12361,7 @@ func (c *ProjectsTimeSeriesQueryCall) Header() http.Header { func (c *ProjectsTimeSeriesQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.querytimeseriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.querytimeseriesrequest) if err != nil { return nil, err } @@ -12524,8 +12485,7 @@ func (c *ProjectsUptimeCheckConfigsCreateCall) Header() http.Header { func (c *ProjectsUptimeCheckConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uptimecheckconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uptimecheckconfig) if err != nil { return nil, err } @@ -12627,12 +12587,11 @@ func (c *ProjectsUptimeCheckConfigsDeleteCall) Header() http.Header { func (c *ProjectsUptimeCheckConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12735,12 +12694,11 @@ func (c *ProjectsUptimeCheckConfigsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12874,12 +12832,11 @@ func (c *ProjectsUptimeCheckConfigsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/uptimeCheckConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13011,8 +12968,7 @@ func (c *ProjectsUptimeCheckConfigsPatchCall) Header() http.Header { func (c *ProjectsUptimeCheckConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.uptimecheckconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.uptimecheckconfig) if err != nil { return nil, err } @@ -13123,8 +13079,7 @@ func (c *ServicesCreateCall) Header() http.Header { func (c *ServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -13223,12 +13178,11 @@ func (c *ServicesDeleteCall) Header() http.Header { func (c *ServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13331,12 +13285,11 @@ func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13478,12 +13431,11 @@ func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13605,8 +13557,7 @@ func (c *ServicesPatchCall) Header() http.Header { func (c *ServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -13716,8 +13667,7 @@ func (c *ServicesServiceLevelObjectivesCreateCall) Header() http.Header { func (c *ServicesServiceLevelObjectivesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelevelobjective) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelevelobjective) if err != nil { return nil, err } @@ -13818,12 +13768,11 @@ func (c *ServicesServiceLevelObjectivesDeleteCall) Header() http.Header { func (c *ServicesServiceLevelObjectivesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13951,12 +13900,11 @@ func (c *ServicesServiceLevelObjectivesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14109,12 +14057,11 @@ func (c *ServicesServiceLevelObjectivesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/serviceLevelObjectives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14238,8 +14185,7 @@ func (c *ServicesServiceLevelObjectivesPatchCall) Header() http.Header { func (c *ServicesServiceLevelObjectivesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelevelobjective) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelevelobjective) if err != nil { return nil, err } @@ -14366,12 +14312,11 @@ func (c *UptimeCheckIpsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/uptimeCheckIps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go b/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go index 1fa10bfef65..718b387dab5 100644 --- a/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go +++ b/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go @@ -103,7 +103,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Locations = NewLocationsService(s) if err != nil { return nil, err } @@ -122,10 +124,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Locations = NewLocationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -747,8 +746,7 @@ func (c *AccountsCreateCall) Header() http.Header { func (c *AccountsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -856,12 +854,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -998,12 +995,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1129,8 +1125,7 @@ func (c *AccountsPatchCall) Header() http.Header { func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -1234,8 +1229,7 @@ func (c *AccountsAdminsCreateCall) Header() http.Header { func (c *AccountsAdminsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.admin) if err != nil { return nil, err } @@ -1334,12 +1328,11 @@ func (c *AccountsAdminsDeleteCall) Header() http.Header { func (c *AccountsAdminsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1442,12 +1435,11 @@ func (c *AccountsAdminsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/admins") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1550,8 +1542,7 @@ func (c *AccountsAdminsPatchCall) Header() http.Header { func (c *AccountsAdminsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.admin) if err != nil { return nil, err } @@ -1652,8 +1643,7 @@ func (c *AccountsInvitationsAcceptCall) Header() http.Header { func (c *AccountsInvitationsAcceptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acceptinvitationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acceptinvitationrequest) if err != nil { return nil, err } @@ -1754,8 +1744,7 @@ func (c *AccountsInvitationsDeclineCall) Header() http.Header { func (c *AccountsInvitationsDeclineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.declineinvitationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.declineinvitationrequest) if err != nil { return nil, err } @@ -1873,12 +1862,11 @@ func (c *AccountsInvitationsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/invitations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1974,8 +1962,7 @@ func (c *LocationsTransferCall) Header() http.Header { func (c *LocationsTransferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferlocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferlocationrequest) if err != nil { return nil, err } @@ -2079,8 +2066,7 @@ func (c *LocationsAdminsCreateCall) Header() http.Header { func (c *LocationsAdminsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.admin) if err != nil { return nil, err } @@ -2178,12 +2164,11 @@ func (c *LocationsAdminsDeleteCall) Header() http.Header { func (c *LocationsAdminsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2286,12 +2271,11 @@ func (c *LocationsAdminsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/admins") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2395,8 +2379,7 @@ func (c *LocationsAdminsPatchCall) Header() http.Header { func (c *LocationsAdminsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.admin) if err != nil { return nil, err } diff --git a/mybusinessbusinessinformation/v1/mybusinessbusinessinformation-gen.go b/mybusinessbusinessinformation/v1/mybusinessbusinessinformation-gen.go index bd3c412d10d..3aef516752f 100644 --- a/mybusinessbusinessinformation/v1/mybusinessbusinessinformation-gen.go +++ b/mybusinessbusinessinformation/v1/mybusinessbusinessinformation-gen.go @@ -103,7 +103,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Attributes = NewAttributesService(s) + s.Categories = NewCategoriesService(s) + s.Chains = NewChainsService(s) + s.GoogleLocations = NewGoogleLocationsService(s) + s.Locations = NewLocationsService(s) if err != nil { return nil, err } @@ -122,14 +128,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - s.Attributes = NewAttributesService(s) - s.Categories = NewCategoriesService(s) - s.Chains = NewChainsService(s) - s.GoogleLocations = NewGoogleLocationsService(s) - s.Locations = NewLocationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1993,8 +1992,7 @@ func (c *AccountsLocationsCreateCall) Header() http.Header { func (c *AccountsLocationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.location) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.location) if err != nil { return nil, err } @@ -2153,12 +2151,11 @@ func (c *AccountsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2334,12 +2331,11 @@ func (c *AttributesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/attributes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2500,12 +2496,11 @@ func (c *CategoriesBatchGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/categories:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2659,12 +2654,11 @@ func (c *CategoriesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/categories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2786,12 +2780,11 @@ func (c *ChainsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2905,12 +2898,11 @@ func (c *ChainsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/chains:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2997,8 +2989,7 @@ func (c *GoogleLocationsSearchCall) Header() http.Header { func (c *GoogleLocationsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchgooglelocationsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchgooglelocationsrequest) if err != nil { return nil, err } @@ -3097,12 +3088,11 @@ func (c *LocationsDeleteCall) Header() http.Header { func (c *LocationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3211,12 +3201,11 @@ func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3319,12 +3308,11 @@ func (c *LocationsGetAttributesCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3433,12 +3421,11 @@ func (c *LocationsGetGoogleUpdatedCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getGoogleUpdated") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3548,8 +3535,7 @@ func (c *LocationsPatchCall) Header() http.Header { func (c *LocationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.location) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.location) if err != nil { return nil, err } @@ -3665,8 +3651,7 @@ func (c *LocationsUpdateAttributesCall) Header() http.Header { func (c *LocationsUpdateAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributes) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributes) if err != nil { return nil, err } @@ -3777,12 +3762,11 @@ func (c *LocationsAttributesGetGoogleUpdatedCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getGoogleUpdated") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/mybusinesslodging/v1/mybusinesslodging-gen.go b/mybusinesslodging/v1/mybusinesslodging-gen.go index 3749f9b9293..5d3b6988a42 100644 --- a/mybusinesslodging/v1/mybusinesslodging-gen.go +++ b/mybusinesslodging/v1/mybusinesslodging-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Locations = NewLocationsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Locations = NewLocationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5419,12 +5418,11 @@ func (c *LocationsGetLodgingCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5526,8 +5524,7 @@ func (c *LocationsUpdateLodgingCall) Header() http.Header { func (c *LocationsUpdateLodgingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lodging) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lodging) if err != nil { return nil, err } @@ -5646,12 +5643,11 @@ func (c *LocationsLodgingGetGoogleUpdatedCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getGoogleUpdated") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/mybusinessnotifications/v1/mybusinessnotifications-gen.go b/mybusinessnotifications/v1/mybusinessnotifications-gen.go index 76774fcc258..5857160d55d 100644 --- a/mybusinessnotifications/v1/mybusinessnotifications-gen.go +++ b/mybusinessnotifications/v1/mybusinessnotifications-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -281,12 +280,11 @@ func (c *AccountsGetNotificationSettingCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -393,8 +391,7 @@ func (c *AccountsUpdateNotificationSettingCall) Header() http.Header { func (c *AccountsUpdateNotificationSettingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationsetting) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationsetting) if err != nil { return nil, err } diff --git a/mybusinessplaceactions/v1/mybusinessplaceactions-gen.go b/mybusinessplaceactions/v1/mybusinessplaceactions-gen.go index 383a0756efb..ec1bf37f581 100644 --- a/mybusinessplaceactions/v1/mybusinessplaceactions-gen.go +++ b/mybusinessplaceactions/v1/mybusinessplaceactions-gen.go @@ -103,7 +103,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Locations = NewLocationsService(s) + s.PlaceActionTypeMetadata = NewPlaceActionTypeMetadataService(s) if err != nil { return nil, err } @@ -122,10 +124,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Locations = NewLocationsService(s) - s.PlaceActionTypeMetadata = NewPlaceActionTypeMetadataService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -404,8 +403,7 @@ func (c *LocationsPlaceActionLinksCreateCall) Header() http.Header { func (c *LocationsPlaceActionLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placeactionlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placeactionlink) if err != nil { return nil, err } @@ -505,12 +503,11 @@ func (c *LocationsPlaceActionLinksDeleteCall) Header() http.Header { func (c *LocationsPlaceActionLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -612,12 +609,11 @@ func (c *LocationsPlaceActionLinksGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -744,12 +740,11 @@ func (c *LocationsPlaceActionLinksListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -879,8 +874,7 @@ func (c *LocationsPlaceActionLinksPatchCall) Header() http.Header { func (c *LocationsPlaceActionLinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.placeactionlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placeactionlink) if err != nil { return nil, err } @@ -1024,12 +1018,11 @@ func (c *PlaceActionTypeMetadataListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/placeActionTypeMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/mybusinessqanda/v1/mybusinessqanda-gen.go b/mybusinessqanda/v1/mybusinessqanda-gen.go index 97d0d8d56c3..c3a39aad274 100644 --- a/mybusinessqanda/v1/mybusinessqanda-gen.go +++ b/mybusinessqanda/v1/mybusinessqanda-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Locations = NewLocationsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Locations = NewLocationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -435,8 +434,7 @@ func (c *LocationsQuestionsCreateCall) Header() http.Header { func (c *LocationsQuestionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.question) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.question) if err != nil { return nil, err } @@ -534,12 +532,11 @@ func (c *LocationsQuestionsDeleteCall) Header() http.Header { func (c *LocationsQuestionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -682,12 +679,11 @@ func (c *LocationsQuestionsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -809,8 +805,7 @@ func (c *LocationsQuestionsPatchCall) Header() http.Header { func (c *LocationsQuestionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.question) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.question) if err != nil { return nil, err } @@ -908,12 +903,11 @@ func (c *LocationsQuestionsAnswersDeleteCall) Header() http.Header { func (c *LocationsQuestionsAnswersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/answers:delete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1038,12 +1032,11 @@ func (c *LocationsQuestionsAnswersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/answers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1158,8 +1151,7 @@ func (c *LocationsQuestionsAnswersUpsertCall) Header() http.Header { func (c *LocationsQuestionsAnswersUpsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upsertanswerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upsertanswerrequest) if err != nil { return nil, err } diff --git a/mybusinessverifications/v1/mybusinessverifications-gen.go b/mybusinessverifications/v1/mybusinessverifications-gen.go index a3e0178d48e..21b48446b8d 100644 --- a/mybusinessverifications/v1/mybusinessverifications-gen.go +++ b/mybusinessverifications/v1/mybusinessverifications-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Locations = NewLocationsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Locations = NewLocationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -852,8 +851,7 @@ func (c *LocationsFetchVerificationOptionsCall) Header() http.Header { func (c *LocationsFetchVerificationOptionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchverificationoptionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchverificationoptionsrequest) if err != nil { return nil, err } @@ -964,12 +962,11 @@ func (c *LocationsGetVoiceOfMerchantStateCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/VoiceOfMerchantState") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1062,8 +1059,7 @@ func (c *LocationsVerifyCall) Header() http.Header { func (c *LocationsVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifylocationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifylocationrequest) if err != nil { return nil, err } @@ -1166,8 +1162,7 @@ func (c *LocationsVerificationsCompleteCall) Header() http.Header { func (c *LocationsVerificationsCompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeverificationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.completeverificationrequest) if err != nil { return nil, err } @@ -1294,12 +1289,11 @@ func (c *LocationsVerificationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/verifications") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/networkconnectivity/v1/networkconnectivity-gen.go b/networkconnectivity/v1/networkconnectivity-gen.go index 1c075e089f5..fbcac19e434 100644 --- a/networkconnectivity/v1/networkconnectivity-gen.go +++ b/networkconnectivity/v1/networkconnectivity-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3675,12 +3674,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3806,12 +3804,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3926,8 +3923,7 @@ func (c *ProjectsLocationsGlobalHubsAcceptSpokeCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsAcceptSpokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accepthubspokerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accepthubspokerequest) if err != nil { return nil, err } @@ -4053,8 +4049,7 @@ func (c *ProjectsLocationsGlobalHubsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hub) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hub) if err != nil { return nil, err } @@ -4170,12 +4165,11 @@ func (c *ProjectsLocationsGlobalHubsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4278,12 +4272,11 @@ func (c *ProjectsLocationsGlobalHubsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4405,12 +4398,11 @@ func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4540,12 +4532,11 @@ func (c *ProjectsLocationsGlobalHubsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/hubs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4732,12 +4723,11 @@ func (c *ProjectsLocationsGlobalHubsListSpokesCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listSpokes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4881,8 +4871,7 @@ func (c *ProjectsLocationsGlobalHubsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hub) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hub) if err != nil { return nil, err } @@ -5043,12 +5032,11 @@ func (c *ProjectsLocationsGlobalHubsQueryStatusCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:queryStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5165,8 +5153,7 @@ func (c *ProjectsLocationsGlobalHubsRejectSpokeCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsRejectSpokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rejecthubspokerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rejecthubspokerequest) if err != nil { return nil, err } @@ -5271,8 +5258,7 @@ func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5379,8 +5365,7 @@ func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5491,12 +5476,11 @@ func (c *ProjectsLocationsGlobalHubsGroupsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5618,12 +5602,11 @@ func (c *ProjectsLocationsGlobalHubsGroupsGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5752,12 +5735,11 @@ func (c *ProjectsLocationsGlobalHubsGroupsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5900,8 +5882,7 @@ func (c *ProjectsLocationsGlobalHubsGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -6006,8 +5987,7 @@ func (c *ProjectsLocationsGlobalHubsGroupsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsGlobalHubsGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6114,8 +6094,7 @@ func (c *ProjectsLocationsGlobalHubsGroupsTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsGlobalHubsGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6226,12 +6205,11 @@ func (c *ProjectsLocationsGlobalHubsRouteTablesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6360,12 +6338,11 @@ func (c *ProjectsLocationsGlobalHubsRouteTablesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routeTables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6489,12 +6466,11 @@ func (c *ProjectsLocationsGlobalHubsRouteTablesRoutesGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6623,12 +6599,11 @@ func (c *ProjectsLocationsGlobalHubsRouteTablesRoutesListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6765,8 +6740,7 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesCreateCall) Header() http.Heade func (c *ProjectsLocationsGlobalPolicyBasedRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policybasedroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policybasedroute) if err != nil { return nil, err } @@ -6881,12 +6855,11 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesDeleteCall) Header() http.Heade func (c *ProjectsLocationsGlobalPolicyBasedRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6989,12 +6962,11 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7117,12 +7089,11 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7251,12 +7222,11 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policyBasedRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7374,8 +7344,7 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesSetIamPolicyCall) Header() http func (c *ProjectsLocationsGlobalPolicyBasedRoutesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7482,8 +7451,7 @@ func (c *ProjectsLocationsGlobalPolicyBasedRoutesTestIamPermissionsCall) Header( func (c *ProjectsLocationsGlobalPolicyBasedRoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7608,8 +7576,7 @@ func (c *ProjectsLocationsInternalRangesCreateCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.internalrange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.internalrange) if err != nil { return nil, err } @@ -7724,12 +7691,11 @@ func (c *ProjectsLocationsInternalRangesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7832,12 +7798,11 @@ func (c *ProjectsLocationsInternalRangesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7966,12 +7931,11 @@ func (c *ProjectsLocationsInternalRangesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/internalRanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8114,8 +8078,7 @@ func (c *ProjectsLocationsInternalRangesPatchCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.internalrange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.internalrange) if err != nil { return nil, err } @@ -8224,8 +8187,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -8326,12 +8288,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8435,12 +8396,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8564,12 +8524,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8706,8 +8665,7 @@ func (c *ProjectsLocationsRegionalEndpointsCreateCall) Header() http.Header { func (c *ProjectsLocationsRegionalEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionalendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.regionalendpoint) if err != nil { return nil, err } @@ -8822,12 +8780,11 @@ func (c *ProjectsLocationsRegionalEndpointsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRegionalEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8932,12 +8889,11 @@ func (c *ProjectsLocationsRegionalEndpointsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9068,12 +9024,11 @@ func (c *ProjectsLocationsRegionalEndpointsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/regionalEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9209,12 +9164,11 @@ func (c *ProjectsLocationsServiceClassesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServiceClassesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9317,12 +9271,11 @@ func (c *ProjectsLocationsServiceClassesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9444,12 +9397,11 @@ func (c *ProjectsLocationsServiceClassesGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9578,12 +9530,11 @@ func (c *ProjectsLocationsServiceClassesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceClasses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9726,8 +9677,7 @@ func (c *ProjectsLocationsServiceClassesPatchCall) Header() http.Header { func (c *ProjectsLocationsServiceClassesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceclass) if err != nil { return nil, err } @@ -9832,8 +9782,7 @@ func (c *ProjectsLocationsServiceClassesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServiceClassesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9940,8 +9889,7 @@ func (c *ProjectsLocationsServiceClassesTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsServiceClassesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10069,8 +10017,7 @@ func (c *ProjectsLocationsServiceConnectionMapsCreateCall) Header() http.Header func (c *ProjectsLocationsServiceConnectionMapsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceconnectionmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceconnectionmap) if err != nil { return nil, err } @@ -10193,12 +10140,11 @@ func (c *ProjectsLocationsServiceConnectionMapsDeleteCall) Header() http.Header func (c *ProjectsLocationsServiceConnectionMapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10301,12 +10247,11 @@ func (c *ProjectsLocationsServiceConnectionMapsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10429,12 +10374,11 @@ func (c *ProjectsLocationsServiceConnectionMapsGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10563,12 +10507,11 @@ func (c *ProjectsLocationsServiceConnectionMapsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceConnectionMaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10712,8 +10655,7 @@ func (c *ProjectsLocationsServiceConnectionMapsPatchCall) Header() http.Header { func (c *ProjectsLocationsServiceConnectionMapsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceconnectionmap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceconnectionmap) if err != nil { return nil, err } @@ -10818,8 +10760,7 @@ func (c *ProjectsLocationsServiceConnectionMapsSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsServiceConnectionMapsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10926,8 +10867,7 @@ func (c *ProjectsLocationsServiceConnectionMapsTestIamPermissionsCall) Header() func (c *ProjectsLocationsServiceConnectionMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11055,8 +10995,7 @@ func (c *ProjectsLocationsServiceConnectionPoliciesCreateCall) Header() http.Hea func (c *ProjectsLocationsServiceConnectionPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceconnectionpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceconnectionpolicy) if err != nil { return nil, err } @@ -11179,12 +11118,11 @@ func (c *ProjectsLocationsServiceConnectionPoliciesDeleteCall) Header() http.Hea func (c *ProjectsLocationsServiceConnectionPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11287,12 +11225,11 @@ func (c *ProjectsLocationsServiceConnectionPoliciesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11415,12 +11352,11 @@ func (c *ProjectsLocationsServiceConnectionPoliciesGetIamPolicyCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11549,12 +11485,11 @@ func (c *ProjectsLocationsServiceConnectionPoliciesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceConnectionPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11698,8 +11633,7 @@ func (c *ProjectsLocationsServiceConnectionPoliciesPatchCall) Header() http.Head func (c *ProjectsLocationsServiceConnectionPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceconnectionpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceconnectionpolicy) if err != nil { return nil, err } @@ -11804,8 +11738,7 @@ func (c *ProjectsLocationsServiceConnectionPoliciesSetIamPolicyCall) Header() ht func (c *ProjectsLocationsServiceConnectionPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11912,8 +11845,7 @@ func (c *ProjectsLocationsServiceConnectionPoliciesTestIamPermissionsCall) Heade func (c *ProjectsLocationsServiceConnectionPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12042,8 +11974,7 @@ func (c *ProjectsLocationsServiceConnectionTokensCreateCall) Header() http.Heade func (c *ProjectsLocationsServiceConnectionTokensCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceconnectiontoken) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.serviceconnectiontoken) if err != nil { return nil, err } @@ -12166,12 +12097,11 @@ func (c *ProjectsLocationsServiceConnectionTokensDeleteCall) Header() http.Heade func (c *ProjectsLocationsServiceConnectionTokensDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12274,12 +12204,11 @@ func (c *ProjectsLocationsServiceConnectionTokensGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12409,12 +12338,11 @@ func (c *ProjectsLocationsServiceConnectionTokensListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceConnectionTokens") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12552,8 +12480,7 @@ func (c *ProjectsLocationsSpokesCreateCall) Header() http.Header { func (c *ProjectsLocationsSpokesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.spoke) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.spoke) if err != nil { return nil, err } @@ -12669,12 +12596,11 @@ func (c *ProjectsLocationsSpokesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSpokesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12777,12 +12703,11 @@ func (c *ProjectsLocationsSpokesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12904,12 +12829,11 @@ func (c *ProjectsLocationsSpokesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13039,12 +12963,11 @@ func (c *ProjectsLocationsSpokesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/spokes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13187,8 +13110,7 @@ func (c *ProjectsLocationsSpokesPatchCall) Header() http.Header { func (c *ProjectsLocationsSpokesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.spoke) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.spoke) if err != nil { return nil, err } @@ -13293,8 +13215,7 @@ func (c *ProjectsLocationsSpokesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsSpokesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13401,8 +13322,7 @@ func (c *ProjectsLocationsSpokesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsSpokesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/networkconnectivity/v1alpha1/networkconnectivity-gen.go b/networkconnectivity/v1alpha1/networkconnectivity-gen.go index 14207277294..8123df39315 100644 --- a/networkconnectivity/v1alpha1/networkconnectivity-gen.go +++ b/networkconnectivity/v1alpha1/networkconnectivity-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1301,12 +1300,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1432,12 +1430,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1575,8 +1572,7 @@ func (c *ProjectsLocationsGlobalHubsCreateCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hub) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hub) if err != nil { return nil, err } @@ -1692,12 +1688,11 @@ func (c *ProjectsLocationsGlobalHubsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1800,12 +1795,11 @@ func (c *ProjectsLocationsGlobalHubsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1927,12 +1921,11 @@ func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2062,12 +2055,11 @@ func (c *ProjectsLocationsGlobalHubsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/hubs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2209,8 +2201,7 @@ func (c *ProjectsLocationsGlobalHubsPatchCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hub) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hub) if err != nil { return nil, err } @@ -2315,8 +2306,7 @@ func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2423,8 +2413,7 @@ func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2549,8 +2538,7 @@ func (c *ProjectsLocationsInternalRangesCreateCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.internalrange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.internalrange) if err != nil { return nil, err } @@ -2665,12 +2653,11 @@ func (c *ProjectsLocationsInternalRangesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2773,12 +2760,11 @@ func (c *ProjectsLocationsInternalRangesGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2900,12 +2886,11 @@ func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3034,12 +3019,11 @@ func (c *ProjectsLocationsInternalRangesListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/internalRanges") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3182,8 +3166,7 @@ func (c *ProjectsLocationsInternalRangesPatchCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.internalrange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.internalrange) if err != nil { return nil, err } @@ -3288,8 +3271,7 @@ func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3396,8 +3378,7 @@ func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) Header() http.He func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3506,8 +3487,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -3608,12 +3588,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3717,12 +3696,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3846,12 +3824,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3989,8 +3966,7 @@ func (c *ProjectsLocationsSpokesCreateCall) Header() http.Header { func (c *ProjectsLocationsSpokesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.spoke) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.spoke) if err != nil { return nil, err } @@ -4106,12 +4082,11 @@ func (c *ProjectsLocationsSpokesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSpokesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4214,12 +4189,11 @@ func (c *ProjectsLocationsSpokesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4341,12 +4315,11 @@ func (c *ProjectsLocationsSpokesGetIamPolicyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4476,12 +4449,11 @@ func (c *ProjectsLocationsSpokesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/spokes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4622,8 +4594,7 @@ func (c *ProjectsLocationsSpokesPatchCall) Header() http.Header { func (c *ProjectsLocationsSpokesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.spoke) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.spoke) if err != nil { return nil, err } @@ -4728,8 +4699,7 @@ func (c *ProjectsLocationsSpokesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsSpokesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4836,8 +4806,7 @@ func (c *ProjectsLocationsSpokesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsSpokesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/networkmanagement/v1/networkmanagement-gen.go b/networkmanagement/v1/networkmanagement-gen.go index b95b0f0d918..222954b5059 100644 --- a/networkmanagement/v1/networkmanagement-gen.go +++ b/networkmanagement/v1/networkmanagement-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3100,12 +3099,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3231,12 +3229,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3369,8 +3366,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) Header() http.Heade func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectivitytest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectivitytest) if err != nil { return nil, err } @@ -3469,12 +3465,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) Header() http.Heade func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3577,12 +3572,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3705,12 +3699,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3849,12 +3842,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectivityTests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3986,8 +3978,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) Header() http.Header func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectivitytest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectivitytest) if err != nil { return nil, err } @@ -4096,8 +4087,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) Header() http.Header func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rerunconnectivitytestrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rerunconnectivitytestrequest) if err != nil { return nil, err } @@ -4201,8 +4191,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) Header() http func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4309,8 +4298,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) Header( func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4419,8 +4407,7 @@ func (c *ProjectsLocationsGlobalOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4521,12 +4508,11 @@ func (c *ProjectsLocationsGlobalOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4630,12 +4616,11 @@ func (c *ProjectsLocationsGlobalOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4758,12 +4743,11 @@ func (c *ProjectsLocationsGlobalOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/networkmanagement/v1beta1/networkmanagement-gen.go b/networkmanagement/v1beta1/networkmanagement-gen.go index df2ce81a471..54d807c7cbf 100644 --- a/networkmanagement/v1beta1/networkmanagement-gen.go +++ b/networkmanagement/v1beta1/networkmanagement-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3256,12 +3255,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3387,12 +3385,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3525,8 +3522,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) Header() http.Heade func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectivitytest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectivitytest) if err != nil { return nil, err } @@ -3625,12 +3621,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) Header() http.Heade func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3733,12 +3728,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3861,12 +3855,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4005,12 +3998,11 @@ func (c *ProjectsLocationsGlobalConnectivityTestsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectivityTests") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4142,8 +4134,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) Header() http.Header func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectivitytest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connectivitytest) if err != nil { return nil, err } @@ -4252,8 +4243,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) Header() http.Header func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rerunconnectivitytestrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rerunconnectivitytestrequest) if err != nil { return nil, err } @@ -4357,8 +4347,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) Header() http func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4465,8 +4454,7 @@ func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) Header( func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4575,8 +4563,7 @@ func (c *ProjectsLocationsGlobalOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4677,12 +4664,11 @@ func (c *ProjectsLocationsGlobalOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4786,12 +4772,11 @@ func (c *ProjectsLocationsGlobalOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4914,12 +4899,11 @@ func (c *ProjectsLocationsGlobalOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5047,8 +5031,7 @@ func (c *ProjectsLocationsVpcFlowLogsConfigsCreateCall) Header() http.Header { func (c *ProjectsLocationsVpcFlowLogsConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpcflowlogsconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpcflowlogsconfig) if err != nil { return nil, err } @@ -5148,12 +5131,11 @@ func (c *ProjectsLocationsVpcFlowLogsConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsVpcFlowLogsConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5257,12 +5239,11 @@ func (c *ProjectsLocationsVpcFlowLogsConfigsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5396,12 +5377,11 @@ func (c *ProjectsLocationsVpcFlowLogsConfigsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/vpcFlowLogsConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5531,8 +5511,7 @@ func (c *ProjectsLocationsVpcFlowLogsConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsVpcFlowLogsConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpcflowlogsconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vpcflowlogsconfig) if err != nil { return nil, err } diff --git a/networksecurity/v1/networksecurity-gen.go b/networksecurity/v1/networksecurity-gen.go index 615ab678022..5b914eaafbf 100644 --- a/networksecurity/v1/networksecurity-gen.go +++ b/networksecurity/v1/networksecurity-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3305,8 +3304,7 @@ func (c *OrganizationsLocationsAddressGroupsAddItemsCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsAddItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addaddressgroupitemsrequest) if err != nil { return nil, err } @@ -3407,8 +3405,7 @@ func (c *OrganizationsLocationsAddressGroupsCloneItemsCall) Header() http.Header func (c *OrganizationsLocationsAddressGroupsCloneItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloneaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloneaddressgroupitemsrequest) if err != nil { return nil, err } @@ -3534,8 +3531,7 @@ func (c *OrganizationsLocationsAddressGroupsCreateCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -3650,12 +3646,11 @@ func (c *OrganizationsLocationsAddressGroupsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3758,12 +3753,11 @@ func (c *OrganizationsLocationsAddressGroupsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3882,12 +3876,11 @@ func (c *OrganizationsLocationsAddressGroupsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/addressGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4029,12 +4022,11 @@ func (c *OrganizationsLocationsAddressGroupsListReferencesCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+addressGroup}:listReferences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4176,8 +4168,7 @@ func (c *OrganizationsLocationsAddressGroupsPatchCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -4278,8 +4269,7 @@ func (c *OrganizationsLocationsAddressGroupsRemoveItemsCall) Header() http.Heade func (c *OrganizationsLocationsAddressGroupsRemoveItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeaddressgroupitemsrequest) if err != nil { return nil, err } @@ -4404,8 +4394,7 @@ func (c *OrganizationsLocationsFirewallEndpointsCreateCall) Header() http.Header func (c *OrganizationsLocationsFirewallEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpoint) if err != nil { return nil, err } @@ -4519,12 +4508,11 @@ func (c *OrganizationsLocationsFirewallEndpointsDeleteCall) Header() http.Header func (c *OrganizationsLocationsFirewallEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4626,12 +4614,11 @@ func (c *OrganizationsLocationsFirewallEndpointsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4762,12 +4749,11 @@ func (c *OrganizationsLocationsFirewallEndpointsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/firewallEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4908,8 +4894,7 @@ func (c *OrganizationsLocationsFirewallEndpointsPatchCall) Header() http.Header func (c *OrganizationsLocationsFirewallEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpoint) if err != nil { return nil, err } @@ -5017,8 +5002,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5119,12 +5103,11 @@ func (c *OrganizationsLocationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5228,12 +5211,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5356,12 +5338,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5487,8 +5468,7 @@ func (c *OrganizationsLocationsSecurityProfileGroupsCreateCall) Header() http.He func (c *OrganizationsLocationsSecurityProfileGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofilegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofilegroup) if err != nil { return nil, err } @@ -5595,12 +5575,11 @@ func (c *OrganizationsLocationsSecurityProfileGroupsDeleteCall) Header() http.He func (c *OrganizationsLocationsSecurityProfileGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5704,12 +5683,11 @@ func (c *OrganizationsLocationsSecurityProfileGroupsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5830,12 +5808,11 @@ func (c *OrganizationsLocationsSecurityProfileGroupsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityProfileGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5962,8 +5939,7 @@ func (c *OrganizationsLocationsSecurityProfileGroupsPatchCall) Header() http.Hea func (c *OrganizationsLocationsSecurityProfileGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofilegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofilegroup) if err != nil { return nil, err } @@ -6073,8 +6049,7 @@ func (c *OrganizationsLocationsSecurityProfilesCreateCall) Header() http.Header func (c *OrganizationsLocationsSecurityProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofile) if err != nil { return nil, err } @@ -6181,12 +6156,11 @@ func (c *OrganizationsLocationsSecurityProfilesDeleteCall) Header() http.Header func (c *OrganizationsLocationsSecurityProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6290,12 +6264,11 @@ func (c *OrganizationsLocationsSecurityProfilesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6416,12 +6389,11 @@ func (c *OrganizationsLocationsSecurityProfilesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6548,8 +6520,7 @@ func (c *OrganizationsLocationsSecurityProfilesPatchCall) Header() http.Header { func (c *OrganizationsLocationsSecurityProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofile) if err != nil { return nil, err } @@ -6659,12 +6630,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6790,12 +6760,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6910,8 +6879,7 @@ func (c *ProjectsLocationsAddressGroupsAddItemsCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsAddItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addaddressgroupitemsrequest) if err != nil { return nil, err } @@ -7012,8 +6980,7 @@ func (c *ProjectsLocationsAddressGroupsCloneItemsCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsCloneItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloneaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloneaddressgroupitemsrequest) if err != nil { return nil, err } @@ -7139,8 +7106,7 @@ func (c *ProjectsLocationsAddressGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -7255,12 +7221,11 @@ func (c *ProjectsLocationsAddressGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7363,12 +7328,11 @@ func (c *ProjectsLocationsAddressGroupsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7490,12 +7454,11 @@ func (c *ProjectsLocationsAddressGroupsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7615,12 +7578,11 @@ func (c *ProjectsLocationsAddressGroupsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/addressGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7762,12 +7724,11 @@ func (c *ProjectsLocationsAddressGroupsListReferencesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+addressGroup}:listReferences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7909,8 +7870,7 @@ func (c *ProjectsLocationsAddressGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -8011,8 +7971,7 @@ func (c *ProjectsLocationsAddressGroupsRemoveItemsCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsRemoveItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeaddressgroupitemsrequest) if err != nil { return nil, err } @@ -8116,8 +8075,7 @@ func (c *ProjectsLocationsAddressGroupsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -8225,8 +8183,7 @@ func (c *ProjectsLocationsAddressGroupsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsAddressGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -8338,8 +8295,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesCreateCall) Header() http.Header func (c *ProjectsLocationsAuthorizationPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizationpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizationpolicy) if err != nil { return nil, err } @@ -8438,12 +8394,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesDeleteCall) Header() http.Header func (c *ProjectsLocationsAuthorizationPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8546,12 +8501,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8674,12 +8628,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8800,12 +8753,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authorizationPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8931,8 +8883,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsAuthorizationPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizationpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizationpolicy) if err != nil { return nil, err } @@ -9036,8 +8987,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsAuthorizationPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -9145,8 +9095,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesTestIamPermissionsCall) Header() func (c *ProjectsLocationsAuthorizationPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -9271,8 +9220,7 @@ func (c *ProjectsLocationsAuthzPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzpolicy) if err != nil { return nil, err } @@ -9388,12 +9336,11 @@ func (c *ProjectsLocationsAuthzPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9496,12 +9443,11 @@ func (c *ProjectsLocationsAuthzPoliciesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9623,12 +9569,11 @@ func (c *ProjectsLocationsAuthzPoliciesGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9761,12 +9706,11 @@ func (c *ProjectsLocationsAuthzPoliciesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authzPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9908,8 +9852,7 @@ func (c *ProjectsLocationsAuthzPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzpolicy) if err != nil { return nil, err } @@ -10013,8 +9956,7 @@ func (c *ProjectsLocationsAuthzPoliciesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -10122,8 +10064,7 @@ func (c *ProjectsLocationsAuthzPoliciesTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsAuthzPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -10234,8 +10175,7 @@ func (c *ProjectsLocationsClientTlsPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsClientTlsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clienttlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clienttlspolicy) if err != nil { return nil, err } @@ -10334,12 +10274,11 @@ func (c *ProjectsLocationsClientTlsPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsClientTlsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10442,12 +10381,11 @@ func (c *ProjectsLocationsClientTlsPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10570,12 +10508,11 @@ func (c *ProjectsLocationsClientTlsPoliciesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10695,12 +10632,11 @@ func (c *ProjectsLocationsClientTlsPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clientTlsPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10826,8 +10762,7 @@ func (c *ProjectsLocationsClientTlsPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsClientTlsPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clienttlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clienttlspolicy) if err != nil { return nil, err } @@ -10931,8 +10866,7 @@ func (c *ProjectsLocationsClientTlsPoliciesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsClientTlsPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -11040,8 +10974,7 @@ func (c *ProjectsLocationsClientTlsPoliciesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsClientTlsPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -11168,8 +11101,7 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsCreateCall) Header() http. func (c *ProjectsLocationsFirewallEndpointAssociationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpointassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpointassociation) if err != nil { return nil, err } @@ -11283,12 +11215,11 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsDeleteCall) Header() http. func (c *ProjectsLocationsFirewallEndpointAssociationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11390,12 +11321,11 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11526,12 +11456,11 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/firewallEndpointAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11672,8 +11601,7 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsPatchCall) Header() http.H func (c *ProjectsLocationsFirewallEndpointAssociationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpointassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpointassociation) if err != nil { return nil, err } @@ -11784,8 +11712,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesCreateCall) Header() http.Heade func (c *ProjectsLocationsGatewaySecurityPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicy) if err != nil { return nil, err } @@ -11884,12 +11811,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesDeleteCall) Header() http.Heade func (c *ProjectsLocationsGatewaySecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11992,12 +11918,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12118,12 +12043,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gatewaySecurityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12251,8 +12175,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesPatchCall) Header() http.Header func (c *ProjectsLocationsGatewaySecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicy) if err != nil { return nil, err } @@ -12362,8 +12285,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesCreateCall) Header() http. func (c *ProjectsLocationsGatewaySecurityPoliciesRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicyrule) if err != nil { return nil, err } @@ -12464,12 +12386,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesDeleteCall) Header() http. func (c *ProjectsLocationsGatewaySecurityPoliciesRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12572,12 +12493,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12699,12 +12619,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12832,8 +12751,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesPatchCall) Header() http.H func (c *ProjectsLocationsGatewaySecurityPoliciesRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicyrule) if err != nil { return nil, err } @@ -12941,8 +12859,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -13043,12 +12960,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13152,12 +13068,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13280,12 +13195,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13409,8 +13323,7 @@ func (c *ProjectsLocationsServerTlsPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsServerTlsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servertlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servertlspolicy) if err != nil { return nil, err } @@ -13509,12 +13422,11 @@ func (c *ProjectsLocationsServerTlsPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServerTlsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13617,12 +13529,11 @@ func (c *ProjectsLocationsServerTlsPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13745,12 +13656,11 @@ func (c *ProjectsLocationsServerTlsPoliciesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13870,12 +13780,11 @@ func (c *ProjectsLocationsServerTlsPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serverTlsPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14001,8 +13910,7 @@ func (c *ProjectsLocationsServerTlsPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsServerTlsPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servertlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servertlspolicy) if err != nil { return nil, err } @@ -14106,8 +14014,7 @@ func (c *ProjectsLocationsServerTlsPoliciesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsServerTlsPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -14215,8 +14122,7 @@ func (c *ProjectsLocationsServerTlsPoliciesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsServerTlsPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -14328,8 +14234,7 @@ func (c *ProjectsLocationsTlsInspectionPoliciesCreateCall) Header() http.Header func (c *ProjectsLocationsTlsInspectionPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsinspectionpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsinspectionpolicy) if err != nil { return nil, err } @@ -14437,12 +14342,11 @@ func (c *ProjectsLocationsTlsInspectionPoliciesDeleteCall) Header() http.Header func (c *ProjectsLocationsTlsInspectionPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14546,12 +14450,11 @@ func (c *ProjectsLocationsTlsInspectionPoliciesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14672,12 +14575,11 @@ func (c *ProjectsLocationsTlsInspectionPoliciesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tlsInspectionPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14805,8 +14707,7 @@ func (c *ProjectsLocationsTlsInspectionPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsTlsInspectionPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsinspectionpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsinspectionpolicy) if err != nil { return nil, err } @@ -14916,8 +14817,7 @@ func (c *ProjectsLocationsUrlListsCreateCall) Header() http.Header { func (c *ProjectsLocationsUrlListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urllist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urllist) if err != nil { return nil, err } @@ -15016,12 +14916,11 @@ func (c *ProjectsLocationsUrlListsDeleteCall) Header() http.Header { func (c *ProjectsLocationsUrlListsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15124,12 +15023,11 @@ func (c *ProjectsLocationsUrlListsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15248,12 +15146,11 @@ func (c *ProjectsLocationsUrlListsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/urlLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15379,8 +15276,7 @@ func (c *ProjectsLocationsUrlListsPatchCall) Header() http.Header { func (c *ProjectsLocationsUrlListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urllist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urllist) if err != nil { return nil, err } diff --git a/networksecurity/v1beta1/networksecurity-gen.go b/networksecurity/v1beta1/networksecurity-gen.go index 8a16220b089..907966a4418 100644 --- a/networksecurity/v1beta1/networksecurity-gen.go +++ b/networksecurity/v1beta1/networksecurity-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4256,8 +4255,7 @@ func (c *OrganizationsLocationsAddressGroupsAddItemsCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsAddItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addaddressgroupitemsrequest) if err != nil { return nil, err } @@ -4358,8 +4356,7 @@ func (c *OrganizationsLocationsAddressGroupsCloneItemsCall) Header() http.Header func (c *OrganizationsLocationsAddressGroupsCloneItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloneaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloneaddressgroupitemsrequest) if err != nil { return nil, err } @@ -4485,8 +4482,7 @@ func (c *OrganizationsLocationsAddressGroupsCreateCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -4601,12 +4597,11 @@ func (c *OrganizationsLocationsAddressGroupsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4709,12 +4704,11 @@ func (c *OrganizationsLocationsAddressGroupsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4833,12 +4827,11 @@ func (c *OrganizationsLocationsAddressGroupsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/addressGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4980,12 +4973,11 @@ func (c *OrganizationsLocationsAddressGroupsListReferencesCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+addressGroup}:listReferences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5127,8 +5119,7 @@ func (c *OrganizationsLocationsAddressGroupsPatchCall) Header() http.Header { func (c *OrganizationsLocationsAddressGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -5229,8 +5220,7 @@ func (c *OrganizationsLocationsAddressGroupsRemoveItemsCall) Header() http.Heade func (c *OrganizationsLocationsAddressGroupsRemoveItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeaddressgroupitemsrequest) if err != nil { return nil, err } @@ -5355,8 +5345,7 @@ func (c *OrganizationsLocationsFirewallEndpointsCreateCall) Header() http.Header func (c *OrganizationsLocationsFirewallEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpoint) if err != nil { return nil, err } @@ -5470,12 +5459,11 @@ func (c *OrganizationsLocationsFirewallEndpointsDeleteCall) Header() http.Header func (c *OrganizationsLocationsFirewallEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5577,12 +5565,11 @@ func (c *OrganizationsLocationsFirewallEndpointsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5713,12 +5700,11 @@ func (c *OrganizationsLocationsFirewallEndpointsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/firewallEndpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5859,8 +5845,7 @@ func (c *OrganizationsLocationsFirewallEndpointsPatchCall) Header() http.Header func (c *OrganizationsLocationsFirewallEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpoint) if err != nil { return nil, err } @@ -5968,8 +5953,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6070,12 +6054,11 @@ func (c *OrganizationsLocationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6179,12 +6162,11 @@ func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6307,12 +6289,11 @@ func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6438,8 +6419,7 @@ func (c *OrganizationsLocationsSecurityProfileGroupsCreateCall) Header() http.He func (c *OrganizationsLocationsSecurityProfileGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofilegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofilegroup) if err != nil { return nil, err } @@ -6546,12 +6526,11 @@ func (c *OrganizationsLocationsSecurityProfileGroupsDeleteCall) Header() http.He func (c *OrganizationsLocationsSecurityProfileGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6655,12 +6634,11 @@ func (c *OrganizationsLocationsSecurityProfileGroupsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6781,12 +6759,11 @@ func (c *OrganizationsLocationsSecurityProfileGroupsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/securityProfileGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6913,8 +6890,7 @@ func (c *OrganizationsLocationsSecurityProfileGroupsPatchCall) Header() http.Hea func (c *OrganizationsLocationsSecurityProfileGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofilegroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofilegroup) if err != nil { return nil, err } @@ -7024,8 +7000,7 @@ func (c *OrganizationsLocationsSecurityProfilesCreateCall) Header() http.Header func (c *OrganizationsLocationsSecurityProfilesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofile) if err != nil { return nil, err } @@ -7132,12 +7107,11 @@ func (c *OrganizationsLocationsSecurityProfilesDeleteCall) Header() http.Header func (c *OrganizationsLocationsSecurityProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7241,12 +7215,11 @@ func (c *OrganizationsLocationsSecurityProfilesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7367,12 +7340,11 @@ func (c *OrganizationsLocationsSecurityProfilesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/securityProfiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7499,8 +7471,7 @@ func (c *OrganizationsLocationsSecurityProfilesPatchCall) Header() http.Header { func (c *OrganizationsLocationsSecurityProfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityprofile) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityprofile) if err != nil { return nil, err } @@ -7610,12 +7581,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7741,12 +7711,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7861,8 +7830,7 @@ func (c *ProjectsLocationsAddressGroupsAddItemsCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsAddItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addaddressgroupitemsrequest) if err != nil { return nil, err } @@ -7963,8 +7931,7 @@ func (c *ProjectsLocationsAddressGroupsCloneItemsCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsCloneItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloneaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cloneaddressgroupitemsrequest) if err != nil { return nil, err } @@ -8090,8 +8057,7 @@ func (c *ProjectsLocationsAddressGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -8206,12 +8172,11 @@ func (c *ProjectsLocationsAddressGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8314,12 +8279,11 @@ func (c *ProjectsLocationsAddressGroupsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8441,12 +8405,11 @@ func (c *ProjectsLocationsAddressGroupsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8566,12 +8529,11 @@ func (c *ProjectsLocationsAddressGroupsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/addressGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8713,12 +8675,11 @@ func (c *ProjectsLocationsAddressGroupsListReferencesCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+addressGroup}:listReferences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8860,8 +8821,7 @@ func (c *ProjectsLocationsAddressGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addressgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addressgroup) if err != nil { return nil, err } @@ -8962,8 +8922,7 @@ func (c *ProjectsLocationsAddressGroupsRemoveItemsCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsRemoveItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeaddressgroupitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeaddressgroupitemsrequest) if err != nil { return nil, err } @@ -9067,8 +9026,7 @@ func (c *ProjectsLocationsAddressGroupsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAddressGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -9176,8 +9134,7 @@ func (c *ProjectsLocationsAddressGroupsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsAddressGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -9289,8 +9246,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesCreateCall) Header() http.Header func (c *ProjectsLocationsAuthorizationPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizationpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizationpolicy) if err != nil { return nil, err } @@ -9389,12 +9345,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesDeleteCall) Header() http.Header func (c *ProjectsLocationsAuthorizationPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9497,12 +9452,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9625,12 +9579,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9751,12 +9704,11 @@ func (c *ProjectsLocationsAuthorizationPoliciesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authorizationPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9882,8 +9834,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsAuthorizationPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizationpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authorizationpolicy) if err != nil { return nil, err } @@ -9987,8 +9938,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsAuthorizationPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -10096,8 +10046,7 @@ func (c *ProjectsLocationsAuthorizationPoliciesTestIamPermissionsCall) Header() func (c *ProjectsLocationsAuthorizationPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -10222,8 +10171,7 @@ func (c *ProjectsLocationsAuthzPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzpolicy) if err != nil { return nil, err } @@ -10339,12 +10287,11 @@ func (c *ProjectsLocationsAuthzPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10447,12 +10394,11 @@ func (c *ProjectsLocationsAuthzPoliciesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10574,12 +10520,11 @@ func (c *ProjectsLocationsAuthzPoliciesGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10712,12 +10657,11 @@ func (c *ProjectsLocationsAuthzPoliciesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authzPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10859,8 +10803,7 @@ func (c *ProjectsLocationsAuthzPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzpolicy) if err != nil { return nil, err } @@ -10964,8 +10907,7 @@ func (c *ProjectsLocationsAuthzPoliciesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsAuthzPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -11073,8 +11015,7 @@ func (c *ProjectsLocationsAuthzPoliciesTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsAuthzPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -11185,8 +11126,7 @@ func (c *ProjectsLocationsClientTlsPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsClientTlsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clienttlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clienttlspolicy) if err != nil { return nil, err } @@ -11285,12 +11225,11 @@ func (c *ProjectsLocationsClientTlsPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsClientTlsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11393,12 +11332,11 @@ func (c *ProjectsLocationsClientTlsPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11521,12 +11459,11 @@ func (c *ProjectsLocationsClientTlsPoliciesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11646,12 +11583,11 @@ func (c *ProjectsLocationsClientTlsPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clientTlsPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11777,8 +11713,7 @@ func (c *ProjectsLocationsClientTlsPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsClientTlsPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clienttlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clienttlspolicy) if err != nil { return nil, err } @@ -11882,8 +11817,7 @@ func (c *ProjectsLocationsClientTlsPoliciesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsClientTlsPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -11991,8 +11925,7 @@ func (c *ProjectsLocationsClientTlsPoliciesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsClientTlsPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -12119,8 +12052,7 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsCreateCall) Header() http. func (c *ProjectsLocationsFirewallEndpointAssociationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpointassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpointassociation) if err != nil { return nil, err } @@ -12234,12 +12166,11 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsDeleteCall) Header() http. func (c *ProjectsLocationsFirewallEndpointAssociationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12341,12 +12272,11 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12477,12 +12407,11 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/firewallEndpointAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12623,8 +12552,7 @@ func (c *ProjectsLocationsFirewallEndpointAssociationsPatchCall) Header() http.H func (c *ProjectsLocationsFirewallEndpointAssociationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallendpointassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.firewallendpointassociation) if err != nil { return nil, err } @@ -12735,8 +12663,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesCreateCall) Header() http.Heade func (c *ProjectsLocationsGatewaySecurityPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicy) if err != nil { return nil, err } @@ -12835,12 +12762,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesDeleteCall) Header() http.Heade func (c *ProjectsLocationsGatewaySecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12943,12 +12869,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13069,12 +12994,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/gatewaySecurityPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13202,8 +13126,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesPatchCall) Header() http.Header func (c *ProjectsLocationsGatewaySecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicy) if err != nil { return nil, err } @@ -13313,8 +13236,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesCreateCall) Header() http. func (c *ProjectsLocationsGatewaySecurityPoliciesRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicyrule) if err != nil { return nil, err } @@ -13415,12 +13337,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesDeleteCall) Header() http. func (c *ProjectsLocationsGatewaySecurityPoliciesRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13523,12 +13444,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13650,12 +13570,11 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13783,8 +13702,7 @@ func (c *ProjectsLocationsGatewaySecurityPoliciesRulesPatchCall) Header() http.H func (c *ProjectsLocationsGatewaySecurityPoliciesRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gatewaysecuritypolicyrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gatewaysecuritypolicyrule) if err != nil { return nil, err } @@ -13910,8 +13828,7 @@ func (c *ProjectsLocationsInterceptDeploymentGroupsCreateCall) Header() http.Hea func (c *ProjectsLocationsInterceptDeploymentGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptdeploymentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptdeploymentgroup) if err != nil { return nil, err } @@ -14025,12 +13942,11 @@ func (c *ProjectsLocationsInterceptDeploymentGroupsDeleteCall) Header() http.Hea func (c *ProjectsLocationsInterceptDeploymentGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14132,12 +14048,11 @@ func (c *ProjectsLocationsInterceptDeploymentGroupsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14268,12 +14183,11 @@ func (c *ProjectsLocationsInterceptDeploymentGroupsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/interceptDeploymentGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14414,8 +14328,7 @@ func (c *ProjectsLocationsInterceptDeploymentGroupsPatchCall) Header() http.Head func (c *ProjectsLocationsInterceptDeploymentGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptdeploymentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptdeploymentgroup) if err != nil { return nil, err } @@ -14540,8 +14453,7 @@ func (c *ProjectsLocationsInterceptDeploymentsCreateCall) Header() http.Header { func (c *ProjectsLocationsInterceptDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptdeployment) if err != nil { return nil, err } @@ -14655,12 +14567,11 @@ func (c *ProjectsLocationsInterceptDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsInterceptDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14762,12 +14673,11 @@ func (c *ProjectsLocationsInterceptDeploymentsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14898,12 +14808,11 @@ func (c *ProjectsLocationsInterceptDeploymentsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/interceptDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15044,8 +14953,7 @@ func (c *ProjectsLocationsInterceptDeploymentsPatchCall) Header() http.Header { func (c *ProjectsLocationsInterceptDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptdeployment) if err != nil { return nil, err } @@ -15172,8 +15080,7 @@ func (c *ProjectsLocationsInterceptEndpointGroupAssociationsCreateCall) Header() func (c *ProjectsLocationsInterceptEndpointGroupAssociationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptendpointgroupassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptendpointgroupassociation) if err != nil { return nil, err } @@ -15287,12 +15194,11 @@ func (c *ProjectsLocationsInterceptEndpointGroupAssociationsDeleteCall) Header() func (c *ProjectsLocationsInterceptEndpointGroupAssociationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15394,12 +15300,11 @@ func (c *ProjectsLocationsInterceptEndpointGroupAssociationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15531,12 +15436,11 @@ func (c *ProjectsLocationsInterceptEndpointGroupAssociationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/interceptEndpointGroupAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15678,8 +15582,7 @@ func (c *ProjectsLocationsInterceptEndpointGroupAssociationsPatchCall) Header() func (c *ProjectsLocationsInterceptEndpointGroupAssociationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptendpointgroupassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptendpointgroupassociation) if err != nil { return nil, err } @@ -15805,8 +15708,7 @@ func (c *ProjectsLocationsInterceptEndpointGroupsCreateCall) Header() http.Heade func (c *ProjectsLocationsInterceptEndpointGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptendpointgroup) if err != nil { return nil, err } @@ -15920,12 +15822,11 @@ func (c *ProjectsLocationsInterceptEndpointGroupsDeleteCall) Header() http.Heade func (c *ProjectsLocationsInterceptEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16027,12 +15928,11 @@ func (c *ProjectsLocationsInterceptEndpointGroupsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16163,12 +16063,11 @@ func (c *ProjectsLocationsInterceptEndpointGroupsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/interceptEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16309,8 +16208,7 @@ func (c *ProjectsLocationsInterceptEndpointGroupsPatchCall) Header() http.Header func (c *ProjectsLocationsInterceptEndpointGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interceptendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.interceptendpointgroup) if err != nil { return nil, err } @@ -16436,8 +16334,7 @@ func (c *ProjectsLocationsMirroringDeploymentGroupsCreateCall) Header() http.Hea func (c *ProjectsLocationsMirroringDeploymentGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringdeploymentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringdeploymentgroup) if err != nil { return nil, err } @@ -16551,12 +16448,11 @@ func (c *ProjectsLocationsMirroringDeploymentGroupsDeleteCall) Header() http.Hea func (c *ProjectsLocationsMirroringDeploymentGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16658,12 +16554,11 @@ func (c *ProjectsLocationsMirroringDeploymentGroupsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16794,12 +16689,11 @@ func (c *ProjectsLocationsMirroringDeploymentGroupsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/mirroringDeploymentGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16940,8 +16834,7 @@ func (c *ProjectsLocationsMirroringDeploymentGroupsPatchCall) Header() http.Head func (c *ProjectsLocationsMirroringDeploymentGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringdeploymentgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringdeploymentgroup) if err != nil { return nil, err } @@ -17066,8 +16959,7 @@ func (c *ProjectsLocationsMirroringDeploymentsCreateCall) Header() http.Header { func (c *ProjectsLocationsMirroringDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringdeployment) if err != nil { return nil, err } @@ -17181,12 +17073,11 @@ func (c *ProjectsLocationsMirroringDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMirroringDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17288,12 +17179,11 @@ func (c *ProjectsLocationsMirroringDeploymentsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17424,12 +17314,11 @@ func (c *ProjectsLocationsMirroringDeploymentsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/mirroringDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17570,8 +17459,7 @@ func (c *ProjectsLocationsMirroringDeploymentsPatchCall) Header() http.Header { func (c *ProjectsLocationsMirroringDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringdeployment) if err != nil { return nil, err } @@ -17698,8 +17586,7 @@ func (c *ProjectsLocationsMirroringEndpointGroupAssociationsCreateCall) Header() func (c *ProjectsLocationsMirroringEndpointGroupAssociationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringendpointgroupassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringendpointgroupassociation) if err != nil { return nil, err } @@ -17813,12 +17700,11 @@ func (c *ProjectsLocationsMirroringEndpointGroupAssociationsDeleteCall) Header() func (c *ProjectsLocationsMirroringEndpointGroupAssociationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17920,12 +17806,11 @@ func (c *ProjectsLocationsMirroringEndpointGroupAssociationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18057,12 +17942,11 @@ func (c *ProjectsLocationsMirroringEndpointGroupAssociationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/mirroringEndpointGroupAssociations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18204,8 +18088,7 @@ func (c *ProjectsLocationsMirroringEndpointGroupAssociationsPatchCall) Header() func (c *ProjectsLocationsMirroringEndpointGroupAssociationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringendpointgroupassociation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringendpointgroupassociation) if err != nil { return nil, err } @@ -18331,8 +18214,7 @@ func (c *ProjectsLocationsMirroringEndpointGroupsCreateCall) Header() http.Heade func (c *ProjectsLocationsMirroringEndpointGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringendpointgroup) if err != nil { return nil, err } @@ -18446,12 +18328,11 @@ func (c *ProjectsLocationsMirroringEndpointGroupsDeleteCall) Header() http.Heade func (c *ProjectsLocationsMirroringEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18553,12 +18434,11 @@ func (c *ProjectsLocationsMirroringEndpointGroupsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18689,12 +18569,11 @@ func (c *ProjectsLocationsMirroringEndpointGroupsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/mirroringEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18836,8 +18715,7 @@ func (c *ProjectsLocationsMirroringEndpointGroupsPatchCall) Header() http.Header func (c *ProjectsLocationsMirroringEndpointGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mirroringendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mirroringendpointgroup) if err != nil { return nil, err } @@ -18945,8 +18823,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -19047,12 +18924,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19156,12 +19032,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19284,12 +19159,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19413,8 +19287,7 @@ func (c *ProjectsLocationsServerTlsPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsServerTlsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servertlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servertlspolicy) if err != nil { return nil, err } @@ -19513,12 +19386,11 @@ func (c *ProjectsLocationsServerTlsPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServerTlsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19621,12 +19493,11 @@ func (c *ProjectsLocationsServerTlsPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19749,12 +19620,11 @@ func (c *ProjectsLocationsServerTlsPoliciesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19874,12 +19744,11 @@ func (c *ProjectsLocationsServerTlsPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serverTlsPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20005,8 +19874,7 @@ func (c *ProjectsLocationsServerTlsPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsServerTlsPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servertlspolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servertlspolicy) if err != nil { return nil, err } @@ -20110,8 +19978,7 @@ func (c *ProjectsLocationsServerTlsPoliciesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsServerTlsPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -20219,8 +20086,7 @@ func (c *ProjectsLocationsServerTlsPoliciesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsServerTlsPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -20332,8 +20198,7 @@ func (c *ProjectsLocationsTlsInspectionPoliciesCreateCall) Header() http.Header func (c *ProjectsLocationsTlsInspectionPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsinspectionpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsinspectionpolicy) if err != nil { return nil, err } @@ -20441,12 +20306,11 @@ func (c *ProjectsLocationsTlsInspectionPoliciesDeleteCall) Header() http.Header func (c *ProjectsLocationsTlsInspectionPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20550,12 +20414,11 @@ func (c *ProjectsLocationsTlsInspectionPoliciesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20676,12 +20539,11 @@ func (c *ProjectsLocationsTlsInspectionPoliciesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tlsInspectionPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20809,8 +20671,7 @@ func (c *ProjectsLocationsTlsInspectionPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsTlsInspectionPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsinspectionpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsinspectionpolicy) if err != nil { return nil, err } @@ -20920,8 +20781,7 @@ func (c *ProjectsLocationsUrlListsCreateCall) Header() http.Header { func (c *ProjectsLocationsUrlListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urllist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urllist) if err != nil { return nil, err } @@ -21020,12 +20880,11 @@ func (c *ProjectsLocationsUrlListsDeleteCall) Header() http.Header { func (c *ProjectsLocationsUrlListsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21128,12 +20987,11 @@ func (c *ProjectsLocationsUrlListsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21252,12 +21110,11 @@ func (c *ProjectsLocationsUrlListsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/urlLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21383,8 +21240,7 @@ func (c *ProjectsLocationsUrlListsPatchCall) Header() http.Header { func (c *ProjectsLocationsUrlListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.urllist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.urllist) if err != nil { return nil, err } diff --git a/networkservices/v1/networkservices-gen.go b/networkservices/v1/networkservices-gen.go index baa8da225db..f8f8beccbc2 100644 --- a/networkservices/v1/networkservices-gen.go +++ b/networkservices/v1/networkservices-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4469,12 +4468,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4600,12 +4598,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4744,8 +4741,7 @@ func (c *ProjectsLocationsAuthzExtensionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAuthzExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension) if err != nil { return nil, err } @@ -4862,12 +4858,11 @@ func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAuthzExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4972,12 +4967,11 @@ func (c *ProjectsLocationsAuthzExtensionsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5109,12 +5103,11 @@ func (c *ProjectsLocationsAuthzExtensionsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authzExtensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5257,8 +5250,7 @@ func (c *ProjectsLocationsAuthzExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAuthzExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension) if err != nil { return nil, err } @@ -5388,12 +5380,11 @@ func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5489,8 +5480,7 @@ func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5597,8 +5587,7 @@ func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5729,12 +5718,11 @@ func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5830,8 +5818,7 @@ func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5938,8 +5925,7 @@ func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) Header() http. func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6070,12 +6056,11 @@ func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6171,8 +6156,7 @@ func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) Header() http.Heade func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6279,8 +6263,7 @@ func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) Header() http func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6389,8 +6372,7 @@ func (c *ProjectsLocationsEndpointPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsEndpointPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpointpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy) if err != nil { return nil, err } @@ -6489,12 +6471,11 @@ func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6597,12 +6578,11 @@ func (c *ProjectsLocationsEndpointPoliciesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6721,12 +6701,11 @@ func (c *ProjectsLocationsEndpointPoliciesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpointPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6852,8 +6831,7 @@ func (c *ProjectsLocationsEndpointPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsEndpointPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpointpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy) if err != nil { return nil, err } @@ -6961,8 +6939,7 @@ func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway) if err != nil { return nil, err } @@ -7061,12 +7038,11 @@ func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7169,12 +7145,11 @@ func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7293,12 +7268,11 @@ func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7423,8 +7397,7 @@ func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header { func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway) if err != nil { return nil, err } @@ -7536,12 +7509,11 @@ func (c *ProjectsLocationsGatewaysRouteViewsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7661,12 +7633,11 @@ func (c *ProjectsLocationsGatewaysRouteViewsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routeViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7788,8 +7759,7 @@ func (c *ProjectsLocationsGrpcRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsGrpcRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grpcroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute) if err != nil { return nil, err } @@ -7888,12 +7858,11 @@ func (c *ProjectsLocationsGrpcRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsGrpcRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7996,12 +7965,11 @@ func (c *ProjectsLocationsGrpcRoutesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8120,12 +8088,11 @@ func (c *ProjectsLocationsGrpcRoutesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/grpcRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8251,8 +8218,7 @@ func (c *ProjectsLocationsGrpcRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsGrpcRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grpcroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute) if err != nil { return nil, err } @@ -8360,8 +8326,7 @@ func (c *ProjectsLocationsHttpRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsHttpRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute) if err != nil { return nil, err } @@ -8460,12 +8425,11 @@ func (c *ProjectsLocationsHttpRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsHttpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8568,12 +8532,11 @@ func (c *ProjectsLocationsHttpRoutesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8692,12 +8655,11 @@ func (c *ProjectsLocationsHttpRoutesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/httpRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8823,8 +8785,7 @@ func (c *ProjectsLocationsHttpRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsHttpRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute) if err != nil { return nil, err } @@ -8949,8 +8910,7 @@ func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Header() http.Header { func (c *ProjectsLocationsLbRouteExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbrouteextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension) if err != nil { return nil, err } @@ -9067,12 +9027,11 @@ func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9177,12 +9136,11 @@ func (c *ProjectsLocationsLbRouteExtensionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9315,12 +9273,11 @@ func (c *ProjectsLocationsLbRouteExtensionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbRouteExtensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9463,8 +9420,7 @@ func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsLbRouteExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbrouteextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension) if err != nil { return nil, err } @@ -9590,8 +9546,7 @@ func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Header() http.Header { func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbtrafficextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension) if err != nil { return nil, err } @@ -9708,12 +9663,11 @@ func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9818,12 +9772,11 @@ func (c *ProjectsLocationsLbTrafficExtensionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9956,12 +9909,11 @@ func (c *ProjectsLocationsLbTrafficExtensionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbTrafficExtensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10105,8 +10057,7 @@ func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbtrafficextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension) if err != nil { return nil, err } @@ -10214,8 +10165,7 @@ func (c *ProjectsLocationsMeshesCreateCall) Header() http.Header { func (c *ProjectsLocationsMeshesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mesh) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh) if err != nil { return nil, err } @@ -10314,12 +10264,11 @@ func (c *ProjectsLocationsMeshesDeleteCall) Header() http.Header { func (c *ProjectsLocationsMeshesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10422,12 +10371,11 @@ func (c *ProjectsLocationsMeshesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10545,12 +10493,11 @@ func (c *ProjectsLocationsMeshesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/meshes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10675,8 +10622,7 @@ func (c *ProjectsLocationsMeshesPatchCall) Header() http.Header { func (c *ProjectsLocationsMeshesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mesh) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh) if err != nil { return nil, err } @@ -10788,12 +10734,11 @@ func (c *ProjectsLocationsMeshesRouteViewsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10912,12 +10857,11 @@ func (c *ProjectsLocationsMeshesRouteViewsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routeViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11039,8 +10983,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -11141,12 +11084,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11250,12 +11192,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11378,12 +11319,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11505,8 +11445,7 @@ func (c *ProjectsLocationsServiceBindingsCreateCall) Header() http.Header { func (c *ProjectsLocationsServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding) if err != nil { return nil, err } @@ -11605,12 +11544,11 @@ func (c *ProjectsLocationsServiceBindingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11713,12 +11651,11 @@ func (c *ProjectsLocationsServiceBindingsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11837,12 +11774,11 @@ func (c *ProjectsLocationsServiceBindingsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11967,8 +11903,7 @@ func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsServiceLbPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelbpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy) if err != nil { return nil, err } @@ -12067,12 +12002,11 @@ func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12175,12 +12109,11 @@ func (c *ProjectsLocationsServiceLbPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12301,12 +12234,11 @@ func (c *ProjectsLocationsServiceLbPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceLbPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12433,8 +12365,7 @@ func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsServiceLbPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelbpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy) if err != nil { return nil, err } @@ -12542,8 +12473,7 @@ func (c *ProjectsLocationsTcpRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsTcpRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tcproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute) if err != nil { return nil, err } @@ -12642,12 +12572,11 @@ func (c *ProjectsLocationsTcpRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTcpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12750,12 +12679,11 @@ func (c *ProjectsLocationsTcpRoutesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12874,12 +12802,11 @@ func (c *ProjectsLocationsTcpRoutesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tcpRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13004,8 +12931,7 @@ func (c *ProjectsLocationsTcpRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsTcpRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tcproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute) if err != nil { return nil, err } @@ -13113,8 +13039,7 @@ func (c *ProjectsLocationsTlsRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsTlsRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute) if err != nil { return nil, err } @@ -13213,12 +13138,11 @@ func (c *ProjectsLocationsTlsRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTlsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13321,12 +13245,11 @@ func (c *ProjectsLocationsTlsRoutesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13445,12 +13368,11 @@ func (c *ProjectsLocationsTlsRoutesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tlsRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13575,8 +13497,7 @@ func (c *ProjectsLocationsTlsRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsTlsRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute) if err != nil { return nil, err } @@ -13684,8 +13605,7 @@ func (c *ProjectsLocationsWasmPluginsCreateCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wasmplugin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin) if err != nil { return nil, err } @@ -13784,12 +13704,11 @@ func (c *ProjectsLocationsWasmPluginsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13912,12 +13831,11 @@ func (c *ProjectsLocationsWasmPluginsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14039,12 +13957,11 @@ func (c *ProjectsLocationsWasmPluginsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/wasmPlugins") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14173,8 +14090,7 @@ func (c *ProjectsLocationsWasmPluginsPatchCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wasmplugin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin) if err != nil { return nil, err } @@ -14285,8 +14201,7 @@ func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wasmpluginversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmpluginversion) if err != nil { return nil, err } @@ -14387,12 +14302,11 @@ func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14497,12 +14411,11 @@ func (c *ProjectsLocationsWasmPluginsVersionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14625,12 +14538,11 @@ func (c *ProjectsLocationsWasmPluginsVersionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/networkservices/v1beta1/networkservices-gen.go b/networkservices/v1beta1/networkservices-gen.go index 580e7f8bb8b..8ebc5980976 100644 --- a/networkservices/v1beta1/networkservices-gen.go +++ b/networkservices/v1beta1/networkservices-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4036,12 +4035,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4167,12 +4165,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4311,8 +4308,7 @@ func (c *ProjectsLocationsAuthzExtensionsCreateCall) Header() http.Header { func (c *ProjectsLocationsAuthzExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension) if err != nil { return nil, err } @@ -4429,12 +4425,11 @@ func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAuthzExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4539,12 +4534,11 @@ func (c *ProjectsLocationsAuthzExtensionsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4676,12 +4670,11 @@ func (c *ProjectsLocationsAuthzExtensionsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authzExtensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4824,8 +4817,7 @@ func (c *ProjectsLocationsAuthzExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsAuthzExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.authzextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension) if err != nil { return nil, err } @@ -4933,8 +4925,7 @@ func (c *ProjectsLocationsEndpointPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsEndpointPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpointpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy) if err != nil { return nil, err } @@ -5033,12 +5024,11 @@ func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsEndpointPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5141,12 +5131,11 @@ func (c *ProjectsLocationsEndpointPoliciesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5265,12 +5254,11 @@ func (c *ProjectsLocationsEndpointPoliciesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpointPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5396,8 +5384,7 @@ func (c *ProjectsLocationsEndpointPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsEndpointPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpointpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy) if err != nil { return nil, err } @@ -5505,8 +5492,7 @@ func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header { func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway) if err != nil { return nil, err } @@ -5605,12 +5591,11 @@ func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header { func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5713,12 +5698,11 @@ func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5837,12 +5821,11 @@ func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/gateways") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5967,8 +5950,7 @@ func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header { func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gateway) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway) if err != nil { return nil, err } @@ -6080,12 +6062,11 @@ func (c *ProjectsLocationsGatewaysRouteViewsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6205,12 +6186,11 @@ func (c *ProjectsLocationsGatewaysRouteViewsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/routeViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6332,8 +6312,7 @@ func (c *ProjectsLocationsGrpcRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsGrpcRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grpcroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute) if err != nil { return nil, err } @@ -6432,12 +6411,11 @@ func (c *ProjectsLocationsGrpcRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsGrpcRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6540,12 +6518,11 @@ func (c *ProjectsLocationsGrpcRoutesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6664,12 +6641,11 @@ func (c *ProjectsLocationsGrpcRoutesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/grpcRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6795,8 +6771,7 @@ func (c *ProjectsLocationsGrpcRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsGrpcRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grpcroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute) if err != nil { return nil, err } @@ -6904,8 +6879,7 @@ func (c *ProjectsLocationsHttpRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsHttpRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute) if err != nil { return nil, err } @@ -7004,12 +6978,11 @@ func (c *ProjectsLocationsHttpRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsHttpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7112,12 +7085,11 @@ func (c *ProjectsLocationsHttpRoutesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7236,12 +7208,11 @@ func (c *ProjectsLocationsHttpRoutesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/httpRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7367,8 +7338,7 @@ func (c *ProjectsLocationsHttpRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsHttpRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.httproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute) if err != nil { return nil, err } @@ -7493,8 +7463,7 @@ func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Header() http.Header { func (c *ProjectsLocationsLbRouteExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbrouteextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension) if err != nil { return nil, err } @@ -7611,12 +7580,11 @@ func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7721,12 +7689,11 @@ func (c *ProjectsLocationsLbRouteExtensionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7859,12 +7826,11 @@ func (c *ProjectsLocationsLbRouteExtensionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbRouteExtensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8007,8 +7973,7 @@ func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsLbRouteExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbrouteextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension) if err != nil { return nil, err } @@ -8134,8 +8099,7 @@ func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Header() http.Header { func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbtrafficextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension) if err != nil { return nil, err } @@ -8252,12 +8216,11 @@ func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8362,12 +8325,11 @@ func (c *ProjectsLocationsLbTrafficExtensionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8500,12 +8462,11 @@ func (c *ProjectsLocationsLbTrafficExtensionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTrafficExtensions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8649,8 +8610,7 @@ func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Header() http.Header { func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lbtrafficextension) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension) if err != nil { return nil, err } @@ -8758,8 +8718,7 @@ func (c *ProjectsLocationsMeshesCreateCall) Header() http.Header { func (c *ProjectsLocationsMeshesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mesh) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh) if err != nil { return nil, err } @@ -8858,12 +8817,11 @@ func (c *ProjectsLocationsMeshesDeleteCall) Header() http.Header { func (c *ProjectsLocationsMeshesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8966,12 +8924,11 @@ func (c *ProjectsLocationsMeshesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9089,12 +9046,11 @@ func (c *ProjectsLocationsMeshesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/meshes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9219,8 +9175,7 @@ func (c *ProjectsLocationsMeshesPatchCall) Header() http.Header { func (c *ProjectsLocationsMeshesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.mesh) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh) if err != nil { return nil, err } @@ -9332,12 +9287,11 @@ func (c *ProjectsLocationsMeshesRouteViewsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9456,12 +9410,11 @@ func (c *ProjectsLocationsMeshesRouteViewsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/routeViews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9583,8 +9536,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -9685,12 +9637,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9794,12 +9745,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9922,12 +9872,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10049,8 +9998,7 @@ func (c *ProjectsLocationsServiceBindingsCreateCall) Header() http.Header { func (c *ProjectsLocationsServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding) if err != nil { return nil, err } @@ -10149,12 +10097,11 @@ func (c *ProjectsLocationsServiceBindingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10257,12 +10204,11 @@ func (c *ProjectsLocationsServiceBindingsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10381,12 +10327,11 @@ func (c *ProjectsLocationsServiceBindingsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10511,8 +10456,7 @@ func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsServiceLbPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelbpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy) if err != nil { return nil, err } @@ -10611,12 +10555,11 @@ func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10719,12 +10662,11 @@ func (c *ProjectsLocationsServiceLbPoliciesGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10845,12 +10787,11 @@ func (c *ProjectsLocationsServiceLbPoliciesListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceLbPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10977,8 +10918,7 @@ func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsServiceLbPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelbpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy) if err != nil { return nil, err } @@ -11086,8 +11026,7 @@ func (c *ProjectsLocationsTcpRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsTcpRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tcproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute) if err != nil { return nil, err } @@ -11186,12 +11125,11 @@ func (c *ProjectsLocationsTcpRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTcpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11294,12 +11232,11 @@ func (c *ProjectsLocationsTcpRoutesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11418,12 +11355,11 @@ func (c *ProjectsLocationsTcpRoutesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tcpRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11548,8 +11484,7 @@ func (c *ProjectsLocationsTcpRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsTcpRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tcproute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute) if err != nil { return nil, err } @@ -11657,8 +11592,7 @@ func (c *ProjectsLocationsTlsRoutesCreateCall) Header() http.Header { func (c *ProjectsLocationsTlsRoutesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute) if err != nil { return nil, err } @@ -11757,12 +11691,11 @@ func (c *ProjectsLocationsTlsRoutesDeleteCall) Header() http.Header { func (c *ProjectsLocationsTlsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11865,12 +11798,11 @@ func (c *ProjectsLocationsTlsRoutesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11989,12 +11921,11 @@ func (c *ProjectsLocationsTlsRoutesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tlsRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12119,8 +12050,7 @@ func (c *ProjectsLocationsTlsRoutesPatchCall) Header() http.Header { func (c *ProjectsLocationsTlsRoutesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tlsroute) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute) if err != nil { return nil, err } @@ -12228,8 +12158,7 @@ func (c *ProjectsLocationsWasmPluginsCreateCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wasmplugin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin) if err != nil { return nil, err } @@ -12328,12 +12257,11 @@ func (c *ProjectsLocationsWasmPluginsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12456,12 +12384,11 @@ func (c *ProjectsLocationsWasmPluginsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12583,12 +12510,11 @@ func (c *ProjectsLocationsWasmPluginsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/wasmPlugins") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12717,8 +12643,7 @@ func (c *ProjectsLocationsWasmPluginsPatchCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wasmplugin) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin) if err != nil { return nil, err } @@ -12829,8 +12754,7 @@ func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.wasmpluginversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmpluginversion) if err != nil { return nil, err } @@ -12931,12 +12855,11 @@ func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13041,12 +12964,11 @@ func (c *ProjectsLocationsWasmPluginsVersionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13169,12 +13091,11 @@ func (c *ProjectsLocationsWasmPluginsVersionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/notebooks/v1/notebooks-gen.go b/notebooks/v1/notebooks-gen.go index 07b050a2f4d..40d01afb4c0 100644 --- a/notebooks/v1/notebooks-gen.go +++ b/notebooks/v1/notebooks-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3487,12 +3486,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3618,12 +3616,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3747,8 +3744,7 @@ func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -3847,12 +3843,11 @@ func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3955,12 +3950,11 @@ func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4076,12 +4070,11 @@ func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4202,8 +4195,7 @@ func (c *ProjectsLocationsExecutionsCreateCall) Header() http.Header { func (c *ProjectsLocationsExecutionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.execution) if err != nil { return nil, err } @@ -4302,12 +4294,11 @@ func (c *ProjectsLocationsExecutionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4410,12 +4401,11 @@ func (c *ProjectsLocationsExecutionsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4545,12 +4535,11 @@ func (c *ProjectsLocationsExecutionsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4671,8 +4660,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -4771,12 +4759,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4870,8 +4857,7 @@ func (c *ProjectsLocationsInstancesDiagnoseCall) Header() http.Header { func (c *ProjectsLocationsInstancesDiagnoseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diagnoseinstancerequest) if err != nil { return nil, err } @@ -4982,12 +4968,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5109,12 +5094,11 @@ func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5217,12 +5201,11 @@ func (c *ProjectsLocationsInstancesGetInstanceHealthCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getInstanceHealth") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5342,12 +5325,11 @@ func (c *ProjectsLocationsInstancesIsUpgradeableCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+notebookInstance}:isUpgradeable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5477,12 +5459,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5597,8 +5578,7 @@ func (c *ProjectsLocationsInstancesMigrateCall) Header() http.Header { func (c *ProjectsLocationsInstancesMigrateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrateinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrateinstancerequest) if err != nil { return nil, err } @@ -5701,8 +5681,7 @@ func (c *ProjectsLocationsInstancesRegisterCall) Header() http.Header { func (c *ProjectsLocationsInstancesRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registerinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registerinstancerequest) if err != nil { return nil, err } @@ -5805,8 +5784,7 @@ func (c *ProjectsLocationsInstancesReportCall) Header() http.Header { func (c *ProjectsLocationsInstancesReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportinstanceinforequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportinstanceinforequest) if err != nil { return nil, err } @@ -5907,8 +5885,7 @@ func (c *ProjectsLocationsInstancesReportEventCall) Header() http.Header { func (c *ProjectsLocationsInstancesReportEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportinstanceeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportinstanceeventrequest) if err != nil { return nil, err } @@ -6009,8 +5986,7 @@ func (c *ProjectsLocationsInstancesResetCall) Header() http.Header { func (c *ProjectsLocationsInstancesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetinstancerequest) if err != nil { return nil, err } @@ -6111,8 +6087,7 @@ func (c *ProjectsLocationsInstancesRollbackCall) Header() http.Header { func (c *ProjectsLocationsInstancesRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackinstancerequest) if err != nil { return nil, err } @@ -6213,8 +6188,7 @@ func (c *ProjectsLocationsInstancesSetAcceleratorCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetAcceleratorCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinstanceacceleratorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setinstanceacceleratorrequest) if err != nil { return nil, err } @@ -6318,8 +6292,7 @@ func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6420,8 +6393,7 @@ func (c *ProjectsLocationsInstancesSetLabelsCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinstancelabelsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setinstancelabelsrequest) if err != nil { return nil, err } @@ -6522,8 +6494,7 @@ func (c *ProjectsLocationsInstancesSetMachineTypeCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinstancemachinetyperequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setinstancemachinetyperequest) if err != nil { return nil, err } @@ -6624,8 +6595,7 @@ func (c *ProjectsLocationsInstancesStartCall) Header() http.Header { func (c *ProjectsLocationsInstancesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startinstancerequest) if err != nil { return nil, err } @@ -6726,8 +6696,7 @@ func (c *ProjectsLocationsInstancesStopCall) Header() http.Header { func (c *ProjectsLocationsInstancesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopinstancerequest) if err != nil { return nil, err } @@ -6834,8 +6803,7 @@ func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6937,8 +6905,7 @@ func (c *ProjectsLocationsInstancesUpdateConfigCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateinstanceconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateinstanceconfigrequest) if err != nil { return nil, err } @@ -7039,8 +7006,7 @@ func (c *ProjectsLocationsInstancesUpdateMetadataItemsCall) Header() http.Header func (c *ProjectsLocationsInstancesUpdateMetadataItemsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateinstancemetadataitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateinstancemetadataitemsrequest) if err != nil { return nil, err } @@ -7143,8 +7109,7 @@ func (c *ProjectsLocationsInstancesUpdateShieldedInstanceConfigCall) Header() ht func (c *ProjectsLocationsInstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateshieldedinstanceconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateshieldedinstanceconfigrequest) if err != nil { return nil, err } @@ -7245,8 +7210,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstancerequest) if err != nil { return nil, err } @@ -7348,8 +7312,7 @@ func (c *ProjectsLocationsInstancesUpgradeInternalCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeInternalCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstanceinternalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstanceinternalrequest) if err != nil { return nil, err } @@ -7457,8 +7420,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -7559,12 +7521,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7668,12 +7629,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7796,12 +7756,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7928,8 +7887,7 @@ func (c *ProjectsLocationsRuntimesCreateCall) Header() http.Header { func (c *ProjectsLocationsRuntimesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtime) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtime) if err != nil { return nil, err } @@ -8034,12 +7992,11 @@ func (c *ProjectsLocationsRuntimesDeleteCall) Header() http.Header { func (c *ProjectsLocationsRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8133,8 +8090,7 @@ func (c *ProjectsLocationsRuntimesDiagnoseCall) Header() http.Header { func (c *ProjectsLocationsRuntimesDiagnoseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diagnoseruntimerequest) if err != nil { return nil, err } @@ -8246,12 +8202,11 @@ func (c *ProjectsLocationsRuntimesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8373,12 +8328,11 @@ func (c *ProjectsLocationsRuntimesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8507,12 +8461,11 @@ func (c *ProjectsLocationsRuntimesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runtimes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8627,8 +8580,7 @@ func (c *ProjectsLocationsRuntimesMigrateCall) Header() http.Header { func (c *ProjectsLocationsRuntimesMigrateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrateruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migrateruntimerequest) if err != nil { return nil, err } @@ -8751,8 +8703,7 @@ func (c *ProjectsLocationsRuntimesPatchCall) Header() http.Header { func (c *ProjectsLocationsRuntimesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtime) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtime) if err != nil { return nil, err } @@ -8855,8 +8806,7 @@ func (c *ProjectsLocationsRuntimesRefreshRuntimeTokenInternalCall) Header() http func (c *ProjectsLocationsRuntimesRefreshRuntimeTokenInternalCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.refreshruntimetokeninternalrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.refreshruntimetokeninternalrequest) if err != nil { return nil, err } @@ -8958,8 +8908,7 @@ func (c *ProjectsLocationsRuntimesReportEventCall) Header() http.Header { func (c *ProjectsLocationsRuntimesReportEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportruntimeeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportruntimeeventrequest) if err != nil { return nil, err } @@ -9060,8 +9009,7 @@ func (c *ProjectsLocationsRuntimesResetCall) Header() http.Header { func (c *ProjectsLocationsRuntimesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetruntimerequest) if err != nil { return nil, err } @@ -9165,8 +9113,7 @@ func (c *ProjectsLocationsRuntimesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsRuntimesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9270,8 +9217,7 @@ func (c *ProjectsLocationsRuntimesStartCall) Header() http.Header { func (c *ProjectsLocationsRuntimesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startruntimerequest) if err != nil { return nil, err } @@ -9375,8 +9321,7 @@ func (c *ProjectsLocationsRuntimesStopCall) Header() http.Header { func (c *ProjectsLocationsRuntimesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopruntimerequest) if err != nil { return nil, err } @@ -9477,8 +9422,7 @@ func (c *ProjectsLocationsRuntimesSwitchCall) Header() http.Header { func (c *ProjectsLocationsRuntimesSwitchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.switchruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.switchruntimerequest) if err != nil { return nil, err } @@ -9585,8 +9529,7 @@ func (c *ProjectsLocationsRuntimesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsRuntimesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9688,8 +9631,7 @@ func (c *ProjectsLocationsRuntimesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgraderuntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgraderuntimerequest) if err != nil { return nil, err } @@ -9796,8 +9738,7 @@ func (c *ProjectsLocationsSchedulesCreateCall) Header() http.Header { func (c *ProjectsLocationsSchedulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.schedule) if err != nil { return nil, err } @@ -9896,12 +9837,11 @@ func (c *ProjectsLocationsSchedulesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSchedulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10004,12 +9944,11 @@ func (c *ProjectsLocationsSchedulesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10138,12 +10077,11 @@ func (c *ProjectsLocationsSchedulesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schedules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10258,8 +10196,7 @@ func (c *ProjectsLocationsSchedulesTriggerCall) Header() http.Header { func (c *ProjectsLocationsSchedulesTriggerCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.triggerschedulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.triggerschedulerequest) if err != nil { return nil, err } diff --git a/notebooks/v2/notebooks-gen.go b/notebooks/v2/notebooks-gen.go index 1dde01c2ad6..6291d6ff9e6 100644 --- a/notebooks/v2/notebooks-gen.go +++ b/notebooks/v2/notebooks-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1809,12 +1808,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1940,12 +1938,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2070,12 +2067,11 @@ func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+notebookInstance}:checkUpgradability") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2181,8 +2177,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -2287,12 +2282,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2386,8 +2380,7 @@ func (c *ProjectsLocationsInstancesDiagnoseCall) Header() http.Header { func (c *ProjectsLocationsInstancesDiagnoseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.diagnoseinstancerequest) if err != nil { return nil, err } @@ -2498,12 +2491,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2609,12 +2601,11 @@ func (c *ProjectsLocationsInstancesGetConfigCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/instances:getConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2736,12 +2727,11 @@ func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2870,12 +2860,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3003,8 +2992,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -3107,8 +3095,7 @@ func (c *ProjectsLocationsInstancesReportInfoSystemCall) Header() http.Header { func (c *ProjectsLocationsInstancesReportInfoSystemCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportinstanceinfosystemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportinstanceinfosystemrequest) if err != nil { return nil, err } @@ -3209,8 +3196,7 @@ func (c *ProjectsLocationsInstancesResetCall) Header() http.Header { func (c *ProjectsLocationsInstancesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetinstancerequest) if err != nil { return nil, err } @@ -3311,8 +3297,7 @@ func (c *ProjectsLocationsInstancesResizeDiskCall) Header() http.Header { func (c *ProjectsLocationsInstancesResizeDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resizediskrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resizediskrequest) if err != nil { return nil, err } @@ -3413,8 +3398,7 @@ func (c *ProjectsLocationsInstancesRestoreCall) Header() http.Header { func (c *ProjectsLocationsInstancesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreinstancerequest) if err != nil { return nil, err } @@ -3515,8 +3499,7 @@ func (c *ProjectsLocationsInstancesRollbackCall) Header() http.Header { func (c *ProjectsLocationsInstancesRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackinstancerequest) if err != nil { return nil, err } @@ -3620,8 +3603,7 @@ func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3722,8 +3704,7 @@ func (c *ProjectsLocationsInstancesStartCall) Header() http.Header { func (c *ProjectsLocationsInstancesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startinstancerequest) if err != nil { return nil, err } @@ -3824,8 +3805,7 @@ func (c *ProjectsLocationsInstancesStopCall) Header() http.Header { func (c *ProjectsLocationsInstancesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopinstancerequest) if err != nil { return nil, err } @@ -3932,8 +3912,7 @@ func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4035,8 +4014,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstancerequest) if err != nil { return nil, err } @@ -4138,8 +4116,7 @@ func (c *ProjectsLocationsInstancesUpgradeSystemCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeSystemCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancesystemrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstancesystemrequest) if err != nil { return nil, err } @@ -4247,8 +4224,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4349,12 +4325,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4458,12 +4433,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4586,12 +4560,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/oauth2/v2/oauth2-gen.go b/oauth2/v2/oauth2-gen.go index 05b769f82ac..e874160420f 100644 --- a/oauth2/v2/oauth2-gen.go +++ b/oauth2/v2/oauth2-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Userinfo = NewUserinfoService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Userinfo = NewUserinfoService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -335,12 +334,11 @@ func (c *TokeninfoCall) Header() http.Header { func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/tokeninfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -435,12 +433,11 @@ func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/userinfo") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -535,12 +532,11 @@ func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/ondemandscanning/v1/ondemandscanning-gen.go b/ondemandscanning/v1/ondemandscanning-gen.go index 2830adf5e4f..d059ad4282a 100644 --- a/ondemandscanning/v1/ondemandscanning-gen.go +++ b/ondemandscanning/v1/ondemandscanning-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3373,12 +3372,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3471,12 +3469,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3580,12 +3577,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3708,12 +3704,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3842,12 +3837,11 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3940,8 +3934,7 @@ func (c *ProjectsLocationsScansAnalyzePackagesCall) Header() http.Header { func (c *ProjectsLocationsScansAnalyzePackagesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzepackagesrequestv1) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzepackagesrequestv1) if err != nil { return nil, err } @@ -4066,12 +4059,11 @@ func (c *ProjectsLocationsScansVulnerabilitiesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vulnerabilities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/ondemandscanning/v1beta1/ondemandscanning-gen.go b/ondemandscanning/v1beta1/ondemandscanning-gen.go index eaa0358fce8..2b48468b8d9 100644 --- a/ondemandscanning/v1beta1/ondemandscanning-gen.go +++ b/ondemandscanning/v1beta1/ondemandscanning-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3369,12 +3368,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3467,12 +3465,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3576,12 +3573,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3704,12 +3700,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3838,12 +3833,11 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3936,8 +3930,7 @@ func (c *ProjectsLocationsScansAnalyzePackagesCall) Header() http.Header { func (c *ProjectsLocationsScansAnalyzePackagesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzepackagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.analyzepackagesrequest) if err != nil { return nil, err } @@ -4062,12 +4055,11 @@ func (c *ProjectsLocationsScansVulnerabilitiesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/vulnerabilities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/orgpolicy/v2/orgpolicy-gen.go b/orgpolicy/v2/orgpolicy-gen.go index aab16aea919..dfb19234220 100644 --- a/orgpolicy/v2/orgpolicy-gen.go +++ b/orgpolicy/v2/orgpolicy-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1024,12 +1023,11 @@ func (c *FoldersConstraintsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/constraints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1149,8 +1147,7 @@ func (c *FoldersPoliciesCreateCall) Header() http.Header { func (c *FoldersPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2policy) if err != nil { return nil, err } @@ -1259,12 +1256,11 @@ func (c *FoldersPoliciesDeleteCall) Header() http.Header { func (c *FoldersPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1369,12 +1365,11 @@ func (c *FoldersPoliciesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1482,12 +1477,11 @@ func (c *FoldersPoliciesGetEffectivePolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:getEffectivePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1610,12 +1604,11 @@ func (c *FoldersPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1751,8 +1744,7 @@ func (c *FoldersPoliciesPatchCall) Header() http.Header { func (c *FoldersPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2policy) if err != nil { return nil, err } @@ -1882,12 +1874,11 @@ func (c *OrganizationsConstraintsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/constraints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2004,8 +1995,7 @@ func (c *OrganizationsCustomConstraintsCreateCall) Header() http.Header { func (c *OrganizationsCustomConstraintsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2customconstraint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2customconstraint) if err != nil { return nil, err } @@ -2106,12 +2096,11 @@ func (c *OrganizationsCustomConstraintsDeleteCall) Header() http.Header { func (c *OrganizationsCustomConstraintsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2216,12 +2205,11 @@ func (c *OrganizationsCustomConstraintsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2343,12 +2331,11 @@ func (c *OrganizationsCustomConstraintsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/customConstraints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2470,8 +2457,7 @@ func (c *OrganizationsCustomConstraintsPatchCall) Header() http.Header { func (c *OrganizationsCustomConstraintsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2customconstraint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2customconstraint) if err != nil { return nil, err } @@ -2578,8 +2564,7 @@ func (c *OrganizationsPoliciesCreateCall) Header() http.Header { func (c *OrganizationsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2policy) if err != nil { return nil, err } @@ -2688,12 +2673,11 @@ func (c *OrganizationsPoliciesDeleteCall) Header() http.Header { func (c *OrganizationsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2798,12 +2782,11 @@ func (c *OrganizationsPoliciesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2911,12 +2894,11 @@ func (c *OrganizationsPoliciesGetEffectivePolicyCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:getEffectivePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3039,12 +3021,11 @@ func (c *OrganizationsPoliciesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3180,8 +3161,7 @@ func (c *OrganizationsPoliciesPatchCall) Header() http.Header { func (c *OrganizationsPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2policy) if err != nil { return nil, err } @@ -3311,12 +3291,11 @@ func (c *ProjectsConstraintsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/constraints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3436,8 +3415,7 @@ func (c *ProjectsPoliciesCreateCall) Header() http.Header { func (c *ProjectsPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2policy) if err != nil { return nil, err } @@ -3546,12 +3524,11 @@ func (c *ProjectsPoliciesDeleteCall) Header() http.Header { func (c *ProjectsPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3656,12 +3633,11 @@ func (c *ProjectsPoliciesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3769,12 +3745,11 @@ func (c *ProjectsPoliciesGetEffectivePolicyCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:getEffectivePolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3897,12 +3872,11 @@ func (c *ProjectsPoliciesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/policies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4038,8 +4012,7 @@ func (c *ProjectsPoliciesPatchCall) Header() http.Header { func (c *ProjectsPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudorgpolicyv2policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudorgpolicyv2policy) if err != nil { return nil, err } diff --git a/osconfig/v1/osconfig-gen.go b/osconfig/v1/osconfig-gen.go index a721c21ab51..ecc31e9130c 100644 --- a/osconfig/v1/osconfig-gen.go +++ b/osconfig/v1/osconfig-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3826,12 +3825,11 @@ func (c *ProjectsLocationsGlobalGetProjectFeatureSettingsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3933,8 +3931,7 @@ func (c *ProjectsLocationsGlobalUpdateProjectFeatureSettingsCall) Header() http. func (c *ProjectsLocationsGlobalUpdateProjectFeatureSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectfeaturesettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.projectfeaturesettings) if err != nil { return nil, err } @@ -4067,12 +4064,11 @@ func (c *ProjectsLocationsInstancesInventoriesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4216,12 +4212,11 @@ func (c *ProjectsLocationsInstancesInventoriesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/inventories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4351,12 +4346,11 @@ func (c *ProjectsLocationsInstancesOsPolicyAssignmentsReportsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4500,12 +4494,11 @@ func (c *ProjectsLocationsInstancesOsPolicyAssignmentsReportsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4634,12 +4627,11 @@ func (c *ProjectsLocationsInstancesVulnerabilityReportsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4777,12 +4769,11 @@ func (c *ProjectsLocationsInstancesVulnerabilityReportsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vulnerabilityReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4921,8 +4912,7 @@ func (c *ProjectsLocationsOsPolicyAssignmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsOsPolicyAssignmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ospolicyassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ospolicyassignment) if err != nil { return nil, err } @@ -5034,12 +5024,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOsPolicyAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5145,12 +5134,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5269,12 +5257,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/osPolicyAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5414,12 +5401,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsListRevisionsCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5564,8 +5550,7 @@ func (c *ProjectsLocationsOsPolicyAssignmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsOsPolicyAssignmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ospolicyassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ospolicyassignment) if err != nil { return nil, err } @@ -5673,8 +5658,7 @@ func (c *ProjectsLocationsOsPolicyAssignmentsOperationsCancelCall) Header() http func (c *ProjectsLocationsOsPolicyAssignmentsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5786,12 +5770,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5894,8 +5877,7 @@ func (c *ProjectsPatchDeploymentsCreateCall) Header() http.Header { func (c *ProjectsPatchDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.patchdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.patchdeployment) if err != nil { return nil, err } @@ -5995,12 +5977,11 @@ func (c *ProjectsPatchDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsPatchDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6103,12 +6084,11 @@ func (c *ProjectsPatchDeploymentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6226,12 +6206,11 @@ func (c *ProjectsPatchDeploymentsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/patchDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6355,8 +6334,7 @@ func (c *ProjectsPatchDeploymentsPatchCall) Header() http.Header { func (c *ProjectsPatchDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.patchdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.patchdeployment) if err != nil { return nil, err } @@ -6459,8 +6437,7 @@ func (c *ProjectsPatchDeploymentsPauseCall) Header() http.Header { func (c *ProjectsPatchDeploymentsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausepatchdeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausepatchdeploymentrequest) if err != nil { return nil, err } @@ -6563,8 +6540,7 @@ func (c *ProjectsPatchDeploymentsResumeCall) Header() http.Header { func (c *ProjectsPatchDeploymentsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumepatchdeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumepatchdeploymentrequest) if err != nil { return nil, err } @@ -6666,8 +6642,7 @@ func (c *ProjectsPatchJobsCancelCall) Header() http.Header { func (c *ProjectsPatchJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelpatchjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelpatchjobrequest) if err != nil { return nil, err } @@ -6767,8 +6742,7 @@ func (c *ProjectsPatchJobsExecuteCall) Header() http.Header { func (c *ProjectsPatchJobsExecuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executepatchjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executepatchjobrequest) if err != nil { return nil, err } @@ -6879,12 +6853,11 @@ func (c *ProjectsPatchJobsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7010,12 +6983,11 @@ func (c *ProjectsPatchJobsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/patchJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7163,12 +7135,11 @@ func (c *ProjectsPatchJobsInstanceDetailsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instanceDetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/osconfig/v1alpha/osconfig-gen.go b/osconfig/v1alpha/osconfig-gen.go index 105bde54fd5..729ae4891b4 100644 --- a/osconfig/v1alpha/osconfig-gen.go +++ b/osconfig/v1alpha/osconfig-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2937,12 +2936,11 @@ func (c *ProjectsLocationsInstanceOSPoliciesCompliancesGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3071,12 +3069,11 @@ func (c *ProjectsLocationsInstanceOSPoliciesCompliancesListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/instanceOSPoliciesCompliances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3222,12 +3219,11 @@ func (c *ProjectsLocationsInstancesInventoriesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3371,12 +3367,11 @@ func (c *ProjectsLocationsInstancesInventoriesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/inventories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3506,12 +3501,11 @@ func (c *ProjectsLocationsInstancesOsPolicyAssignmentsReportsGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3655,12 +3649,11 @@ func (c *ProjectsLocationsInstancesOsPolicyAssignmentsReportsListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3789,12 +3782,11 @@ func (c *ProjectsLocationsInstancesVulnerabilityReportsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3932,12 +3924,11 @@ func (c *ProjectsLocationsInstancesVulnerabilityReportsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/vulnerabilityReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4075,8 +4066,7 @@ func (c *ProjectsLocationsOsPolicyAssignmentsCreateCall) Header() http.Header { func (c *ProjectsLocationsOsPolicyAssignmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ospolicyassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ospolicyassignment) if err != nil { return nil, err } @@ -4188,12 +4178,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOsPolicyAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4299,12 +4288,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4423,12 +4411,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/osPolicyAssignments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4568,12 +4555,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsListRevisionsCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4718,8 +4704,7 @@ func (c *ProjectsLocationsOsPolicyAssignmentsPatchCall) Header() http.Header { func (c *ProjectsLocationsOsPolicyAssignmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.ospolicyassignment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ospolicyassignment) if err != nil { return nil, err } @@ -4827,8 +4812,7 @@ func (c *ProjectsLocationsOsPolicyAssignmentsOperationsCancelCall) Header() http func (c *ProjectsLocationsOsPolicyAssignmentsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4940,12 +4924,11 @@ func (c *ProjectsLocationsOsPolicyAssignmentsOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/osconfig/v1beta/osconfig-gen.go b/osconfig/v1beta/osconfig-gen.go index a8b9df40b08..189e845a673 100644 --- a/osconfig/v1beta/osconfig-gen.go +++ b/osconfig/v1beta/osconfig-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2530,8 +2529,7 @@ func (c *ProjectsGuestPoliciesCreateCall) Header() http.Header { func (c *ProjectsGuestPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guestpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guestpolicy) if err != nil { return nil, err } @@ -2630,12 +2628,11 @@ func (c *ProjectsGuestPoliciesDeleteCall) Header() http.Header { func (c *ProjectsGuestPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2738,12 +2735,11 @@ func (c *ProjectsGuestPoliciesGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2861,12 +2857,11 @@ func (c *ProjectsGuestPoliciesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/guestPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2989,8 +2984,7 @@ func (c *ProjectsGuestPoliciesPatchCall) Header() http.Header { func (c *ProjectsGuestPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.guestpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.guestpolicy) if err != nil { return nil, err } @@ -3101,8 +3095,7 @@ func (c *ProjectsPatchDeploymentsCreateCall) Header() http.Header { func (c *ProjectsPatchDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.patchdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.patchdeployment) if err != nil { return nil, err } @@ -3202,12 +3195,11 @@ func (c *ProjectsPatchDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsPatchDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3310,12 +3302,11 @@ func (c *ProjectsPatchDeploymentsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3433,12 +3424,11 @@ func (c *ProjectsPatchDeploymentsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/patchDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3562,8 +3552,7 @@ func (c *ProjectsPatchDeploymentsPatchCall) Header() http.Header { func (c *ProjectsPatchDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.patchdeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.patchdeployment) if err != nil { return nil, err } @@ -3666,8 +3655,7 @@ func (c *ProjectsPatchDeploymentsPauseCall) Header() http.Header { func (c *ProjectsPatchDeploymentsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausepatchdeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausepatchdeploymentrequest) if err != nil { return nil, err } @@ -3770,8 +3758,7 @@ func (c *ProjectsPatchDeploymentsResumeCall) Header() http.Header { func (c *ProjectsPatchDeploymentsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumepatchdeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumepatchdeploymentrequest) if err != nil { return nil, err } @@ -3873,8 +3860,7 @@ func (c *ProjectsPatchJobsCancelCall) Header() http.Header { func (c *ProjectsPatchJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelpatchjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelpatchjobrequest) if err != nil { return nil, err } @@ -3974,8 +3960,7 @@ func (c *ProjectsPatchJobsExecuteCall) Header() http.Header { func (c *ProjectsPatchJobsExecuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executepatchjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executepatchjobrequest) if err != nil { return nil, err } @@ -4086,12 +4071,11 @@ func (c *ProjectsPatchJobsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4217,12 +4201,11 @@ func (c *ProjectsPatchJobsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/patchJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4370,12 +4353,11 @@ func (c *ProjectsPatchJobsInstanceDetailsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/instanceDetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4491,8 +4473,7 @@ func (c *ProjectsZonesInstancesLookupEffectiveGuestPolicyCall) Header() http.Hea func (c *ProjectsZonesInstancesLookupEffectiveGuestPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookupeffectiveguestpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lookupeffectiveguestpolicyrequest) if err != nil { return nil, err } diff --git a/oslogin/v1/oslogin-gen.go b/oslogin/v1/oslogin-gen.go index 0f580b42133..b67c53ae778 100644 --- a/oslogin/v1/oslogin-gen.go +++ b/oslogin/v1/oslogin-gen.go @@ -135,7 +135,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -154,9 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -426,12 +425,11 @@ func (c *UsersGetLoginProfileCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/loginProfile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -540,8 +538,7 @@ func (c *UsersImportSshPublicKeyCall) Header() http.Header { func (c *UsersImportSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } @@ -642,12 +639,11 @@ func (c *UsersProjectsDeleteCall) Header() http.Header { func (c *UsersProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -739,8 +735,7 @@ func (c *UsersSshPublicKeysCreateCall) Header() http.Header { func (c *UsersSshPublicKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } @@ -840,12 +835,11 @@ func (c *UsersSshPublicKeysDeleteCall) Header() http.Header { func (c *UsersSshPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -949,12 +943,11 @@ func (c *UsersSshPublicKeysGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1056,8 +1049,7 @@ func (c *UsersSshPublicKeysPatchCall) Header() http.Header { func (c *UsersSshPublicKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } diff --git a/oslogin/v1alpha/oslogin-gen.go b/oslogin/v1alpha/oslogin-gen.go index 36ce8fcdb98..77f14db5d6b 100644 --- a/oslogin/v1alpha/oslogin-gen.go +++ b/oslogin/v1alpha/oslogin-gen.go @@ -135,7 +135,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -154,9 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -606,12 +605,11 @@ func (c *UsersGetLoginProfileCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/loginProfile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -737,8 +735,7 @@ func (c *UsersImportSshPublicKeyCall) Header() http.Header { func (c *UsersImportSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } @@ -855,12 +852,11 @@ func (c *UsersProjectsDeleteCall) Header() http.Header { func (c *UsersProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -953,8 +949,7 @@ func (c *UsersProjectsLocationsSignSshPublicKeyCall) Header() http.Header { func (c *UsersProjectsLocationsSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signsshpublickeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signsshpublickeyrequest) if err != nil { return nil, err } @@ -1056,8 +1051,7 @@ func (c *UsersProjectsZonesSignSshPublicKeyCall) Header() http.Header { func (c *UsersProjectsZonesSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signsshpublickeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signsshpublickeyrequest) if err != nil { return nil, err } @@ -1158,8 +1152,7 @@ func (c *UsersSshPublicKeysCreateCall) Header() http.Header { func (c *UsersSshPublicKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } @@ -1259,12 +1252,11 @@ func (c *UsersSshPublicKeysDeleteCall) Header() http.Header { func (c *UsersSshPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1368,12 +1360,11 @@ func (c *UsersSshPublicKeysGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1475,8 +1466,7 @@ func (c *UsersSshPublicKeysPatchCall) Header() http.Header { func (c *UsersSshPublicKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } diff --git a/oslogin/v1beta/oslogin-gen.go b/oslogin/v1beta/oslogin-gen.go index 4f29e7c0cd4..8cdf29000bc 100644 --- a/oslogin/v1beta/oslogin-gen.go +++ b/oslogin/v1beta/oslogin-gen.go @@ -135,7 +135,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -154,9 +155,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -590,12 +589,11 @@ func (c *UsersGetLoginProfileCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/loginProfile") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -720,8 +718,7 @@ func (c *UsersImportSshPublicKeyCall) Header() http.Header { func (c *UsersImportSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } @@ -822,12 +819,11 @@ func (c *UsersProjectsDeleteCall) Header() http.Header { func (c *UsersProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -920,8 +916,7 @@ func (c *UsersProjectsLocationsSignSshPublicKeyCall) Header() http.Header { func (c *UsersProjectsLocationsSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signsshpublickeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signsshpublickeyrequest) if err != nil { return nil, err } @@ -1023,8 +1018,7 @@ func (c *UsersProjectsZonesSignSshPublicKeyCall) Header() http.Header { func (c *UsersProjectsZonesSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.signsshpublickeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signsshpublickeyrequest) if err != nil { return nil, err } @@ -1125,8 +1119,7 @@ func (c *UsersSshPublicKeysCreateCall) Header() http.Header { func (c *UsersSshPublicKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } @@ -1226,12 +1219,11 @@ func (c *UsersSshPublicKeysDeleteCall) Header() http.Header { func (c *UsersSshPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1335,12 +1327,11 @@ func (c *UsersSshPublicKeysGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1442,8 +1433,7 @@ func (c *UsersSshPublicKeysPatchCall) Header() http.Header { func (c *UsersSshPublicKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) if err != nil { return nil, err } diff --git a/pagespeedonline/v5/pagespeedonline-gen.go b/pagespeedonline/v5/pagespeedonline-gen.go index 7f33562ce0d..e4c09f4c65b 100644 --- a/pagespeedonline/v5/pagespeedonline-gen.go +++ b/pagespeedonline/v5/pagespeedonline-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Pagespeedapi = NewPagespeedapiService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Pagespeedapi = NewPagespeedapiService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1176,12 +1175,11 @@ func (c *PagespeedapiRunpagespeedCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "pagespeedonline/v5/runPagespeed") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go b/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go index bab146d2287..9a9f80917b9 100644 --- a/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go +++ b/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Partners = NewPartnersService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Partners = NewPartnersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1822,12 +1821,11 @@ func (c *PartnersProductsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1944,8 +1942,7 @@ func (c *PartnersPromotionsFindEligibleCall) Header() http.Header { func (c *PartnersPromotionsFindEligibleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest) if err != nil { return nil, err } @@ -2116,12 +2113,11 @@ func (c *PartnersPromotionsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/promotions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2238,8 +2234,7 @@ func (c *PartnersSubscriptionsCancelCall) Header() http.Header { func (c *PartnersSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest) if err != nil { return nil, err } @@ -2353,8 +2348,7 @@ func (c *PartnersSubscriptionsCreateCall) Header() http.Header { func (c *PartnersSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1subscription) if err != nil { return nil, err } @@ -2460,8 +2454,7 @@ func (c *PartnersSubscriptionsEntitleCall) Header() http.Header { func (c *PartnersSubscriptionsEntitleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest) if err != nil { return nil, err } @@ -2566,8 +2559,7 @@ func (c *PartnersSubscriptionsExtendCall) Header() http.Header { func (c *PartnersSubscriptionsExtendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest) if err != nil { return nil, err } @@ -2680,12 +2672,11 @@ func (c *PartnersSubscriptionsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2793,8 +2784,7 @@ func (c *PartnersSubscriptionsProvisionCall) Header() http.Header { func (c *PartnersSubscriptionsProvisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1subscription) if err != nil { return nil, err } @@ -2901,8 +2891,7 @@ func (c *PartnersSubscriptionsUndoCancelCall) Header() http.Header { func (c *PartnersSubscriptionsUndoCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest) if err != nil { return nil, err } @@ -3009,8 +2998,7 @@ func (c *PartnersUserSessionsGenerateCall) Header() http.Header { func (c *PartnersUserSessionsGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1generateusersessionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpaymentsresellersubscriptionv1generateusersessionrequest) if err != nil { return nil, err } diff --git a/people/v1/people-gen.go b/people/v1/people-gen.go index 977b4dbf301..99872a893f1 100644 --- a/people/v1/people-gen.go +++ b/people/v1/people-gen.go @@ -164,7 +164,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.ContactGroups = NewContactGroupsService(s) + s.OtherContacts = NewOtherContactsService(s) + s.People = NewPeopleService(s) if err != nil { return nil, err } @@ -183,11 +186,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.ContactGroups = NewContactGroupsService(s) - s.OtherContacts = NewOtherContactsService(s) - s.People = NewPeopleService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2774,12 +2773,11 @@ func (c *ContactGroupsBatchGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2869,8 +2867,7 @@ func (c *ContactGroupsCreateCall) Header() http.Header { func (c *ContactGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontactgrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcontactgrouprequest) if err != nil { return nil, err } @@ -2974,12 +2971,11 @@ func (c *ContactGroupsDeleteCall) Header() http.Header { func (c *ContactGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3099,12 +3095,11 @@ func (c *ContactGroupsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3237,12 +3232,11 @@ func (c *ContactGroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3359,8 +3353,7 @@ func (c *ContactGroupsUpdateCall) Header() http.Header { func (c *ContactGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactgrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecontactgrouprequest) if err != nil { return nil, err } @@ -3463,8 +3456,7 @@ func (c *ContactGroupsMembersModifyCall) Header() http.Header { func (c *ContactGroupsMembersModifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycontactgroupmembersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifycontactgroupmembersrequest) if err != nil { return nil, err } @@ -3567,8 +3559,7 @@ func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Header() http.Heade func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copyothercontacttomycontactsgrouprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.copyothercontacttomycontactsgrouprequest) if err != nil { return nil, err } @@ -3765,12 +3756,11 @@ func (c *OtherContactsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/otherContacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3918,12 +3908,11 @@ func (c *OtherContactsSearchCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/otherContacts:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4010,8 +3999,7 @@ func (c *PeopleBatchCreateContactsCall) Header() http.Header { func (c *PeopleBatchCreateContactsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatecontactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatecontactsrequest) if err != nil { return nil, err } @@ -4107,8 +4095,7 @@ func (c *PeopleBatchDeleteContactsCall) Header() http.Header { func (c *PeopleBatchDeleteContactsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletecontactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletecontactsrequest) if err != nil { return nil, err } @@ -4204,8 +4191,7 @@ func (c *PeopleBatchUpdateContactsCall) Header() http.Header { func (c *PeopleBatchUpdateContactsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatecontactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatecontactsrequest) if err != nil { return nil, err } @@ -4336,8 +4322,7 @@ func (c *PeopleCreateContactCall) Header() http.Header { func (c *PeopleCreateContactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.person) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.person) if err != nil { return nil, err } @@ -4434,12 +4419,11 @@ func (c *PeopleDeleteContactCall) Header() http.Header { func (c *PeopleDeleteContactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContact") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4564,12 +4548,11 @@ func (c *PeopleDeleteContactPhotoCall) Header() http.Header { func (c *PeopleDeleteContactPhotoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContactPhoto") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4720,12 +4703,11 @@ func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4880,12 +4862,11 @@ func (c *PeopleGetBatchGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5069,12 +5050,11 @@ func (c *PeopleListDirectoryPeopleCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:listDirectoryPeople") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5245,12 +5225,11 @@ func (c *PeopleSearchContactsCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:searchContacts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5415,12 +5394,11 @@ func (c *PeopleSearchDirectoryPeopleCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:searchDirectoryPeople") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5592,8 +5570,7 @@ func (c *PeopleUpdateContactCall) Header() http.Header { func (c *PeopleUpdateContactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.person) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.person) if err != nil { return nil, err } @@ -5694,8 +5671,7 @@ func (c *PeopleUpdateContactPhotoCall) Header() http.Header { func (c *PeopleUpdateContactPhotoCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactphotorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecontactphotorequest) if err != nil { return nil, err } @@ -5921,12 +5897,11 @@ func (c *PeopleConnectionsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/places/v1/places-gen.go b/places/v1/places-gen.go index 360eeb5e71a..b1cf91ca2e2 100644 --- a/places/v1/places-gen.go +++ b/places/v1/places-gen.go @@ -149,7 +149,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Places = NewPlacesService(s) if err != nil { return nil, err } @@ -168,9 +169,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Places = NewPlacesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3033,8 +3032,7 @@ func (c *PlacesAutocompleteCall) Header() http.Header { func (c *PlacesAutocompleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplacesv1autocompleteplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlemapsplacesv1autocompleteplacesrequest) if err != nil { return nil, err } @@ -3188,12 +3186,11 @@ func (c *PlacesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3282,8 +3279,7 @@ func (c *PlacesSearchNearbyCall) Header() http.Header { func (c *PlacesSearchNearbyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplacesv1searchnearbyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlemapsplacesv1searchnearbyrequest) if err != nil { return nil, err } @@ -3377,8 +3373,7 @@ func (c *PlacesSearchTextCall) Header() http.Header { func (c *PlacesSearchTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplacesv1searchtextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlemapsplacesv1searchtextrequest) if err != nil { return nil, err } @@ -3552,12 +3547,11 @@ func (c *PlacesPhotosGetMediaCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/playcustomapp/v1/playcustomapp-gen.go b/playcustomapp/v1/playcustomapp-gen.go index 456a332f4a5..cf49c68d861 100644 --- a/playcustomapp/v1/playcustomapp-gen.go +++ b/playcustomapp/v1/playcustomapp-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -320,8 +319,7 @@ func (c *AccountsCustomAppsCreateCall) Header() http.Header { func (c *AccountsCustomAppsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customapp) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customapp) if err != nil { return nil, err } @@ -332,14 +330,10 @@ func (c *AccountsCustomAppsCreateCall) doRequest(alt string) (*http.Response, er urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/playcustomapp/v1/accounts/{account}/customApps") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } diff --git a/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go b/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go index 9248648cef0..ad27e767edb 100644 --- a/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go +++ b/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go @@ -114,7 +114,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Anomalies = NewAnomaliesService(s) + s.Apps = NewAppsService(s) + s.Vitals = NewVitalsService(s) if err != nil { return nil, err } @@ -133,11 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Anomalies = NewAnomaliesService(s) - s.Apps = NewAppsService(s) - s.Vitals = NewVitalsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2856,12 +2855,11 @@ func (c *AnomaliesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/anomalies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2986,12 +2984,11 @@ func (c *AppsFetchReleaseFilterOptionsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:fetchReleaseFilterOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3108,12 +3105,11 @@ func (c *AppsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/apps:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3234,12 +3230,11 @@ func (c *VitalsAnrrateGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3332,8 +3327,7 @@ func (c *VitalsAnrrateQueryCall) Header() http.Header { func (c *VitalsAnrrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1queryanrratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1queryanrratemetricsetrequest) if err != nil { return nil, err } @@ -3465,12 +3459,11 @@ func (c *VitalsCrashrateGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3565,8 +3558,7 @@ func (c *VitalsCrashrateQueryCall) Header() http.Header { func (c *VitalsCrashrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1querycrashratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1querycrashratemetricsetrequest) if err != nil { return nil, err } @@ -3699,12 +3691,11 @@ func (c *VitalsErrorsCountsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3797,8 +3788,7 @@ func (c *VitalsErrorsCountsQueryCall) Header() http.Header { func (c *VitalsErrorsCountsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1queryerrorcountmetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1queryerrorcountmetricsetrequest) if err != nil { return nil, err } @@ -4173,12 +4163,11 @@ func (c *VitalsErrorsIssuesSearchCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/errorIssues:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4529,12 +4518,11 @@ func (c *VitalsErrorsReportsSearchCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/errorReports:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4658,12 +4646,11 @@ func (c *VitalsExcessivewakeuprateGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4756,8 +4743,7 @@ func (c *VitalsExcessivewakeuprateQueryCall) Header() http.Header { func (c *VitalsExcessivewakeuprateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1queryexcessivewakeupratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1queryexcessivewakeupratemetricsetrequest) if err != nil { return nil, err } @@ -4891,12 +4877,11 @@ func (c *VitalsSlowrenderingrateGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4989,8 +4974,7 @@ func (c *VitalsSlowrenderingrateQueryCall) Header() http.Header { func (c *VitalsSlowrenderingrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1queryslowrenderingratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1queryslowrenderingratemetricsetrequest) if err != nil { return nil, err } @@ -5124,12 +5108,11 @@ func (c *VitalsSlowstartrateGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5222,8 +5205,7 @@ func (c *VitalsSlowstartrateQueryCall) Header() http.Header { func (c *VitalsSlowstartrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1queryslowstartratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1queryslowstartratemetricsetrequest) if err != nil { return nil, err } @@ -5358,12 +5340,11 @@ func (c *VitalsStuckbackgroundwakelockrateGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5457,8 +5438,7 @@ func (c *VitalsStuckbackgroundwakelockrateQueryCall) Header() http.Header { func (c *VitalsStuckbackgroundwakelockrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1alpha1querystuckbackgroundwakelockratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1alpha1querystuckbackgroundwakelockratemetricsetrequest) if err != nil { return nil, err } diff --git a/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go b/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go index dd9ac77ac42..a606c99f0e0 100644 --- a/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go +++ b/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go @@ -114,7 +114,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Anomalies = NewAnomaliesService(s) + s.Apps = NewAppsService(s) + s.Vitals = NewVitalsService(s) if err != nil { return nil, err } @@ -133,11 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Anomalies = NewAnomaliesService(s) - s.Apps = NewAppsService(s) - s.Vitals = NewVitalsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2856,12 +2855,11 @@ func (c *AnomaliesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/anomalies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2986,12 +2984,11 @@ func (c *AppsFetchReleaseFilterOptionsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetchReleaseFilterOptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3108,12 +3105,11 @@ func (c *AppsSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/apps:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3234,12 +3230,11 @@ func (c *VitalsAnrrateGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3332,8 +3327,7 @@ func (c *VitalsAnrrateQueryCall) Header() http.Header { func (c *VitalsAnrrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1queryanrratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1queryanrratemetricsetrequest) if err != nil { return nil, err } @@ -3465,12 +3459,11 @@ func (c *VitalsCrashrateGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3563,8 +3556,7 @@ func (c *VitalsCrashrateQueryCall) Header() http.Header { func (c *VitalsCrashrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1querycrashratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1querycrashratemetricsetrequest) if err != nil { return nil, err } @@ -3697,12 +3689,11 @@ func (c *VitalsErrorsCountsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3797,8 +3788,7 @@ func (c *VitalsErrorsCountsQueryCall) Header() http.Header { func (c *VitalsErrorsCountsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1queryerrorcountmetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1queryerrorcountmetricsetrequest) if err != nil { return nil, err } @@ -4173,12 +4163,11 @@ func (c *VitalsErrorsIssuesSearchCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/errorIssues:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4529,12 +4518,11 @@ func (c *VitalsErrorsReportsSearchCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/errorReports:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4658,12 +4646,11 @@ func (c *VitalsExcessivewakeuprateGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4756,8 +4743,7 @@ func (c *VitalsExcessivewakeuprateQueryCall) Header() http.Header { func (c *VitalsExcessivewakeuprateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1queryexcessivewakeupratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1queryexcessivewakeupratemetricsetrequest) if err != nil { return nil, err } @@ -4891,12 +4877,11 @@ func (c *VitalsSlowrenderingrateGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4989,8 +4974,7 @@ func (c *VitalsSlowrenderingrateQueryCall) Header() http.Header { func (c *VitalsSlowrenderingrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1queryslowrenderingratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1queryslowrenderingratemetricsetrequest) if err != nil { return nil, err } @@ -5124,12 +5108,11 @@ func (c *VitalsSlowstartrateGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5222,8 +5205,7 @@ func (c *VitalsSlowstartrateQueryCall) Header() http.Header { func (c *VitalsSlowstartrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1queryslowstartratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1queryslowstartratemetricsetrequest) if err != nil { return nil, err } @@ -5358,12 +5340,11 @@ func (c *VitalsStuckbackgroundwakelockrateGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5457,8 +5438,7 @@ func (c *VitalsStuckbackgroundwakelockrateQueryCall) Header() http.Header { func (c *VitalsStuckbackgroundwakelockrateQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleplaydeveloperreportingv1beta1querystuckbackgroundwakelockratemetricsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleplaydeveloperreportingv1beta1querystuckbackgroundwakelockratemetricsetrequest) if err != nil { return nil, err } diff --git a/playgrouping/v1alpha1/playgrouping-gen.go b/playgrouping/v1alpha1/playgrouping-gen.go index 31e3c6d3880..1edab2e415a 100644 --- a/playgrouping/v1alpha1/playgrouping-gen.go +++ b/playgrouping/v1alpha1/playgrouping-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Apps = NewAppsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -332,8 +331,7 @@ func (c *AppsTokensVerifyCall) Header() http.Header { func (c *AppsTokensVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifytokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifytokenrequest) if err != nil { return nil, err } @@ -441,8 +439,7 @@ func (c *AppsTokensTagsCreateOrUpdateCall) Header() http.Header { func (c *AppsTokensTagsCreateOrUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createorupdatetagsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createorupdatetagsrequest) if err != nil { return nil, err } diff --git a/playintegrity/v1/playintegrity-gen.go b/playintegrity/v1/playintegrity-gen.go index 55b78da7445..d5189206f0f 100644 --- a/playintegrity/v1/playintegrity-gen.go +++ b/playintegrity/v1/playintegrity-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.DeviceRecall = NewDeviceRecallService(s) + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.DeviceRecall = NewDeviceRecallService(s) - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -847,8 +846,7 @@ func (c *DeviceRecallWriteCall) Header() http.Header { func (c *DeviceRecallWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writedevicerecallrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writedevicerecallrequest) if err != nil { return nil, err } @@ -951,8 +949,7 @@ func (c *V1DecodeIntegrityTokenCall) Header() http.Header { func (c *V1DecodeIntegrityTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.decodeintegritytokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.decodeintegritytokenrequest) if err != nil { return nil, err } diff --git a/policyanalyzer/v1/policyanalyzer-gen.go b/policyanalyzer/v1/policyanalyzer-gen.go index bf42d4fff40..16062808c04 100644 --- a/policyanalyzer/v1/policyanalyzer-gen.go +++ b/policyanalyzer/v1/policyanalyzer-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -475,12 +474,11 @@ func (c *FoldersLocationsActivityTypesActivitiesQueryCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/activities:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -641,12 +639,11 @@ func (c *OrganizationsLocationsActivityTypesActivitiesQueryCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/activities:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -807,12 +804,11 @@ func (c *ProjectsLocationsActivityTypesActivitiesQueryCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/activities:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/policyanalyzer/v1beta1/policyanalyzer-gen.go b/policyanalyzer/v1beta1/policyanalyzer-gen.go index b323900aa35..f82dde6a7a1 100644 --- a/policyanalyzer/v1beta1/policyanalyzer-gen.go +++ b/policyanalyzer/v1beta1/policyanalyzer-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -468,12 +467,11 @@ func (c *FoldersLocationsActivityTypesActivitiesQueryCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/activities:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -629,12 +627,11 @@ func (c *OrganizationsLocationsActivityTypesActivitiesQueryCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/activities:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -790,12 +787,11 @@ func (c *ProjectsLocationsActivityTypesActivitiesQueryCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/activities:query") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/policysimulator/v1/policysimulator-gen.go b/policysimulator/v1/policysimulator-gen.go index 5b181e1a9c9..3943239420d 100644 --- a/policysimulator/v1/policysimulator-gen.go +++ b/policysimulator/v1/policysimulator-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Operations = NewOperationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Operations = NewOperationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2370,12 +2369,11 @@ func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2470,8 +2468,7 @@ func (c *FoldersLocationsReplaysCreateCall) Header() http.Header { func (c *FoldersLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1replay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1replay) if err != nil { return nil, err } @@ -2588,12 +2585,11 @@ func (c *FoldersLocationsReplaysGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2698,12 +2694,11 @@ func (c *FoldersLocationsReplaysOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2827,12 +2822,11 @@ func (c *FoldersLocationsReplaysOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2978,12 +2972,11 @@ func (c *FoldersLocationsReplaysResultsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3109,12 +3102,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3238,12 +3230,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3369,12 +3360,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3469,8 +3459,7 @@ func (c *OrganizationsLocationsReplaysCreateCall) Header() http.Header { func (c *OrganizationsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1replay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1replay) if err != nil { return nil, err } @@ -3587,12 +3576,11 @@ func (c *OrganizationsLocationsReplaysGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3697,12 +3685,11 @@ func (c *OrganizationsLocationsReplaysOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3826,12 +3813,11 @@ func (c *OrganizationsLocationsReplaysOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3977,12 +3963,11 @@ func (c *OrganizationsLocationsReplaysResultsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4108,12 +4093,11 @@ func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4208,8 +4192,7 @@ func (c *ProjectsLocationsReplaysCreateCall) Header() http.Header { func (c *ProjectsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1replay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1replay) if err != nil { return nil, err } @@ -4326,12 +4309,11 @@ func (c *ProjectsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4436,12 +4418,11 @@ func (c *ProjectsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4565,12 +4546,11 @@ func (c *ProjectsLocationsReplaysOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4716,12 +4696,11 @@ func (c *ProjectsLocationsReplaysResultsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/policysimulator/v1alpha/policysimulator-gen.go b/policysimulator/v1alpha/policysimulator-gen.go index 05e4fb33f2f..82f3aaa1c92 100644 --- a/policysimulator/v1alpha/policysimulator-gen.go +++ b/policysimulator/v1alpha/policysimulator-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Operations = NewOperationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Operations = NewOperationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2667,12 +2666,11 @@ func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2767,8 +2765,7 @@ func (c *FoldersLocationsReplaysCreateCall) Header() http.Header { func (c *FoldersLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1alphareplay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1alphareplay) if err != nil { return nil, err } @@ -2885,12 +2882,11 @@ func (c *FoldersLocationsReplaysGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3017,12 +3013,11 @@ func (c *FoldersLocationsReplaysListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/replays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3148,12 +3143,11 @@ func (c *FoldersLocationsReplaysOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3277,12 +3271,11 @@ func (c *FoldersLocationsReplaysOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3428,12 +3421,11 @@ func (c *FoldersLocationsReplaysResultsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3559,12 +3551,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3688,12 +3679,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3820,8 +3810,7 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Header() h func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1alphaorgpolicyviolationspreview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1alphaorgpolicyviolationspreview) if err != nil { return nil, err } @@ -3927,8 +3916,7 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) Header() func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1alphaorgpolicyviolationspreview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1alphaorgpolicyviolationspreview) if err != nil { return nil, err } @@ -4041,12 +4029,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4171,12 +4158,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/orgPolicyViolationsPreviews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4302,12 +4288,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4432,12 +4417,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsLis if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/orgPolicyViolations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4553,8 +4537,7 @@ func (c *OrganizationsLocationsReplaysCreateCall) Header() http.Header { func (c *OrganizationsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1alphareplay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1alphareplay) if err != nil { return nil, err } @@ -4671,12 +4654,11 @@ func (c *OrganizationsLocationsReplaysGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4803,12 +4785,11 @@ func (c *OrganizationsLocationsReplaysListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/replays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4934,12 +4915,11 @@ func (c *OrganizationsLocationsReplaysOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5063,12 +5043,11 @@ func (c *OrganizationsLocationsReplaysOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5214,12 +5193,11 @@ func (c *OrganizationsLocationsReplaysResultsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5345,12 +5323,11 @@ func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5445,8 +5422,7 @@ func (c *ProjectsLocationsReplaysCreateCall) Header() http.Header { func (c *ProjectsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1alphareplay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1alphareplay) if err != nil { return nil, err } @@ -5563,12 +5539,11 @@ func (c *ProjectsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5695,12 +5670,11 @@ func (c *ProjectsLocationsReplaysListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/replays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5826,12 +5800,11 @@ func (c *ProjectsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5955,12 +5928,11 @@ func (c *ProjectsLocationsReplaysOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6106,12 +6078,11 @@ func (c *ProjectsLocationsReplaysResultsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/policysimulator/v1beta/policysimulator-gen.go b/policysimulator/v1beta/policysimulator-gen.go index 2740ae5d085..a43dfd1f5dd 100644 --- a/policysimulator/v1beta/policysimulator-gen.go +++ b/policysimulator/v1beta/policysimulator-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Operations = NewOperationsService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Operations = NewOperationsService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2667,12 +2666,11 @@ func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2767,8 +2765,7 @@ func (c *FoldersLocationsReplaysCreateCall) Header() http.Header { func (c *FoldersLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1betareplay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betareplay) if err != nil { return nil, err } @@ -2885,12 +2882,11 @@ func (c *FoldersLocationsReplaysGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3017,12 +3013,11 @@ func (c *FoldersLocationsReplaysListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3148,12 +3143,11 @@ func (c *FoldersLocationsReplaysOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3277,12 +3271,11 @@ func (c *FoldersLocationsReplaysOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3428,12 +3421,11 @@ func (c *FoldersLocationsReplaysResultsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3559,12 +3551,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3688,12 +3679,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3820,8 +3810,7 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Header() h func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview) if err != nil { return nil, err } @@ -3927,8 +3916,7 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) Header() func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview) if err != nil { return nil, err } @@ -4041,12 +4029,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4171,12 +4158,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/orgPolicyViolationsPreviews") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4302,12 +4288,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4432,12 +4417,11 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsLis if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/orgPolicyViolations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4553,8 +4537,7 @@ func (c *OrganizationsLocationsReplaysCreateCall) Header() http.Header { func (c *OrganizationsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1betareplay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betareplay) if err != nil { return nil, err } @@ -4671,12 +4654,11 @@ func (c *OrganizationsLocationsReplaysGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4803,12 +4785,11 @@ func (c *OrganizationsLocationsReplaysListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4934,12 +4915,11 @@ func (c *OrganizationsLocationsReplaysOperationsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5063,12 +5043,11 @@ func (c *OrganizationsLocationsReplaysOperationsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5214,12 +5193,11 @@ func (c *OrganizationsLocationsReplaysResultsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5345,12 +5323,11 @@ func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5445,8 +5422,7 @@ func (c *ProjectsLocationsReplaysCreateCall) Header() http.Header { func (c *ProjectsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1betareplay) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betareplay) if err != nil { return nil, err } @@ -5563,12 +5539,11 @@ func (c *ProjectsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5695,12 +5670,11 @@ func (c *ProjectsLocationsReplaysListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5826,12 +5800,11 @@ func (c *ProjectsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5955,12 +5928,11 @@ func (c *ProjectsLocationsReplaysOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6106,12 +6078,11 @@ func (c *ProjectsLocationsReplaysResultsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/policytroubleshooter/v1/policytroubleshooter-gen.go b/policytroubleshooter/v1/policytroubleshooter-gen.go index 07af2f38577..dce84c0ad18 100644 --- a/policytroubleshooter/v1/policytroubleshooter-gen.go +++ b/policytroubleshooter/v1/policytroubleshooter-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Iam = NewIamService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Iam = NewIamService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -862,8 +861,7 @@ func (c *IamTroubleshootCall) Header() http.Header { func (c *IamTroubleshootCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicytroubleshooterv1troubleshootiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicytroubleshooterv1troubleshootiampolicyrequest) if err != nil { return nil, err } diff --git a/policytroubleshooter/v1beta/policytroubleshooter-gen.go b/policytroubleshooter/v1beta/policytroubleshooter-gen.go index 87f9cade690..f77469a899d 100644 --- a/policytroubleshooter/v1beta/policytroubleshooter-gen.go +++ b/policytroubleshooter/v1beta/policytroubleshooter-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Iam = NewIamService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Iam = NewIamService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -826,8 +825,7 @@ func (c *IamTroubleshootCall) Header() http.Header { func (c *IamTroubleshootCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicytroubleshooterv1betatroubleshootiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicytroubleshooterv1betatroubleshootiampolicyrequest) if err != nil { return nil, err } diff --git a/pollen/v1/pollen-gen.go b/pollen/v1/pollen-gen.go index f2bd3fb19c6..49dabce637a 100644 --- a/pollen/v1/pollen-gen.go +++ b/pollen/v1/pollen-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Forecast = NewForecastService(s) + s.MapTypes = NewMapTypesService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Forecast = NewForecastService(s) - s.MapTypes = NewMapTypesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -729,12 +728,11 @@ func (c *ForecastLookupCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forecast:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -870,12 +868,11 @@ func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/mapTypes/{mapType}/heatmapTiles/{zoom}/{x}/{y}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/poly/v1/poly-gen.go b/poly/v1/poly-gen.go index 2a448f4f5d0..9924e74966e 100644 --- a/poly/v1/poly-gen.go +++ b/poly/v1/poly-gen.go @@ -103,7 +103,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Assets = NewAssetsService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -122,10 +124,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Assets = NewAssetsService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -856,12 +855,11 @@ func (c *AssetsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1037,12 +1035,11 @@ func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1216,12 +1213,11 @@ func (c *UsersAssetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1383,12 +1379,11 @@ func (c *UsersLikedassetsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/likedassets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/privateca/v1/privateca-gen.go b/privateca/v1/privateca-gen.go index a09b616c354..5b49c28d10a 100644 --- a/privateca/v1/privateca-gen.go +++ b/privateca/v1/privateca-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2956,12 +2955,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3087,12 +3085,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3230,8 +3227,7 @@ func (c *ProjectsLocationsCaPoolsCreateCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.capool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.capool) if err != nil { return nil, err } @@ -3356,12 +3352,11 @@ func (c *ProjectsLocationsCaPoolsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3456,8 +3451,7 @@ func (c *ProjectsLocationsCaPoolsFetchCaCertsCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsFetchCaCertsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchcacertsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.fetchcacertsrequest) if err != nil { return nil, err } @@ -3568,12 +3562,11 @@ func (c *ProjectsLocationsCaPoolsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3695,12 +3688,11 @@ func (c *ProjectsLocationsCaPoolsGetIamPolicyCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3834,12 +3826,11 @@ func (c *ProjectsLocationsCaPoolsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/caPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3977,8 +3968,7 @@ func (c *ProjectsLocationsCaPoolsPatchCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.capool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.capool) if err != nil { return nil, err } @@ -4082,8 +4072,7 @@ func (c *ProjectsLocationsCaPoolsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4190,8 +4179,7 @@ func (c *ProjectsLocationsCaPoolsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4297,8 +4285,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesActivateCall) Header() ht func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatecertificateauthorityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatecertificateauthorityrequest) if err != nil { return nil, err } @@ -4423,8 +4410,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCreateCall) Header() http func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificateauthority) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificateauthority) if err != nil { return nil, err } @@ -4567,12 +4553,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesDeleteCall) Header() http func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4665,8 +4650,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesDisableCall) Header() htt func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablecertificateauthorityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablecertificateauthorityrequest) if err != nil { return nil, err } @@ -4767,8 +4751,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesEnableCall) Header() http func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablecertificateauthorityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablecertificateauthorityrequest) if err != nil { return nil, err } @@ -4883,12 +4866,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesFetchCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:fetch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4991,12 +4973,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5131,12 +5112,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificateAuthorities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5275,8 +5255,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesPatchCall) Header() http. func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificateauthority) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificateauthority) if err != nil { return nil, err } @@ -5377,8 +5356,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesUndeleteCall) Header() ht func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletecertificateauthorityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletecertificateauthorityrequest) if err != nil { return nil, err } @@ -5488,12 +5466,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationList if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5616,12 +5593,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationList if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5756,12 +5732,11 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationList if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificateRevocationLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5900,8 +5875,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationList func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationListsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificaterevocationlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificaterevocationlist) if err != nil { return nil, err } @@ -6005,8 +5979,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationList func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6113,8 +6086,7 @@ func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationList func (c *ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6268,8 +6240,7 @@ func (c *ProjectsLocationsCaPoolsCertificatesCreateCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsCertificatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificate) if err != nil { return nil, err } @@ -6379,12 +6350,11 @@ func (c *ProjectsLocationsCaPoolsCertificatesGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6522,12 +6492,11 @@ func (c *ProjectsLocationsCaPoolsCertificatesListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6666,8 +6635,7 @@ func (c *ProjectsLocationsCaPoolsCertificatesPatchCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsCertificatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificate) if err != nil { return nil, err } @@ -6768,8 +6736,7 @@ func (c *ProjectsLocationsCaPoolsCertificatesRevokeCall) Header() http.Header { func (c *ProjectsLocationsCaPoolsCertificatesRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokecertificaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revokecertificaterequest) if err != nil { return nil, err } @@ -6894,8 +6861,7 @@ func (c *ProjectsLocationsCertificateTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsCertificateTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificatetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificatetemplate) if err != nil { return nil, err } @@ -7010,12 +6976,11 @@ func (c *ProjectsLocationsCertificateTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCertificateTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7117,12 +7082,11 @@ func (c *ProjectsLocationsCertificateTemplatesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7245,12 +7209,11 @@ func (c *ProjectsLocationsCertificateTemplatesGetIamPolicyCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7384,12 +7347,11 @@ func (c *ProjectsLocationsCertificateTemplatesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/certificateTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7527,8 +7489,7 @@ func (c *ProjectsLocationsCertificateTemplatesPatchCall) Header() http.Header { func (c *ProjectsLocationsCertificateTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificatetemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.certificatetemplate) if err != nil { return nil, err } @@ -7632,8 +7593,7 @@ func (c *ProjectsLocationsCertificateTemplatesSetIamPolicyCall) Header() http.He func (c *ProjectsLocationsCertificateTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7740,8 +7700,7 @@ func (c *ProjectsLocationsCertificateTemplatesTestIamPermissionsCall) Header() h func (c *ProjectsLocationsCertificateTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7850,8 +7809,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -7952,12 +7910,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8061,12 +8018,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8189,12 +8145,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/privateca/v1beta1/privateca-gen.go b/privateca/v1beta1/privateca-gen.go index 217a2520da0..56416d56d10 100644 --- a/privateca/v1beta1/privateca-gen.go +++ b/privateca/v1beta1/privateca-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -896,12 +895,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1027,12 +1025,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1176,12 +1173,11 @@ func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1277,8 +1273,7 @@ func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Header() http. func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -1385,8 +1380,7 @@ func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Header() func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -1517,12 +1511,11 @@ func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIam if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1618,8 +1611,7 @@ func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIam func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -1726,8 +1718,7 @@ func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIa func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -1836,8 +1827,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1938,12 +1928,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2047,12 +2036,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2175,12 +2163,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2324,12 +2311,11 @@ func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2425,8 +2411,7 @@ func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Header() http.Header func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2533,8 +2518,7 @@ func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Header() http.H func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/prod_tt_sasportal/v1alpha1/prod_tt_sasportal-gen.go b/prod_tt_sasportal/v1alpha1/prod_tt_sasportal-gen.go index d859a65695e..db8a5dd3f67 100644 --- a/prod_tt_sasportal/v1alpha1/prod_tt_sasportal-gen.go +++ b/prod_tt_sasportal/v1alpha1/prod_tt_sasportal-gen.go @@ -124,7 +124,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Deployments = NewDeploymentsService(s) + s.Installer = NewInstallerService(s) + s.Nodes = NewNodesService(s) + s.Policies = NewPoliciesService(s) if err != nil { return nil, err } @@ -143,13 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Deployments = NewDeploymentsService(s) - s.Installer = NewInstallerService(s) - s.Nodes = NewNodesService(s) - s.Policies = NewPoliciesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1987,12 +1986,11 @@ func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2106,12 +2104,11 @@ func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2229,12 +2226,11 @@ func (c *CustomersListGcpProjectDeploymentsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:listGcpProjectDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2330,12 +2326,11 @@ func (c *CustomersListLegacyOrganizationsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:listLegacyOrganizations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2424,8 +2419,7 @@ func (c *CustomersMigrateOrganizationCall) Header() http.Header { func (c *CustomersMigrateOrganizationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmigrateorganizationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmigrateorganizationrequest) if err != nil { return nil, err } @@ -2529,8 +2523,7 @@ func (c *CustomersPatchCall) Header() http.Header { func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcustomer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcustomer) if err != nil { return nil, err } @@ -2628,8 +2621,7 @@ func (c *CustomersProvisionDeploymentCall) Header() http.Header { func (c *CustomersProvisionDeploymentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalprovisiondeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalprovisiondeploymentrequest) if err != nil { return nil, err } @@ -2726,8 +2718,7 @@ func (c *CustomersSetupSasAnalyticsCall) Header() http.Header { func (c *CustomersSetupSasAnalyticsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsetupsasanalyticsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsetupsasanalyticsrequest) if err != nil { return nil, err } @@ -2825,8 +2816,7 @@ func (c *CustomersDeploymentsCreateCall) Header() http.Header { func (c *CustomersDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -2925,12 +2915,11 @@ func (c *CustomersDeploymentsDeleteCall) Header() http.Header { func (c *CustomersDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3032,12 +3021,11 @@ func (c *CustomersDeploymentsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3165,12 +3153,11 @@ func (c *CustomersDeploymentsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3284,8 +3271,7 @@ func (c *CustomersDeploymentsMoveCall) Header() http.Header { func (c *CustomersDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedeploymentrequest) if err != nil { return nil, err } @@ -3392,8 +3378,7 @@ func (c *CustomersDeploymentsPatchCall) Header() http.Header { func (c *CustomersDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -3494,8 +3479,7 @@ func (c *CustomersDeploymentsDevicesCreateCall) Header() http.Header { func (c *CustomersDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -3596,8 +3580,7 @@ func (c *CustomersDeploymentsDevicesCreateSignedCall) Header() http.Header { func (c *CustomersDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -3733,12 +3716,11 @@ func (c *CustomersDeploymentsDevicesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3852,8 +3834,7 @@ func (c *CustomersDevicesCreateCall) Header() http.Header { func (c *CustomersDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -3954,8 +3935,7 @@ func (c *CustomersDevicesCreateSignedCall) Header() http.Header { func (c *CustomersDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -4054,12 +4034,11 @@ func (c *CustomersDevicesDeleteCall) Header() http.Header { func (c *CustomersDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4161,12 +4140,11 @@ func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4294,12 +4272,11 @@ func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4413,8 +4390,7 @@ func (c *CustomersDevicesMoveCall) Header() http.Header { func (c *CustomersDevicesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest) if err != nil { return nil, err } @@ -4521,8 +4497,7 @@ func (c *CustomersDevicesPatchCall) Header() http.Header { func (c *CustomersDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -4623,8 +4598,7 @@ func (c *CustomersDevicesSignDeviceCall) Header() http.Header { func (c *CustomersDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsigndevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest) if err != nil { return nil, err } @@ -4724,8 +4698,7 @@ func (c *CustomersDevicesUpdateSignedCall) Header() http.Header { func (c *CustomersDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalupdatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest) if err != nil { return nil, err } @@ -4826,8 +4799,7 @@ func (c *CustomersNodesCreateCall) Header() http.Header { func (c *CustomersNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -4925,12 +4897,11 @@ func (c *CustomersNodesDeleteCall) Header() http.Header { func (c *CustomersNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5032,12 +5003,11 @@ func (c *CustomersNodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5163,12 +5133,11 @@ func (c *CustomersNodesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5282,8 +5251,7 @@ func (c *CustomersNodesMoveCall) Header() http.Header { func (c *CustomersNodesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovenoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovenoderequest) if err != nil { return nil, err } @@ -5390,8 +5358,7 @@ func (c *CustomersNodesPatchCall) Header() http.Header { func (c *CustomersNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -5491,8 +5458,7 @@ func (c *CustomersNodesDeploymentsCreateCall) Header() http.Header { func (c *CustomersNodesDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -5628,12 +5594,11 @@ func (c *CustomersNodesDeploymentsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5747,8 +5712,7 @@ func (c *CustomersNodesDevicesCreateCall) Header() http.Header { func (c *CustomersNodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -5849,8 +5813,7 @@ func (c *CustomersNodesDevicesCreateSignedCall) Header() http.Header { func (c *CustomersNodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -5986,12 +5949,11 @@ func (c *CustomersNodesDevicesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6105,8 +6067,7 @@ func (c *CustomersNodesNodesCreateCall) Header() http.Header { func (c *CustomersNodesNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -6240,12 +6201,11 @@ func (c *CustomersNodesNodesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6369,12 +6329,11 @@ func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6465,12 +6424,11 @@ func (c *DeploymentsDevicesDeleteCall) Header() http.Header { func (c *DeploymentsDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6572,12 +6530,11 @@ func (c *DeploymentsDevicesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6670,8 +6627,7 @@ func (c *DeploymentsDevicesMoveCall) Header() http.Header { func (c *DeploymentsDevicesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest) if err != nil { return nil, err } @@ -6778,8 +6734,7 @@ func (c *DeploymentsDevicesPatchCall) Header() http.Header { func (c *DeploymentsDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -6880,8 +6835,7 @@ func (c *DeploymentsDevicesSignDeviceCall) Header() http.Header { func (c *DeploymentsDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsigndevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest) if err != nil { return nil, err } @@ -6981,8 +6935,7 @@ func (c *DeploymentsDevicesUpdateSignedCall) Header() http.Header { func (c *DeploymentsDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalupdatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest) if err != nil { return nil, err } @@ -7079,8 +7032,7 @@ func (c *InstallerGenerateSecretCall) Header() http.Header { func (c *InstallerGenerateSecretCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalgeneratesecretrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalgeneratesecretrequest) if err != nil { return nil, err } @@ -7175,8 +7127,7 @@ func (c *InstallerValidateCall) Header() http.Header { func (c *InstallerValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalvalidateinstallerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalvalidateinstallerrequest) if err != nil { return nil, err } @@ -7284,12 +7235,11 @@ func (c *NodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7379,12 +7329,11 @@ func (c *NodesDeploymentsDeleteCall) Header() http.Header { func (c *NodesDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7486,12 +7435,11 @@ func (c *NodesDeploymentsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7619,12 +7567,11 @@ func (c *NodesDeploymentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7738,8 +7685,7 @@ func (c *NodesDeploymentsMoveCall) Header() http.Header { func (c *NodesDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedeploymentrequest) if err != nil { return nil, err } @@ -7846,8 +7792,7 @@ func (c *NodesDeploymentsPatchCall) Header() http.Header { func (c *NodesDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -7948,8 +7893,7 @@ func (c *NodesDeploymentsDevicesCreateCall) Header() http.Header { func (c *NodesDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -8050,8 +7994,7 @@ func (c *NodesDeploymentsDevicesCreateSignedCall) Header() http.Header { func (c *NodesDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -8187,12 +8130,11 @@ func (c *NodesDeploymentsDevicesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8306,8 +8248,7 @@ func (c *NodesDevicesCreateCall) Header() http.Header { func (c *NodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -8408,8 +8349,7 @@ func (c *NodesDevicesCreateSignedCall) Header() http.Header { func (c *NodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -8508,12 +8448,11 @@ func (c *NodesDevicesDeleteCall) Header() http.Header { func (c *NodesDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8615,12 +8554,11 @@ func (c *NodesDevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8748,12 +8686,11 @@ func (c *NodesDevicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8867,8 +8804,7 @@ func (c *NodesDevicesMoveCall) Header() http.Header { func (c *NodesDevicesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest) if err != nil { return nil, err } @@ -8975,8 +8911,7 @@ func (c *NodesDevicesPatchCall) Header() http.Header { func (c *NodesDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -9077,8 +9012,7 @@ func (c *NodesDevicesSignDeviceCall) Header() http.Header { func (c *NodesDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsigndevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest) if err != nil { return nil, err } @@ -9178,8 +9112,7 @@ func (c *NodesDevicesUpdateSignedCall) Header() http.Header { func (c *NodesDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalupdatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest) if err != nil { return nil, err } @@ -9280,8 +9213,7 @@ func (c *NodesNodesCreateCall) Header() http.Header { func (c *NodesNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -9379,12 +9311,11 @@ func (c *NodesNodesDeleteCall) Header() http.Header { func (c *NodesNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9486,12 +9417,11 @@ func (c *NodesNodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9617,12 +9547,11 @@ func (c *NodesNodesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9736,8 +9665,7 @@ func (c *NodesNodesMoveCall) Header() http.Header { func (c *NodesNodesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovenoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovenoderequest) if err != nil { return nil, err } @@ -9844,8 +9772,7 @@ func (c *NodesNodesPatchCall) Header() http.Header { func (c *NodesNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -9945,8 +9872,7 @@ func (c *NodesNodesDeploymentsCreateCall) Header() http.Header { func (c *NodesNodesDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -10082,12 +10008,11 @@ func (c *NodesNodesDeploymentsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10201,8 +10126,7 @@ func (c *NodesNodesDevicesCreateCall) Header() http.Header { func (c *NodesNodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -10303,8 +10227,7 @@ func (c *NodesNodesDevicesCreateSignedCall) Header() http.Header { func (c *NodesNodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -10440,12 +10363,11 @@ func (c *NodesNodesDevicesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10559,8 +10481,7 @@ func (c *NodesNodesNodesCreateCall) Header() http.Header { func (c *NodesNodesNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -10694,12 +10615,11 @@ func (c *NodesNodesNodesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10810,8 +10730,7 @@ func (c *PoliciesGetCall) Header() http.Header { func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalgetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalgetpolicyrequest) if err != nil { return nil, err } @@ -10906,8 +10825,7 @@ func (c *PoliciesSetCall) Header() http.Header { func (c *PoliciesSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsetpolicyrequest) if err != nil { return nil, err } @@ -11001,8 +10919,7 @@ func (c *PoliciesTestCall) Header() http.Header { func (c *PoliciesTestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaltestpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaltestpermissionsrequest) if err != nil { return nil, err } diff --git a/publicca/v1/publicca-gen.go b/publicca/v1/publicca-gen.go index f0dc8cfbbd3..8b1ef37ef98 100644 --- a/publicca/v1/publicca-gen.go +++ b/publicca/v1/publicca-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -267,8 +266,7 @@ func (c *ProjectsLocationsExternalAccountKeysCreateCall) Header() http.Header { func (c *ProjectsLocationsExternalAccountKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccountkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalaccountkey) if err != nil { return nil, err } diff --git a/publicca/v1alpha1/publicca-gen.go b/publicca/v1alpha1/publicca-gen.go index 6b21838a87d..c92710d4593 100644 --- a/publicca/v1alpha1/publicca-gen.go +++ b/publicca/v1alpha1/publicca-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -267,8 +266,7 @@ func (c *ProjectsLocationsExternalAccountKeysCreateCall) Header() http.Header { func (c *ProjectsLocationsExternalAccountKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccountkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalaccountkey) if err != nil { return nil, err } diff --git a/publicca/v1beta1/publicca-gen.go b/publicca/v1beta1/publicca-gen.go index 44d9b395064..0964e81e1ee 100644 --- a/publicca/v1beta1/publicca-gen.go +++ b/publicca/v1beta1/publicca-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -267,8 +266,7 @@ func (c *ProjectsLocationsExternalAccountKeysCreateCall) Header() http.Header { func (c *ProjectsLocationsExternalAccountKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccountkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalaccountkey) if err != nil { return nil, err } diff --git a/pubsub/v1/pubsub-gen.go b/pubsub/v1/pubsub-gen.go index bedf9465b3c..2e3aef5840e 100644 --- a/pubsub/v1/pubsub-gen.go +++ b/pubsub/v1/pubsub-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2403,8 +2402,7 @@ func (c *ProjectsSchemasCommitCall) Header() http.Header { func (c *ProjectsSchemasCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitschemarequest) if err != nil { return nil, err } @@ -2514,8 +2512,7 @@ func (c *ProjectsSchemasCreateCall) Header() http.Header { func (c *ProjectsSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.schema) if err != nil { return nil, err } @@ -2614,12 +2611,11 @@ func (c *ProjectsSchemasDeleteCall) Header() http.Header { func (c *ProjectsSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2718,12 +2714,11 @@ func (c *ProjectsSchemasDeleteRevisionCall) Header() http.Header { func (c *ProjectsSchemasDeleteRevisionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2843,12 +2838,11 @@ func (c *ProjectsSchemasGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2970,12 +2964,11 @@ func (c *ProjectsSchemasGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3110,12 +3103,11 @@ func (c *ProjectsSchemasListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3271,12 +3263,11 @@ func (c *ProjectsSchemasListRevisionsCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3391,8 +3382,7 @@ func (c *ProjectsSchemasRollbackCall) Header() http.Header { func (c *ProjectsSchemasRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackschemarequest) if err != nil { return nil, err } @@ -3496,8 +3486,7 @@ func (c *ProjectsSchemasSetIamPolicyCall) Header() http.Header { func (c *ProjectsSchemasSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3604,8 +3593,7 @@ func (c *ProjectsSchemasTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSchemasTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3707,8 +3695,7 @@ func (c *ProjectsSchemasValidateCall) Header() http.Header { func (c *ProjectsSchemasValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateschemarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateschemarequest) if err != nil { return nil, err } @@ -3810,8 +3797,7 @@ func (c *ProjectsSchemasValidateMessageCall) Header() http.Header { func (c *ProjectsSchemasValidateMessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatemessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validatemessagerequest) if err != nil { return nil, err } @@ -3931,8 +3917,7 @@ func (c *ProjectsSnapshotsCreateCall) Header() http.Header { func (c *ProjectsSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createsnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createsnapshotrequest) if err != nil { return nil, err } @@ -4039,12 +4024,11 @@ func (c *ProjectsSnapshotsDeleteCall) Header() http.Header { func (c *ProjectsSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4151,12 +4135,11 @@ func (c *ProjectsSnapshotsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+snapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4278,12 +4261,11 @@ func (c *ProjectsSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4406,12 +4388,11 @@ func (c *ProjectsSnapshotsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4530,8 +4511,7 @@ func (c *ProjectsSnapshotsPatchCall) Header() http.Header { func (c *ProjectsSnapshotsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatesnapshotrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatesnapshotrequest) if err != nil { return nil, err } @@ -4635,8 +4615,7 @@ func (c *ProjectsSnapshotsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4743,8 +4722,7 @@ func (c *ProjectsSnapshotsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4850,8 +4828,7 @@ func (c *ProjectsSubscriptionsAcknowledgeCall) Header() http.Header { func (c *ProjectsSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acknowledgerequest) if err != nil { return nil, err } @@ -4965,8 +4942,7 @@ func (c *ProjectsSubscriptionsCreateCall) Header() http.Header { func (c *ProjectsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -5069,12 +5045,11 @@ func (c *ProjectsSubscriptionsDeleteCall) Header() http.Header { func (c *ProjectsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5168,12 +5143,11 @@ func (c *ProjectsSubscriptionsDetachCall) Header() http.Header { func (c *ProjectsSubscriptionsDetachCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:detach") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5277,12 +5251,11 @@ func (c *ProjectsSubscriptionsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5404,12 +5377,11 @@ func (c *ProjectsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5528,12 +5500,11 @@ func (c *ProjectsSubscriptionsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5652,8 +5623,7 @@ func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Header() http.Header { func (c *ProjectsSubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifyackdeadlinerequest) if err != nil { return nil, err } @@ -5758,8 +5728,7 @@ func (c *ProjectsSubscriptionsModifyPushConfigCall) Header() http.Header { func (c *ProjectsSubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifypushconfigrequest) if err != nil { return nil, err } @@ -5866,8 +5835,7 @@ func (c *ProjectsSubscriptionsPatchCall) Header() http.Header { func (c *ProjectsSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatesubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatesubscriptionrequest) if err != nil { return nil, err } @@ -5968,8 +5936,7 @@ func (c *ProjectsSubscriptionsPullCall) Header() http.Header { func (c *ProjectsSubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pullrequest) if err != nil { return nil, err } @@ -6075,8 +6042,7 @@ func (c *ProjectsSubscriptionsSeekCall) Header() http.Header { func (c *ProjectsSubscriptionsSeekCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.seekrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.seekrequest) if err != nil { return nil, err } @@ -6180,8 +6146,7 @@ func (c *ProjectsSubscriptionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6288,8 +6253,7 @@ func (c *ProjectsSubscriptionsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSubscriptionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6396,8 +6360,7 @@ func (c *ProjectsTopicsCreateCall) Header() http.Header { func (c *ProjectsTopicsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -6500,12 +6463,11 @@ func (c *ProjectsTopicsDeleteCall) Header() http.Header { func (c *ProjectsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6608,12 +6570,11 @@ func (c *ProjectsTopicsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6735,12 +6696,11 @@ func (c *ProjectsTopicsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6858,12 +6818,11 @@ func (c *ProjectsTopicsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/topics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6983,8 +6942,7 @@ func (c *ProjectsTopicsPatchCall) Header() http.Header { func (c *ProjectsTopicsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatetopicrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatetopicrequest) if err != nil { return nil, err } @@ -7086,8 +7044,7 @@ func (c *ProjectsTopicsPublishCall) Header() http.Header { func (c *ProjectsTopicsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publishrequest) if err != nil { return nil, err } @@ -7192,8 +7149,7 @@ func (c *ProjectsTopicsSetIamPolicyCall) Header() http.Header { func (c *ProjectsTopicsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -7300,8 +7256,7 @@ func (c *ProjectsTopicsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsTopicsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -7433,12 +7388,11 @@ func (c *ProjectsTopicsSnapshotsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}/snapshots") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7579,12 +7533,11 @@ func (c *ProjectsTopicsSubscriptionsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/pubsub/v1beta1a/pubsub-gen.go b/pubsub/v1beta1a/pubsub-gen.go index 59fefc80ab3..ef52cdad5b4 100644 --- a/pubsub/v1beta1a/pubsub-gen.go +++ b/pubsub/v1beta1a/pubsub-gen.go @@ -126,7 +126,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Subscriptions = NewSubscriptionsService(s) + s.Topics = NewTopicsService(s) if err != nil { return nil, err } @@ -145,10 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Subscriptions = NewSubscriptionsService(s) - s.Topics = NewTopicsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -769,8 +768,7 @@ func (c *SubscriptionsAcknowledgeCall) Header() http.Header { func (c *SubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acknowledgerequest) if err != nil { return nil, err } @@ -867,8 +865,7 @@ func (c *SubscriptionsCreateCall) Header() http.Header { func (c *SubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -965,12 +962,11 @@ func (c *SubscriptionsDeleteCall) Header() http.Header { func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/{+subscription}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1072,12 +1068,11 @@ func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/{+subscription}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1195,12 +1190,11 @@ func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1308,8 +1302,7 @@ func (c *SubscriptionsModifyAckDeadlineCall) Header() http.Header { func (c *SubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifyackdeadlinerequest) if err != nil { return nil, err } @@ -1406,8 +1399,7 @@ func (c *SubscriptionsModifyPushConfigCall) Header() http.Header { func (c *SubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifypushconfigrequest) if err != nil { return nil, err } @@ -1504,8 +1496,7 @@ func (c *SubscriptionsPullCall) Header() http.Header { func (c *SubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pullrequest) if err != nil { return nil, err } @@ -1601,8 +1592,7 @@ func (c *SubscriptionsPullBatchCall) Header() http.Header { func (c *SubscriptionsPullBatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullbatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pullbatchrequest) if err != nil { return nil, err } @@ -1696,8 +1686,7 @@ func (c *TopicsCreateCall) Header() http.Header { func (c *TopicsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -1794,12 +1783,11 @@ func (c *TopicsDeleteCall) Header() http.Header { func (c *TopicsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics/{+topic}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1903,12 +1891,11 @@ func (c *TopicsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics/{+topic}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2026,12 +2013,11 @@ func (c *TopicsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2139,8 +2125,7 @@ func (c *TopicsPublishCall) Header() http.Header { func (c *TopicsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publishrequest) if err != nil { return nil, err } @@ -2234,8 +2219,7 @@ func (c *TopicsPublishBatchCall) Header() http.Header { func (c *TopicsPublishBatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishbatchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publishbatchrequest) if err != nil { return nil, err } diff --git a/pubsub/v1beta2/pubsub-gen.go b/pubsub/v1beta2/pubsub-gen.go index cdc72f83427..07e5edeb4bf 100644 --- a/pubsub/v1beta2/pubsub-gen.go +++ b/pubsub/v1beta2/pubsub-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1074,8 +1073,7 @@ func (c *ProjectsSubscriptionsAcknowledgeCall) Header() http.Header { func (c *ProjectsSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acknowledgerequest) if err != nil { return nil, err } @@ -1184,8 +1182,7 @@ func (c *ProjectsSubscriptionsCreateCall) Header() http.Header { func (c *ProjectsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -1287,12 +1284,11 @@ func (c *ProjectsSubscriptionsDeleteCall) Header() http.Header { func (c *ProjectsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1394,12 +1390,11 @@ func (c *ProjectsSubscriptionsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1521,12 +1516,11 @@ func (c *ProjectsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1644,12 +1638,11 @@ func (c *ProjectsSubscriptionsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+project}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1767,8 +1760,7 @@ func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Header() http.Header { func (c *ProjectsSubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifyackdeadlinerequest) if err != nil { return nil, err } @@ -1872,8 +1864,7 @@ func (c *ProjectsSubscriptionsModifyPushConfigCall) Header() http.Header { func (c *ProjectsSubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifypushconfigrequest) if err != nil { return nil, err } @@ -1976,8 +1967,7 @@ func (c *ProjectsSubscriptionsPullCall) Header() http.Header { func (c *ProjectsSubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pullrequest) if err != nil { return nil, err } @@ -2081,8 +2071,7 @@ func (c *ProjectsSubscriptionsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2189,8 +2178,7 @@ func (c *ProjectsSubscriptionsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSubscriptionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2296,8 +2284,7 @@ func (c *ProjectsTopicsCreateCall) Header() http.Header { func (c *ProjectsTopicsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -2399,12 +2386,11 @@ func (c *ProjectsTopicsDeleteCall) Header() http.Header { func (c *ProjectsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2506,12 +2492,11 @@ func (c *ProjectsTopicsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2633,12 +2618,11 @@ func (c *ProjectsTopicsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2755,12 +2739,11 @@ func (c *ProjectsTopicsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+project}/topics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2876,8 +2859,7 @@ func (c *ProjectsTopicsPublishCall) Header() http.Header { func (c *ProjectsTopicsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publishrequest) if err != nil { return nil, err } @@ -2982,8 +2964,7 @@ func (c *ProjectsTopicsSetIamPolicyCall) Header() http.Header { func (c *ProjectsTopicsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3090,8 +3071,7 @@ func (c *ProjectsTopicsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsTopicsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3218,12 +3198,11 @@ func (c *ProjectsTopicsSubscriptionsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/pubsublite/v1/pubsublite-gen.go b/pubsublite/v1/pubsublite-gen.go index fcf8be63360..a122805e0a9 100644 --- a/pubsublite/v1/pubsublite-gen.go +++ b/pubsublite/v1/pubsublite-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Admin = NewAdminService(s) + s.Cursor = NewCursorService(s) + s.TopicStats = NewTopicStatsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Admin = NewAdminService(s) - s.Cursor = NewCursorService(s) - s.TopicStats = NewTopicStatsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1411,8 +1410,7 @@ func (c *AdminProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *AdminProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1513,12 +1511,11 @@ func (c *AdminProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *AdminProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1622,12 +1619,11 @@ func (c *AdminProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1750,12 +1746,11 @@ func (c *AdminProjectsLocationsOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1878,8 +1873,7 @@ func (c *AdminProjectsLocationsReservationsCreateCall) Header() http.Header { func (c *AdminProjectsLocationsReservationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -1979,12 +1973,11 @@ func (c *AdminProjectsLocationsReservationsDeleteCall) Header() http.Header { func (c *AdminProjectsLocationsReservationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2089,12 +2082,11 @@ func (c *AdminProjectsLocationsReservationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2214,12 +2206,11 @@ func (c *AdminProjectsLocationsReservationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2342,8 +2333,7 @@ func (c *AdminProjectsLocationsReservationsPatchCall) Header() http.Header { func (c *AdminProjectsLocationsReservationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reservation) if err != nil { return nil, err } @@ -2472,12 +2462,11 @@ func (c *AdminProjectsLocationsReservationsTopicsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/topics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2609,8 +2598,7 @@ func (c *AdminProjectsLocationsSubscriptionsCreateCall) Header() http.Header { func (c *AdminProjectsLocationsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -2708,12 +2696,11 @@ func (c *AdminProjectsLocationsSubscriptionsDeleteCall) Header() http.Header { func (c *AdminProjectsLocationsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2815,12 +2802,11 @@ func (c *AdminProjectsLocationsSubscriptionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2940,12 +2926,11 @@ func (c *AdminProjectsLocationsSubscriptionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3068,8 +3053,7 @@ func (c *AdminProjectsLocationsSubscriptionsPatchCall) Header() http.Header { func (c *AdminProjectsLocationsSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -3184,8 +3168,7 @@ func (c *AdminProjectsLocationsSubscriptionsSeekCall) Header() http.Header { func (c *AdminProjectsLocationsSubscriptionsSeekCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.seeksubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.seeksubscriptionrequest) if err != nil { return nil, err } @@ -3294,8 +3277,7 @@ func (c *AdminProjectsLocationsTopicsCreateCall) Header() http.Header { func (c *AdminProjectsLocationsTopicsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -3393,12 +3375,11 @@ func (c *AdminProjectsLocationsTopicsDeleteCall) Header() http.Header { func (c *AdminProjectsLocationsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3500,12 +3481,11 @@ func (c *AdminProjectsLocationsTopicsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3607,12 +3587,11 @@ func (c *AdminProjectsLocationsTopicsGetPartitionsCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/partitions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3733,12 +3712,11 @@ func (c *AdminProjectsLocationsTopicsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/topics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3860,8 +3838,7 @@ func (c *AdminProjectsLocationsTopicsPatchCall) Header() http.Header { func (c *AdminProjectsLocationsTopicsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.topic) if err != nil { return nil, err } @@ -3988,12 +3965,11 @@ func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4107,8 +4083,7 @@ func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) Header() http.Hea func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitcursorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitcursorrequest) if err != nil { return nil, err } @@ -4238,12 +4213,11 @@ func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/cursor/{+parent}/cursors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4361,8 +4335,7 @@ func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) Header() http.H func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.computeheadcursorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.computeheadcursorrequest) if err != nil { return nil, err } @@ -4464,8 +4437,7 @@ func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) Header() http func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.computemessagestatsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.computemessagestatsrequest) if err != nil { return nil, err } @@ -4567,8 +4539,7 @@ func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) Header() http.H func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.computetimecursorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.computetimecursorrequest) if err != nil { return nil, err } diff --git a/rapidmigrationassessment/v1/rapidmigrationassessment-gen.go b/rapidmigrationassessment/v1/rapidmigrationassessment-gen.go index f81a661352c..17d1c42480d 100644 --- a/rapidmigrationassessment/v1/rapidmigrationassessment-gen.go +++ b/rapidmigrationassessment/v1/rapidmigrationassessment-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -767,12 +766,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -898,12 +896,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1024,8 +1021,7 @@ func (c *ProjectsLocationsAnnotationsCreateCall) Header() http.Header { func (c *ProjectsLocationsAnnotationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.annotation) if err != nil { return nil, err } @@ -1135,12 +1131,11 @@ func (c *ProjectsLocationsAnnotationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1247,8 +1242,7 @@ func (c *ProjectsLocationsCollectorsCreateCall) Header() http.Header { func (c *ProjectsLocationsCollectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.collector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.collector) if err != nil { return nil, err } @@ -1363,12 +1357,11 @@ func (c *ProjectsLocationsCollectorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCollectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1470,12 +1463,11 @@ func (c *ProjectsLocationsCollectorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1605,12 +1597,11 @@ func (c *ProjectsLocationsCollectorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/collectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1751,8 +1742,7 @@ func (c *ProjectsLocationsCollectorsPatchCall) Header() http.Header { func (c *ProjectsLocationsCollectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.collector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.collector) if err != nil { return nil, err } @@ -1852,8 +1842,7 @@ func (c *ProjectsLocationsCollectorsPauseCall) Header() http.Header { func (c *ProjectsLocationsCollectorsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausecollectorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausecollectorrequest) if err != nil { return nil, err } @@ -1953,8 +1942,7 @@ func (c *ProjectsLocationsCollectorsRegisterCall) Header() http.Header { func (c *ProjectsLocationsCollectorsRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.registercollectorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registercollectorrequest) if err != nil { return nil, err } @@ -2054,8 +2042,7 @@ func (c *ProjectsLocationsCollectorsResumeCall) Header() http.Header { func (c *ProjectsLocationsCollectorsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumecollectorrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumecollectorrequest) if err != nil { return nil, err } @@ -2163,8 +2150,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -2265,12 +2251,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2374,12 +2359,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2502,12 +2486,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go b/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go index 7306be83c78..5424790eca9 100644 --- a/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go +++ b/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Publications = NewPublicationsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Publications = NewPublicationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -319,12 +318,11 @@ func (c *PublicationsReadersDeleteCall) Header() http.Header { func (c *PublicationsReadersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -429,12 +427,11 @@ func (c *PublicationsReadersGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -539,12 +536,11 @@ func (c *PublicationsReadersGetEntitlementsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -648,8 +644,7 @@ func (c *PublicationsReadersUpdateEntitlementsCall) Header() http.Header { func (c *PublicationsReadersUpdateEntitlementsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.readerentitlements) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.readerentitlements) if err != nil { return nil, err } diff --git a/realtimebidding/v1/realtimebidding-gen.go b/realtimebidding/v1/realtimebidding-gen.go index a8eca61a469..aaa6f63e837 100644 --- a/realtimebidding/v1/realtimebidding-gen.go +++ b/realtimebidding/v1/realtimebidding-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Bidders = NewBiddersService(s) + s.Buyers = NewBuyersService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Bidders = NewBiddersService(s) - s.Buyers = NewBuyersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2635,12 +2634,11 @@ func (c *BiddersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2754,12 +2752,11 @@ func (c *BiddersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/bidders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2948,12 +2945,11 @@ func (c *BiddersCreativesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3074,8 +3070,7 @@ func (c *BiddersCreativesWatchCall) Header() http.Header { func (c *BiddersCreativesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchcreativesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.watchcreativesrequest) if err != nil { return nil, err } @@ -3187,12 +3182,11 @@ func (c *BiddersEndpointsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3311,12 +3305,11 @@ func (c *BiddersEndpointsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3440,8 +3433,7 @@ func (c *BiddersEndpointsPatchCall) Header() http.Header { func (c *BiddersEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } @@ -3542,8 +3534,7 @@ func (c *BiddersPretargetingConfigsActivateCall) Header() http.Header { func (c *BiddersPretargetingConfigsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatepretargetingconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatepretargetingconfigrequest) if err != nil { return nil, err } @@ -3645,8 +3636,7 @@ func (c *BiddersPretargetingConfigsAddTargetedAppsCall) Header() http.Header { func (c *BiddersPretargetingConfigsAddTargetedAppsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addtargetedappsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addtargetedappsrequest) if err != nil { return nil, err } @@ -3748,8 +3738,7 @@ func (c *BiddersPretargetingConfigsAddTargetedPublishersCall) Header() http.Head func (c *BiddersPretargetingConfigsAddTargetedPublishersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addtargetedpublishersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addtargetedpublishersrequest) if err != nil { return nil, err } @@ -3851,8 +3840,7 @@ func (c *BiddersPretargetingConfigsAddTargetedSitesCall) Header() http.Header { func (c *BiddersPretargetingConfigsAddTargetedSitesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addtargetedsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addtargetedsitesrequest) if err != nil { return nil, err } @@ -3958,8 +3946,7 @@ func (c *BiddersPretargetingConfigsCreateCall) Header() http.Header { func (c *BiddersPretargetingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pretargetingconfig) if err != nil { return nil, err } @@ -4059,12 +4046,11 @@ func (c *BiddersPretargetingConfigsDeleteCall) Header() http.Header { func (c *BiddersPretargetingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4167,12 +4153,11 @@ func (c *BiddersPretargetingConfigsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4294,12 +4279,11 @@ func (c *BiddersPretargetingConfigsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pretargetingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4421,8 +4405,7 @@ func (c *BiddersPretargetingConfigsPatchCall) Header() http.Header { func (c *BiddersPretargetingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pretargetingconfig) if err != nil { return nil, err } @@ -4525,8 +4508,7 @@ func (c *BiddersPretargetingConfigsRemoveTargetedAppsCall) Header() http.Header func (c *BiddersPretargetingConfigsRemoveTargetedAppsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removetargetedappsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removetargetedappsrequest) if err != nil { return nil, err } @@ -4629,8 +4611,7 @@ func (c *BiddersPretargetingConfigsRemoveTargetedPublishersCall) Header() http.H func (c *BiddersPretargetingConfigsRemoveTargetedPublishersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removetargetedpublishersrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removetargetedpublishersrequest) if err != nil { return nil, err } @@ -4733,8 +4714,7 @@ func (c *BiddersPretargetingConfigsRemoveTargetedSitesCall) Header() http.Header func (c *BiddersPretargetingConfigsRemoveTargetedSitesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removetargetedsitesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removetargetedsitesrequest) if err != nil { return nil, err } @@ -4836,8 +4816,7 @@ func (c *BiddersPretargetingConfigsSuspendCall) Header() http.Header { func (c *BiddersPretargetingConfigsSuspendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.suspendpretargetingconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.suspendpretargetingconfigrequest) if err != nil { return nil, err } @@ -4940,8 +4919,7 @@ func (c *BiddersPublisherConnectionsBatchApproveCall) Header() http.Header { func (c *BiddersPublisherConnectionsBatchApproveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchapprovepublisherconnectionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchapprovepublisherconnectionsrequest) if err != nil { return nil, err } @@ -5044,8 +5022,7 @@ func (c *BiddersPublisherConnectionsBatchRejectCall) Header() http.Header { func (c *BiddersPublisherConnectionsBatchRejectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchrejectpublisherconnectionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchrejectpublisherconnectionsrequest) if err != nil { return nil, err } @@ -5160,12 +5137,11 @@ func (c *BiddersPublisherConnectionsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5309,12 +5285,11 @@ func (c *BiddersPublisherConnectionsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/publisherConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5438,12 +5413,11 @@ func (c *BuyersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5556,12 +5530,11 @@ func (c *BuyersGetRemarketingTagCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getRemarketingTag") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5677,12 +5650,11 @@ func (c *BuyersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/buyers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5798,8 +5770,7 @@ func (c *BuyersCreativesCreateCall) Header() http.Header { func (c *BuyersCreativesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -5932,12 +5903,11 @@ func (c *BuyersCreativesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6107,12 +6077,11 @@ func (c *BuyersCreativesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/creatives") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6237,8 +6206,7 @@ func (c *BuyersCreativesPatchCall) Header() http.Header { func (c *BuyersCreativesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.creative) if err != nil { return nil, err } @@ -6339,8 +6307,7 @@ func (c *BuyersUserListsCloseCall) Header() http.Header { func (c *BuyersUserListsCloseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.closeuserlistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.closeuserlistrequest) if err != nil { return nil, err } @@ -6445,8 +6412,7 @@ func (c *BuyersUserListsCreateCall) Header() http.Header { func (c *BuyersUserListsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userlist) if err != nil { return nil, err } @@ -6556,12 +6522,11 @@ func (c *BuyersUserListsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6674,12 +6639,11 @@ func (c *BuyersUserListsGetRemarketingTagCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getRemarketingTag") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6801,12 +6765,11 @@ func (c *BuyersUserListsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6921,8 +6884,7 @@ func (c *BuyersUserListsOpenCall) Header() http.Header { func (c *BuyersUserListsOpenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.openuserlistrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.openuserlistrequest) if err != nil { return nil, err } @@ -7028,8 +6990,7 @@ func (c *BuyersUserListsUpdateCall) Header() http.Header { func (c *BuyersUserListsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userlist) if err != nil { return nil, err } diff --git a/realtimebidding/v1alpha/realtimebidding-gen.go b/realtimebidding/v1alpha/realtimebidding-gen.go index 26d92e2e0d6..6008a228f8d 100644 --- a/realtimebidding/v1alpha/realtimebidding-gen.go +++ b/realtimebidding/v1alpha/realtimebidding-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Bidders = NewBiddersService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Bidders = NewBiddersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -399,8 +398,7 @@ func (c *BiddersBiddingFunctionsActivateCall) Header() http.Header { func (c *BiddersBiddingFunctionsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatebiddingfunctionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatebiddingfunctionrequest) if err != nil { return nil, err } @@ -504,8 +502,7 @@ func (c *BiddersBiddingFunctionsArchiveCall) Header() http.Header { func (c *BiddersBiddingFunctionsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.archivebiddingfunctionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.archivebiddingfunctionrequest) if err != nil { return nil, err } @@ -607,8 +604,7 @@ func (c *BiddersBiddingFunctionsCreateCall) Header() http.Header { func (c *BiddersBiddingFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.biddingfunction) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.biddingfunction) if err != nil { return nil, err } @@ -736,12 +732,11 @@ func (c *BiddersBiddingFunctionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/biddingFunctions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/recaptchaenterprise/v1/recaptchaenterprise-gen.go b/recaptchaenterprise/v1/recaptchaenterprise-gen.go index cefc0ea14df..073f8ed6589 100644 --- a/recaptchaenterprise/v1/recaptchaenterprise-gen.go +++ b/recaptchaenterprise/v1/recaptchaenterprise-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2693,8 +2692,7 @@ func (c *ProjectsAssessmentsAnnotateCall) Header() http.Header { func (c *ProjectsAssessmentsAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1annotateassessmentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1annotateassessmentrequest) if err != nil { return nil, err } @@ -2796,8 +2794,7 @@ func (c *ProjectsAssessmentsCreateCall) Header() http.Header { func (c *ProjectsAssessmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1assessment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1assessment) if err != nil { return nil, err } @@ -2901,8 +2898,7 @@ func (c *ProjectsFirewallpoliciesCreateCall) Header() http.Header { func (c *ProjectsFirewallpoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1firewallpolicy) if err != nil { return nil, err } @@ -3002,12 +2998,11 @@ func (c *ProjectsFirewallpoliciesDeleteCall) Header() http.Header { func (c *ProjectsFirewallpoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3111,12 +3106,11 @@ func (c *ProjectsFirewallpoliciesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3234,12 +3228,11 @@ func (c *ProjectsFirewallpoliciesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/firewallpolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3362,8 +3355,7 @@ func (c *ProjectsFirewallpoliciesPatchCall) Header() http.Header { func (c *ProjectsFirewallpoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1firewallpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1firewallpolicy) if err != nil { return nil, err } @@ -3465,8 +3457,7 @@ func (c *ProjectsFirewallpoliciesReorderCall) Header() http.Header { func (c *ProjectsFirewallpoliciesReorderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1reorderfirewallpoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1reorderfirewallpoliciesrequest) if err != nil { return nil, err } @@ -3571,8 +3562,7 @@ func (c *ProjectsKeysAddIpOverrideCall) Header() http.Header { func (c *ProjectsKeysAddIpOverrideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1addipoverriderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1addipoverriderequest) if err != nil { return nil, err } @@ -3674,8 +3664,7 @@ func (c *ProjectsKeysCreateCall) Header() http.Header { func (c *ProjectsKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1key) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1key) if err != nil { return nil, err } @@ -3775,12 +3764,11 @@ func (c *ProjectsKeysDeleteCall) Header() http.Header { func (c *ProjectsKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3884,12 +3872,11 @@ func (c *ProjectsKeysGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3994,12 +3981,11 @@ func (c *ProjectsKeysGetMetricsCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4117,12 +4103,11 @@ func (c *ProjectsKeysListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4263,12 +4248,11 @@ func (c *ProjectsKeysListIpOverridesCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:listIpOverrides") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4387,8 +4371,7 @@ func (c *ProjectsKeysMigrateCall) Header() http.Header { func (c *ProjectsKeysMigrateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1migratekeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1migratekeyrequest) if err != nil { return nil, err } @@ -4498,8 +4481,7 @@ func (c *ProjectsKeysPatchCall) Header() http.Header { func (c *ProjectsKeysPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1key) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1key) if err != nil { return nil, err } @@ -4605,8 +4587,7 @@ func (c *ProjectsKeysRemoveIpOverrideCall) Header() http.Header { func (c *ProjectsKeysRemoveIpOverrideCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1removeipoverriderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1removeipoverriderequest) if err != nil { return nil, err } @@ -4720,12 +4701,11 @@ func (c *ProjectsKeysRetrieveLegacySecretKeyCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+key}:retrieveLegacySecretKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4820,8 +4800,7 @@ func (c *ProjectsRelatedaccountgroupmembershipsSearchCall) Header() http.Header func (c *ProjectsRelatedaccountgroupmembershipsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecaptchaenterprisev1searchrelatedaccountgroupmembershipsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecaptchaenterprisev1searchrelatedaccountgroupmembershipsrequest) if err != nil { return nil, err } @@ -4974,12 +4953,11 @@ func (c *ProjectsRelatedaccountgroupsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/relatedaccountgroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5122,12 +5100,11 @@ func (c *ProjectsRelatedaccountgroupsMembershipsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/recommendationengine/v1beta1/recommendationengine-gen.go b/recommendationengine/v1beta1/recommendationengine-gen.go index 147f5143ca0..8d82024b4a3 100644 --- a/recommendationengine/v1beta1/recommendationengine-gen.go +++ b/recommendationengine/v1beta1/recommendationengine-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2224,12 +2223,11 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/catalogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2352,8 +2350,7 @@ func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1catalog) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1catalog) if err != nil { return nil, err } @@ -2455,8 +2452,7 @@ func (c *ProjectsLocationsCatalogsCatalogItemsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsCatalogItemsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1catalogitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1catalogitem) if err != nil { return nil, err } @@ -2557,12 +2553,11 @@ func (c *ProjectsLocationsCatalogsCatalogItemsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsCatalogItemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2667,12 +2662,11 @@ func (c *ProjectsLocationsCatalogsCatalogItemsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2770,8 +2764,7 @@ func (c *ProjectsLocationsCatalogsCatalogItemsImportCall) Header() http.Header { func (c *ProjectsLocationsCatalogsCatalogItemsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1importcatalogitemsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1importcatalogitemsrequest) if err != nil { return nil, err } @@ -2904,12 +2897,11 @@ func (c *ProjectsLocationsCatalogsCatalogItemsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/catalogItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3034,8 +3026,7 @@ func (c *ProjectsLocationsCatalogsCatalogItemsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsCatalogItemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1catalogitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1catalogitem) if err != nil { return nil, err } @@ -3148,12 +3139,11 @@ func (c *ProjectsLocationsCatalogsEventStoresOperationsGetCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3277,12 +3267,11 @@ func (c *ProjectsLocationsCatalogsEventStoresOperationsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3399,8 +3388,7 @@ func (c *ProjectsLocationsCatalogsEventStoresPlacementsPredictCall) Header() htt func (c *ProjectsLocationsCatalogsEventStoresPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1predictrequest) if err != nil { return nil, err } @@ -3524,8 +3512,7 @@ func (c *ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsCreate func (c *ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1createpredictionapikeyregistrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1createpredictionapikeyregistrationrequest) if err != nil { return nil, err } @@ -3626,12 +3613,11 @@ func (c *ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsDelete func (c *ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3750,12 +3736,11 @@ func (c *ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsListCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/predictionApiKeyRegistrations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3909,12 +3894,11 @@ func (c *ProjectsLocationsCatalogsEventStoresUserEventsCollectCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4013,8 +3997,7 @@ func (c *ProjectsLocationsCatalogsEventStoresUserEventsImportCall) Header() http func (c *ProjectsLocationsCatalogsEventStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1importusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1importusereventsrequest) if err != nil { return nil, err } @@ -4173,12 +4156,11 @@ func (c *ProjectsLocationsCatalogsEventStoresUserEventsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4298,8 +4280,7 @@ func (c *ProjectsLocationsCatalogsEventStoresUserEventsPurgeCall) Header() http. func (c *ProjectsLocationsCatalogsEventStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1purgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1purgeusereventsrequest) if err != nil { return nil, err } @@ -4408,8 +4389,7 @@ func (c *ProjectsLocationsCatalogsEventStoresUserEventsRejoinCall) Header() http func (c *ProjectsLocationsCatalogsEventStoresUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1rejoinusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1rejoinusereventsrequest) if err != nil { return nil, err } @@ -4512,8 +4492,7 @@ func (c *ProjectsLocationsCatalogsEventStoresUserEventsWriteCall) Header() http. func (c *ProjectsLocationsCatalogsEventStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommendationenginev1beta1userevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommendationenginev1beta1userevent) if err != nil { return nil, err } @@ -4626,12 +4605,11 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4755,12 +4733,11 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/recommender/v1/recommender-gen.go b/recommender/v1/recommender-gen.go index 729297bfbdc..3f0d163d753 100644 --- a/recommender/v1/recommender-gen.go +++ b/recommender/v1/recommender-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1479,12 +1478,11 @@ func (c *BillingAccountsLocationsInsightTypesGetConfigCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1594,8 +1592,7 @@ func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) Header() http.Hea func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1insighttypeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1insighttypeconfig) if err != nil { return nil, err } @@ -1707,12 +1704,11 @@ func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1863,12 +1859,11 @@ func (c *BillingAccountsLocationsInsightTypesInsightsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1986,8 +1981,7 @@ func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) Header() func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markinsightacceptedrequest) if err != nil { return nil, err } @@ -2107,12 +2101,11 @@ func (c *BillingAccountsLocationsRecommendersGetConfigCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2222,8 +2215,7 @@ func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) Header() http.Hea func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1recommenderconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1recommenderconfig) if err != nil { return nil, err } @@ -2335,12 +2327,11 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2490,12 +2481,11 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2615,8 +2605,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Hea func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -2721,8 +2710,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) H func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -2829,8 +2817,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) Head func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -2937,8 +2924,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) H func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -3050,12 +3036,11 @@ func (c *FoldersLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3206,12 +3191,11 @@ func (c *FoldersLocationsInsightTypesInsightsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3329,8 +3313,7 @@ func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.Hea func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markinsightacceptedrequest) if err != nil { return nil, err } @@ -3442,12 +3425,11 @@ func (c *FoldersLocationsRecommendersRecommendationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3597,12 +3579,11 @@ func (c *FoldersLocationsRecommendersRecommendationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3722,8 +3703,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Header() ht func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -3828,8 +3808,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Header() func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -3936,8 +3915,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) Header() htt func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -4044,8 +4022,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) Header() func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -4165,12 +4142,11 @@ func (c *OrganizationsLocationsInsightTypesGetConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4280,8 +4256,7 @@ func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) Header() http.Heade func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1insighttypeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1insighttypeconfig) if err != nil { return nil, err } @@ -4393,12 +4368,11 @@ func (c *OrganizationsLocationsInsightTypesInsightsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4549,12 +4523,11 @@ func (c *OrganizationsLocationsInsightTypesInsightsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4672,8 +4645,7 @@ func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) Header() ht func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markinsightacceptedrequest) if err != nil { return nil, err } @@ -4793,12 +4765,11 @@ func (c *OrganizationsLocationsRecommendersGetConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4908,8 +4879,7 @@ func (c *OrganizationsLocationsRecommendersUpdateConfigCall) Header() http.Heade func (c *OrganizationsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1recommenderconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1recommenderconfig) if err != nil { return nil, err } @@ -5021,12 +4991,11 @@ func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5176,12 +5145,11 @@ func (c *OrganizationsLocationsRecommendersRecommendationsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5301,8 +5269,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Heade func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -5407,8 +5374,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Hea func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -5515,8 +5481,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) Header func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -5623,8 +5588,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) Hea func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -5744,12 +5708,11 @@ func (c *ProjectsLocationsInsightTypesGetConfigCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5859,8 +5822,7 @@ func (c *ProjectsLocationsInsightTypesUpdateConfigCall) Header() http.Header { func (c *ProjectsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1insighttypeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1insighttypeconfig) if err != nil { return nil, err } @@ -5972,12 +5934,11 @@ func (c *ProjectsLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6128,12 +6089,11 @@ func (c *ProjectsLocationsInsightTypesInsightsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6251,8 +6211,7 @@ func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.He func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markinsightacceptedrequest) if err != nil { return nil, err } @@ -6372,12 +6331,11 @@ func (c *ProjectsLocationsRecommendersGetConfigCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6487,8 +6445,7 @@ func (c *ProjectsLocationsRecommendersUpdateConfigCall) Header() http.Header { func (c *ProjectsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1recommenderconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1recommenderconfig) if err != nil { return nil, err } @@ -6600,12 +6557,11 @@ func (c *ProjectsLocationsRecommendersRecommendationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6755,12 +6711,11 @@ func (c *ProjectsLocationsRecommendersRecommendationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6880,8 +6835,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Header() h func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -6986,8 +6940,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Header() func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -7094,8 +7047,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) Header() ht func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -7202,8 +7154,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) Header() func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1markrecommendationsucceededrequest) if err != nil { return nil, err } diff --git a/recommender/v1beta1/recommender-gen.go b/recommender/v1beta1/recommender-gen.go index 17b0202bb24..ccb9290fb84 100644 --- a/recommender/v1beta1/recommender-gen.go +++ b/recommender/v1beta1/recommender-gen.go @@ -115,7 +115,13 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) + s.Folders = NewFoldersService(s) + s.InsightTypes = NewInsightTypesService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + s.Recommenders = NewRecommendersService(s) if err != nil { return nil, err } @@ -134,14 +140,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BillingAccounts = NewBillingAccountsService(s) - s.Folders = NewFoldersService(s) - s.InsightTypes = NewInsightTypesService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - s.Recommenders = NewRecommendersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1696,12 +1695,11 @@ func (c *BillingAccountsLocationsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1834,12 +1832,11 @@ func (c *BillingAccountsLocationsInsightTypesGetConfigCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1949,8 +1946,7 @@ func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) Header() http.Hea func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1insighttypeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1insighttypeconfig) if err != nil { return nil, err } @@ -2062,12 +2058,11 @@ func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2218,12 +2213,11 @@ func (c *BillingAccountsLocationsInsightTypesInsightsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2341,8 +2335,7 @@ func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) Header() func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) if err != nil { return nil, err } @@ -2462,12 +2455,11 @@ func (c *BillingAccountsLocationsRecommendersGetConfigCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2577,8 +2569,7 @@ func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) Header() http.Hea func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1recommenderconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1recommenderconfig) if err != nil { return nil, err } @@ -2690,12 +2681,11 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2845,12 +2835,11 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2970,8 +2959,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Hea func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -3076,8 +3064,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) H func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -3184,8 +3171,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) Head func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -3292,8 +3278,7 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) H func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -3428,12 +3413,11 @@ func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3558,12 +3542,11 @@ func (c *FoldersLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3714,12 +3697,11 @@ func (c *FoldersLocationsInsightTypesInsightsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3837,8 +3819,7 @@ func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.Hea func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) if err != nil { return nil, err } @@ -3950,12 +3931,11 @@ func (c *FoldersLocationsRecommendersRecommendationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4105,12 +4085,11 @@ func (c *FoldersLocationsRecommendersRecommendationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4230,8 +4209,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Header() ht func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -4336,8 +4314,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Header() func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -4444,8 +4421,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) Header() htt func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -4552,8 +4528,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) Header() func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -4675,12 +4650,11 @@ func (c *InsightTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/insightTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4825,12 +4799,11 @@ func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4963,12 +4936,11 @@ func (c *OrganizationsLocationsInsightTypesGetConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5078,8 +5050,7 @@ func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) Header() http.Heade func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1insighttypeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1insighttypeconfig) if err != nil { return nil, err } @@ -5191,12 +5162,11 @@ func (c *OrganizationsLocationsInsightTypesInsightsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5347,12 +5317,11 @@ func (c *OrganizationsLocationsInsightTypesInsightsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5470,8 +5439,7 @@ func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) Header() ht func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) if err != nil { return nil, err } @@ -5591,12 +5559,11 @@ func (c *OrganizationsLocationsRecommendersGetConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5706,8 +5673,7 @@ func (c *OrganizationsLocationsRecommendersUpdateConfigCall) Header() http.Heade func (c *OrganizationsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1recommenderconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1recommenderconfig) if err != nil { return nil, err } @@ -5819,12 +5785,11 @@ func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5974,12 +5939,11 @@ func (c *OrganizationsLocationsRecommendersRecommendationsListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6099,8 +6063,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Heade func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -6205,8 +6168,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Hea func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -6313,8 +6275,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) Header func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -6421,8 +6382,7 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) Hea func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -6557,12 +6517,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6695,12 +6654,11 @@ func (c *ProjectsLocationsInsightTypesGetConfigCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6810,8 +6768,7 @@ func (c *ProjectsLocationsInsightTypesUpdateConfigCall) Header() http.Header { func (c *ProjectsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1insighttypeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1insighttypeconfig) if err != nil { return nil, err } @@ -6923,12 +6880,11 @@ func (c *ProjectsLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7079,12 +7035,11 @@ func (c *ProjectsLocationsInsightTypesInsightsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7202,8 +7157,7 @@ func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.He func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markinsightacceptedrequest) if err != nil { return nil, err } @@ -7323,12 +7277,11 @@ func (c *ProjectsLocationsRecommendersGetConfigCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7438,8 +7391,7 @@ func (c *ProjectsLocationsRecommendersUpdateConfigCall) Header() http.Header { func (c *ProjectsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1recommenderconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1recommenderconfig) if err != nil { return nil, err } @@ -7551,12 +7503,11 @@ func (c *ProjectsLocationsRecommendersRecommendationsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7706,12 +7657,11 @@ func (c *ProjectsLocationsRecommendersRecommendationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7831,8 +7781,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Header() h func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest) if err != nil { return nil, err } @@ -7937,8 +7886,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Header() func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) if err != nil { return nil, err } @@ -8045,8 +7993,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) Header() ht func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest) if err != nil { return nil, err } @@ -8153,8 +8100,7 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) Header() func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest) if err != nil { return nil, err } @@ -8277,12 +8223,11 @@ func (c *RecommendersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/recommenders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/redis/v1/redis-gen.go b/redis/v1/redis-gen.go index 3231a9e22d4..95297d1876b 100644 --- a/redis/v1/redis-gen.go +++ b/redis/v1/redis-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3978,12 +3977,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4109,12 +4107,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4240,12 +4237,11 @@ func (c *ProjectsLocationsBackupCollectionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4370,12 +4366,11 @@ func (c *ProjectsLocationsBackupCollectionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupCollections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4495,12 +4490,11 @@ func (c *ProjectsLocationsBackupCollectionsBackupsDeleteCall) Header() http.Head func (c *ProjectsLocationsBackupCollectionsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4594,8 +4588,7 @@ func (c *ProjectsLocationsBackupCollectionsBackupsExportCall) Header() http.Head func (c *ProjectsLocationsBackupCollectionsBackupsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportbackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportbackuprequest) if err != nil { return nil, err } @@ -4707,12 +4700,11 @@ func (c *ProjectsLocationsBackupCollectionsBackupsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4833,12 +4825,11 @@ func (c *ProjectsLocationsBackupCollectionsBackupsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4964,8 +4955,7 @@ func (c *ProjectsLocationsClustersBackupCall) Header() http.Header { func (c *ProjectsLocationsClustersBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupclusterrequest) if err != nil { return nil, err } @@ -5090,8 +5080,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5198,12 +5187,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5307,12 +5295,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5417,12 +5404,11 @@ func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5548,12 +5534,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5687,8 +5672,7 @@ func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5790,8 +5774,7 @@ func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Header() htt func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rescheduleclustermaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rescheduleclustermaintenancerequest) if err != nil { return nil, err } @@ -5911,8 +5894,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6013,12 +5995,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6115,8 +6096,7 @@ func (c *ProjectsLocationsInstancesExportCall) Header() http.Header { func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportinstancerequest) if err != nil { return nil, err } @@ -6219,8 +6199,7 @@ func (c *ProjectsLocationsInstancesFailoverCall) Header() http.Header { func (c *ProjectsLocationsInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.failoverinstancerequest) if err != nil { return nil, err } @@ -6332,12 +6311,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6443,12 +6421,11 @@ func (c *ProjectsLocationsInstancesGetAuthStringCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/authString") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6547,8 +6524,7 @@ func (c *ProjectsLocationsInstancesImportCall) Header() http.Header { func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importinstancerequest) if err != nil { return nil, err } @@ -6681,12 +6657,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6820,8 +6795,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6924,8 +6898,7 @@ func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Head func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reschedulemaintenancerequest) if err != nil { return nil, err } @@ -7028,8 +7001,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstancerequest) if err != nil { return nil, err } @@ -7135,12 +7107,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7233,12 +7204,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7342,12 +7312,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7470,12 +7439,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/redis/v1beta1/redis-gen.go b/redis/v1beta1/redis-gen.go index 634b6a4a890..db928d4358f 100644 --- a/redis/v1beta1/redis-gen.go +++ b/redis/v1beta1/redis-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3982,12 +3981,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4113,12 +4111,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4244,12 +4241,11 @@ func (c *ProjectsLocationsBackupCollectionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4374,12 +4370,11 @@ func (c *ProjectsLocationsBackupCollectionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/backupCollections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4499,12 +4494,11 @@ func (c *ProjectsLocationsBackupCollectionsBackupsDeleteCall) Header() http.Head func (c *ProjectsLocationsBackupCollectionsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4598,8 +4592,7 @@ func (c *ProjectsLocationsBackupCollectionsBackupsExportCall) Header() http.Head func (c *ProjectsLocationsBackupCollectionsBackupsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportbackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportbackuprequest) if err != nil { return nil, err } @@ -4711,12 +4704,11 @@ func (c *ProjectsLocationsBackupCollectionsBackupsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4837,12 +4829,11 @@ func (c *ProjectsLocationsBackupCollectionsBackupsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4968,8 +4959,7 @@ func (c *ProjectsLocationsClustersBackupCall) Header() http.Header { func (c *ProjectsLocationsClustersBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupclusterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupclusterrequest) if err != nil { return nil, err } @@ -5094,8 +5084,7 @@ func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5202,12 +5191,11 @@ func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5311,12 +5299,11 @@ func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5421,12 +5408,11 @@ func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5552,12 +5538,11 @@ func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5691,8 +5676,7 @@ func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -5794,8 +5778,7 @@ func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) Header() htt func (c *ProjectsLocationsClustersRescheduleClusterMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rescheduleclustermaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rescheduleclustermaintenancerequest) if err != nil { return nil, err } @@ -5916,8 +5899,7 @@ func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6018,12 +6000,11 @@ func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6120,8 +6101,7 @@ func (c *ProjectsLocationsInstancesExportCall) Header() http.Header { func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportinstancerequest) if err != nil { return nil, err } @@ -6224,8 +6204,7 @@ func (c *ProjectsLocationsInstancesFailoverCall) Header() http.Header { func (c *ProjectsLocationsInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.failoverinstancerequest) if err != nil { return nil, err } @@ -6337,12 +6316,11 @@ func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6448,12 +6426,11 @@ func (c *ProjectsLocationsInstancesGetAuthStringCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/authString") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6552,8 +6529,7 @@ func (c *ProjectsLocationsInstancesImportCall) Header() http.Header { func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importinstancerequest) if err != nil { return nil, err } @@ -6686,12 +6662,11 @@ func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6825,8 +6800,7 @@ func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance) if err != nil { return nil, err } @@ -6929,8 +6903,7 @@ func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Head func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reschedulemaintenancerequest) if err != nil { return nil, err } @@ -7033,8 +7006,7 @@ func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeinstancerequest) if err != nil { return nil, err } @@ -7140,12 +7112,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7238,12 +7209,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7347,12 +7317,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7475,12 +7444,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/reseller/v1/reseller-gen.go b/reseller/v1/reseller-gen.go index a683c50646b..d83821567a7 100644 --- a/reseller/v1/reseller-gen.go +++ b/reseller/v1/reseller-gen.go @@ -123,7 +123,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Resellernotify = NewResellernotifyService(s) + s.Subscriptions = NewSubscriptionsService(s) if err != nil { return nil, err } @@ -142,11 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Resellernotify = NewResellernotifyService(s) - s.Subscriptions = NewSubscriptionsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -851,12 +850,11 @@ func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/customers/{customerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -970,8 +968,7 @@ func (c *CustomersInsertCall) Header() http.Header { func (c *CustomersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1077,8 +1074,7 @@ func (c *CustomersPatchCall) Header() http.Header { func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1187,8 +1183,7 @@ func (c *CustomersUpdateCall) Header() http.Header { func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customer) if err != nil { return nil, err } @@ -1295,12 +1290,11 @@ func (c *ResellernotifyGetwatchdetailsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/resellernotify/getwatchdetails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1392,12 +1386,11 @@ func (c *ResellernotifyRegisterCall) Header() http.Header { func (c *ResellernotifyRegisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/resellernotify/register") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1489,12 +1482,11 @@ func (c *ResellernotifyUnregisterCall) Header() http.Header { func (c *ResellernotifyUnregisterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/resellernotify/unregister") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1597,12 +1589,11 @@ func (c *SubscriptionsActivateCall) Header() http.Header { func (c *SubscriptionsActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/activate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1713,8 +1704,7 @@ func (c *SubscriptionsChangePlanCall) Header() http.Header { func (c *SubscriptionsChangePlanCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.changeplanrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.changeplanrequest) if err != nil { return nil, err } @@ -1830,8 +1820,7 @@ func (c *SubscriptionsChangeRenewalSettingsCall) Header() http.Header { func (c *SubscriptionsChangeRenewalSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewalsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renewalsettings) if err != nil { return nil, err } @@ -1948,8 +1937,7 @@ func (c *SubscriptionsChangeSeatsCall) Header() http.Header { func (c *SubscriptionsChangeSeatsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.seats) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.seats) if err != nil { return nil, err } @@ -2063,12 +2051,11 @@ func (c *SubscriptionsDeleteCall) Header() http.Header { func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2165,12 +2152,11 @@ func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2323,8 +2309,7 @@ func (c *SubscriptionsInsertCall) Header() http.Header { func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -2484,12 +2469,11 @@ func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2613,12 +2597,11 @@ func (c *SubscriptionsStartPaidServiceCall) Header() http.Header { func (c *SubscriptionsStartPaidServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/startPaidService") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2730,12 +2713,11 @@ func (c *SubscriptionsSuspendCall) Header() http.Header { func (c *SubscriptionsSuspendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/suspend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } diff --git a/resourcesettings/v1/resourcesettings-gen.go b/resourcesettings/v1/resourcesettings-gen.go index 69d8014ae1b..d6afb7310f3 100644 --- a/resourcesettings/v1/resourcesettings-gen.go +++ b/resourcesettings/v1/resourcesettings-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -528,12 +527,11 @@ func (c *FoldersSettingsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -678,12 +676,11 @@ func (c *FoldersSettingsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -809,8 +806,7 @@ func (c *FoldersSettingsPatchCall) Header() http.Header { func (c *FoldersSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudresourcesettingsv1setting) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudresourcesettingsv1setting) if err != nil { return nil, err } @@ -946,12 +942,11 @@ func (c *OrganizationsSettingsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1096,12 +1091,11 @@ func (c *OrganizationsSettingsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1227,8 +1221,7 @@ func (c *OrganizationsSettingsPatchCall) Header() http.Header { func (c *OrganizationsSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudresourcesettingsv1setting) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudresourcesettingsv1setting) if err != nil { return nil, err } @@ -1364,12 +1357,11 @@ func (c *ProjectsSettingsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1514,12 +1506,11 @@ func (c *ProjectsSettingsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1645,8 +1636,7 @@ func (c *ProjectsSettingsPatchCall) Header() http.Header { func (c *ProjectsSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudresourcesettingsv1setting) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudresourcesettingsv1setting) if err != nil { return nil, err } diff --git a/retail/v2/retail-gen.go b/retail/v2/retail-gen.go index aced631d6ea..a62306b6339 100644 --- a/retail/v2/retail-gen.go +++ b/retail/v2/retail-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -8919,12 +8918,11 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+catalog}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9020,8 +9018,7 @@ func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Header() http.Head func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2exportanalyticsmetricsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2exportanalyticsmetricsrequest) if err != nil { return nil, err } @@ -9134,12 +9131,11 @@ func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9244,12 +9240,11 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9354,12 +9349,11 @@ func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+catalog}:getDefaultBranch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9464,12 +9458,11 @@ func (c *ProjectsLocationsCatalogsGetGenerativeQuestionFeatureCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+catalog}/generativeQuestionFeature") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9595,12 +9588,11 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/catalogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9722,8 +9714,7 @@ func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2catalog) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2catalog) if err != nil { return nil, err } @@ -9845,8 +9836,7 @@ func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2setdefaultbranchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2setdefaultbranchrequest) if err != nil { return nil, err } @@ -9963,8 +9953,7 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Head func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2attributesconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2attributesconfig) if err != nil { return nil, err } @@ -10076,8 +10065,7 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Head func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2completionconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2completionconfig) if err != nil { return nil, err } @@ -10188,8 +10176,7 @@ func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionCall) Header() http.He func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2generativequestionconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2generativequestionconfig) if err != nil { return nil, err } @@ -10300,8 +10287,7 @@ func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionFeatureCall) Header() func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionFeatureCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2generativequestionsfeatureconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2generativequestionsfeatureconfig) if err != nil { return nil, err } @@ -10406,8 +10392,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Heade func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addcatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2addcatalogattributerequest) if err != nil { return nil, err } @@ -10512,8 +10497,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) He func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2removecatalogattributerequest) if err != nil { return nil, err } @@ -10619,8 +10603,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) H func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2replacecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2replacecatalogattributerequest) if err != nil { return nil, err } @@ -10733,12 +10716,11 @@ func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10849,8 +10831,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Head func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addfulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2addfulfillmentplacesrequest) if err != nil { return nil, err } @@ -10968,8 +10949,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Heade func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addlocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2addlocalinventoriesrequest) if err != nil { return nil, err } @@ -11085,8 +11065,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2product) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2product) if err != nil { return nil, err } @@ -11194,12 +11173,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11307,12 +11285,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11410,8 +11387,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2importproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2importproductsrequest) if err != nil { return nil, err } @@ -11575,12 +11551,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11717,8 +11692,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Heade func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2product) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2product) if err != nil { return nil, err } @@ -11829,8 +11803,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Header() http.Heade func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2purgeproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2purgeproductsrequest) if err != nil { return nil, err } @@ -11949,8 +11922,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) H func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removefulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2removefulfillmentplacesrequest) if err != nil { return nil, err } @@ -12066,8 +12038,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) He func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removelocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2removelocalinventoriesrequest) if err != nil { return nil, err } @@ -12191,8 +12162,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() htt func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2setinventoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2setinventoryrequest) if err != nil { return nil, err } @@ -12299,8 +12269,7 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2importcompletiondatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2importcompletiondatarequest) if err != nil { return nil, err } @@ -12412,8 +12381,7 @@ func (c *ProjectsLocationsCatalogsControlsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2control) if err != nil { return nil, err } @@ -12515,12 +12483,11 @@ func (c *ProjectsLocationsCatalogsControlsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12625,12 +12592,11 @@ func (c *ProjectsLocationsCatalogsControlsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12758,12 +12724,11 @@ func (c *ProjectsLocationsCatalogsControlsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12888,8 +12853,7 @@ func (c *ProjectsLocationsCatalogsControlsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2control) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2control) if err != nil { return nil, err } @@ -12991,8 +12955,7 @@ func (c *ProjectsLocationsCatalogsGenerativeQuestionBatchUpdateCall) Header() ht func (c *ProjectsLocationsCatalogsGenerativeQuestionBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2batchupdategenerativequestionconfigsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2batchupdategenerativequestionconfigsrequest) if err != nil { return nil, err } @@ -13104,12 +13067,11 @@ func (c *ProjectsLocationsCatalogsGenerativeQuestionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/generativeQuestions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13210,8 +13172,7 @@ func (c *ProjectsLocationsCatalogsModelsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2model) if err != nil { return nil, err } @@ -13312,12 +13273,11 @@ func (c *ProjectsLocationsCatalogsModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13422,12 +13382,11 @@ func (c *ProjectsLocationsCatalogsModelsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13546,12 +13505,11 @@ func (c *ProjectsLocationsCatalogsModelsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13678,8 +13636,7 @@ func (c *ProjectsLocationsCatalogsModelsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2model) if err != nil { return nil, err } @@ -13782,8 +13739,7 @@ func (c *ProjectsLocationsCatalogsModelsPauseCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2pausemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2pausemodelrequest) if err != nil { return nil, err } @@ -13886,8 +13842,7 @@ func (c *ProjectsLocationsCatalogsModelsResumeCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2resumemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2resumemodelrequest) if err != nil { return nil, err } @@ -13990,8 +13945,7 @@ func (c *ProjectsLocationsCatalogsModelsTuneCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsTuneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2tunemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2tunemodelrequest) if err != nil { return nil, err } @@ -14104,12 +14058,11 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14233,12 +14186,11 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14363,8 +14315,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2predictrequest) if err != nil { return nil, err } @@ -14472,8 +14423,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2searchrequest) if err != nil { return nil, err } @@ -14603,8 +14553,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Header() http.He func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addcontrolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2addcontrolrequest) if err != nil { return nil, err } @@ -14716,8 +14665,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2servingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2servingconfig) if err != nil { return nil, err } @@ -14819,12 +14767,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14930,12 +14877,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15055,12 +15001,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15183,8 +15128,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2servingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2servingconfig) if err != nil { return nil, err } @@ -15296,8 +15240,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Heade func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2predictrequest) if err != nil { return nil, err } @@ -15402,8 +15345,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Header() http func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removecontrolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2removecontrolrequest) if err != nil { return nil, err } @@ -15511,8 +15453,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2searchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2searchrequest) if err != nil { return nil, err } @@ -15689,12 +15630,11 @@ func (c *ProjectsLocationsCatalogsUserEventsCollectCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15791,8 +15731,7 @@ func (c *ProjectsLocationsCatalogsUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2importusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2importusereventsrequest) if err != nil { return nil, err } @@ -15898,8 +15837,7 @@ func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2purgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2purgeusereventsrequest) if err != nil { return nil, err } @@ -16008,8 +15946,7 @@ func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2rejoinusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2rejoinusereventsrequest) if err != nil { return nil, err } @@ -16121,8 +16058,7 @@ func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2userevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2userevent) if err != nil { return nil, err } @@ -16235,12 +16171,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16364,12 +16299,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16495,12 +16429,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16624,12 +16557,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 3d50aeb53ca..b75ab57c8dd 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9716,8 +9715,7 @@ func (c *ProjectsEnrollSolutionCall) Header() http.Header { func (c *ProjectsEnrollSolutionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaenrollsolutionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaenrollsolutionrequest) if err != nil { return nil, err } @@ -9829,12 +9827,11 @@ func (c *ProjectsGetAlertConfigCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9938,12 +9935,11 @@ func (c *ProjectsGetLoggingConfigCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10048,12 +10044,11 @@ func (c *ProjectsGetRetailProjectCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10158,12 +10153,11 @@ func (c *ProjectsListEnrolledSolutionsCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}:enrolledSolutions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10265,8 +10259,7 @@ func (c *ProjectsUpdateAlertConfigCall) Header() http.Header { func (c *ProjectsUpdateAlertConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaalertconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaalertconfig) if err != nil { return nil, err } @@ -10378,8 +10371,7 @@ func (c *ProjectsUpdateLoggingConfigCall) Header() http.Header { func (c *ProjectsUpdateLoggingConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaloggingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaloggingconfig) if err != nil { return nil, err } @@ -10579,12 +10571,11 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10680,8 +10671,7 @@ func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Header() http.Head func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaexportanalyticsmetricsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaexportanalyticsmetricsrequest) if err != nil { return nil, err } @@ -10794,12 +10784,11 @@ func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10904,12 +10893,11 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11014,12 +11002,11 @@ func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}:getDefaultBranch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11124,12 +11111,11 @@ func (c *ProjectsLocationsCatalogsGetGenerativeQuestionFeatureCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}/generativeQuestionFeature") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11255,12 +11241,11 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/catalogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11382,8 +11367,7 @@ func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacatalog) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphacatalog) if err != nil { return nil, err } @@ -11505,8 +11489,7 @@ func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasetdefaultbranchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphasetdefaultbranchrequest) if err != nil { return nil, err } @@ -11623,8 +11606,7 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Head func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaattributesconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaattributesconfig) if err != nil { return nil, err } @@ -11736,8 +11718,7 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Head func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacompletionconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphacompletionconfig) if err != nil { return nil, err } @@ -11848,8 +11829,7 @@ func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionCall) Header() http.He func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphagenerativequestionconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphagenerativequestionconfig) if err != nil { return nil, err } @@ -11960,8 +11940,7 @@ func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionFeatureCall) Header() func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionFeatureCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphagenerativequestionsfeatureconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphagenerativequestionsfeatureconfig) if err != nil { return nil, err } @@ -12066,8 +12045,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Heade func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddcatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaaddcatalogattributerequest) if err != nil { return nil, err } @@ -12172,8 +12150,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCa func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphabatchremovecatalogattributesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphabatchremovecatalogattributesrequest) if err != nil { return nil, err } @@ -12278,8 +12255,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) He func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alpharemovecatalogattributerequest) if err != nil { return nil, err } @@ -12385,8 +12361,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) H func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphareplacecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphareplacecatalogattributerequest) if err != nil { return nil, err } @@ -12522,12 +12497,11 @@ func (c *ProjectsLocationsCatalogsBranchesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12652,12 +12626,11 @@ func (c *ProjectsLocationsCatalogsBranchesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/branches") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12762,12 +12735,11 @@ func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12872,12 +12844,11 @@ func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12988,8 +12959,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Head func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddfulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaaddfulfillmentplacesrequest) if err != nil { return nil, err } @@ -13107,8 +13077,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Heade func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddlocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaaddlocalinventoriesrequest) if err != nil { return nil, err } @@ -13224,8 +13193,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaproduct) if err != nil { return nil, err } @@ -13343,12 +13311,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13444,8 +13411,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsExportCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaexportproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaexportproductsrequest) if err != nil { return nil, err } @@ -13561,12 +13527,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13664,8 +13629,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaimportproductsrequest) if err != nil { return nil, err } @@ -13838,12 +13802,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13980,8 +13943,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Heade func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaproduct) if err != nil { return nil, err } @@ -14092,8 +14054,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Header() http.Heade func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapurgeproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphapurgeproductsrequest) if err != nil { return nil, err } @@ -14212,8 +14173,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) H func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovefulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alpharemovefulfillmentplacesrequest) if err != nil { return nil, err } @@ -14329,8 +14289,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) He func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovelocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alpharemovelocalinventoriesrequest) if err != nil { return nil, err } @@ -14454,8 +14413,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() htt func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasetinventoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphasetinventoryrequest) if err != nil { return nil, err } @@ -14562,8 +14520,7 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportcompletiondatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaimportcompletiondatarequest) if err != nil { return nil, err } @@ -14675,8 +14632,7 @@ func (c *ProjectsLocationsCatalogsControlsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphacontrol) if err != nil { return nil, err } @@ -14778,12 +14734,11 @@ func (c *ProjectsLocationsCatalogsControlsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14888,12 +14843,11 @@ func (c *ProjectsLocationsCatalogsControlsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15021,12 +14975,11 @@ func (c *ProjectsLocationsCatalogsControlsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15151,8 +15104,7 @@ func (c *ProjectsLocationsCatalogsControlsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphacontrol) if err != nil { return nil, err } @@ -15254,8 +15206,7 @@ func (c *ProjectsLocationsCatalogsGenerativeQuestionBatchUpdateCall) Header() ht func (c *ProjectsLocationsCatalogsGenerativeQuestionBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphabatchupdategenerativequestionconfigsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphabatchupdategenerativequestionconfigsrequest) if err != nil { return nil, err } @@ -15367,12 +15318,11 @@ func (c *ProjectsLocationsCatalogsGenerativeQuestionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/generativeQuestions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15467,8 +15417,7 @@ func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) Header() func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphamerchantcenteraccountlink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphamerchantcenteraccountlink) if err != nil { return nil, err } @@ -15571,12 +15520,11 @@ func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) Header() func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15681,12 +15629,11 @@ func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/merchantCenterAccountLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15787,8 +15734,7 @@ func (c *ProjectsLocationsCatalogsModelsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphamodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphamodel) if err != nil { return nil, err } @@ -15889,12 +15835,11 @@ func (c *ProjectsLocationsCatalogsModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15999,12 +15944,11 @@ func (c *ProjectsLocationsCatalogsModelsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16123,12 +16067,11 @@ func (c *ProjectsLocationsCatalogsModelsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16255,8 +16198,7 @@ func (c *ProjectsLocationsCatalogsModelsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphamodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphamodel) if err != nil { return nil, err } @@ -16359,8 +16301,7 @@ func (c *ProjectsLocationsCatalogsModelsPauseCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapausemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphapausemodelrequest) if err != nil { return nil, err } @@ -16463,8 +16404,7 @@ func (c *ProjectsLocationsCatalogsModelsResumeCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharesumemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alpharesumemodelrequest) if err != nil { return nil, err } @@ -16567,8 +16507,7 @@ func (c *ProjectsLocationsCatalogsModelsTuneCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsTuneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphatunemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphatunemodelrequest) if err != nil { return nil, err } @@ -16681,12 +16620,11 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16810,12 +16748,11 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16940,8 +16877,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphapredictrequest) if err != nil { return nil, err } @@ -17049,8 +16985,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphasearchrequest) if err != nil { return nil, err } @@ -17180,8 +17115,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Header() http.He func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddcontrolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaaddcontrolrequest) if err != nil { return nil, err } @@ -17293,8 +17227,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaservingconfig) if err != nil { return nil, err } @@ -17396,12 +17329,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17507,12 +17439,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17632,12 +17563,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17760,8 +17690,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaservingconfig) if err != nil { return nil, err } @@ -17873,8 +17802,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Heade func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphapredictrequest) if err != nil { return nil, err } @@ -17979,8 +17907,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Header() http func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovecontrolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alpharemovecontrolrequest) if err != nil { return nil, err } @@ -18088,8 +18015,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphasearchrequest) if err != nil { return nil, err } @@ -18266,12 +18192,11 @@ func (c *ProjectsLocationsCatalogsUserEventsCollectCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18366,8 +18291,7 @@ func (c *ProjectsLocationsCatalogsUserEventsExportCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaexportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaexportusereventsrequest) if err != nil { return nil, err } @@ -18472,8 +18396,7 @@ func (c *ProjectsLocationsCatalogsUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaimportusereventsrequest) if err != nil { return nil, err } @@ -18579,8 +18502,7 @@ func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphapurgeusereventsrequest) if err != nil { return nil, err } @@ -18689,8 +18611,7 @@ func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharejoinusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alpharejoinusereventsrequest) if err != nil { return nil, err } @@ -18802,8 +18723,7 @@ func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphauserevent) if err != nil { return nil, err } @@ -18916,12 +18836,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19045,12 +18964,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19176,12 +19094,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19305,12 +19222,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19427,8 +19343,7 @@ func (c *ProjectsRetailProjectAcceptTermsCall) Header() http.Header { func (c *ProjectsRetailProjectAcceptTermsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaccepttermsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2alphaaccepttermsrequest) if err != nil { return nil, err } diff --git a/retail/v2beta/retail-gen.go b/retail/v2beta/retail-gen.go index 0eae8640da1..f985afce540 100644 --- a/retail/v2beta/retail-gen.go +++ b/retail/v2beta/retail-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9204,12 +9203,11 @@ func (c *ProjectsGetAlertConfigCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9311,8 +9309,7 @@ func (c *ProjectsUpdateAlertConfigCall) Header() http.Header { func (c *ProjectsUpdateAlertConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaalertconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaalertconfig) if err != nil { return nil, err } @@ -9512,12 +9509,11 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9613,8 +9609,7 @@ func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Header() http.Head func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaexportanalyticsmetricsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaexportanalyticsmetricsrequest) if err != nil { return nil, err } @@ -9727,12 +9722,11 @@ func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9837,12 +9831,11 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9947,12 +9940,11 @@ func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}:getDefaultBranch") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10057,12 +10049,11 @@ func (c *ProjectsLocationsCatalogsGetGenerativeQuestionFeatureCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}/generativeQuestionFeature") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10188,12 +10179,11 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/catalogs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10315,8 +10305,7 @@ func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacatalog) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betacatalog) if err != nil { return nil, err } @@ -10438,8 +10427,7 @@ func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasetdefaultbranchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betasetdefaultbranchrequest) if err != nil { return nil, err } @@ -10556,8 +10544,7 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Head func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaattributesconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaattributesconfig) if err != nil { return nil, err } @@ -10669,8 +10656,7 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Head func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacompletionconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betacompletionconfig) if err != nil { return nil, err } @@ -10781,8 +10767,7 @@ func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionCall) Header() http.He func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betagenerativequestionconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betagenerativequestionconfig) if err != nil { return nil, err } @@ -10893,8 +10878,7 @@ func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionFeatureCall) Header() func (c *ProjectsLocationsCatalogsUpdateGenerativeQuestionFeatureCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betagenerativequestionsfeatureconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betagenerativequestionsfeatureconfig) if err != nil { return nil, err } @@ -10999,8 +10983,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Heade func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddcatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaaddcatalogattributerequest) if err != nil { return nil, err } @@ -11105,8 +11088,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCa func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betabatchremovecatalogattributesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betabatchremovecatalogattributesrequest) if err != nil { return nil, err } @@ -11211,8 +11193,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) He func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaremovecatalogattributerequest) if err != nil { return nil, err } @@ -11318,8 +11299,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) H func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betareplacecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betareplacecatalogattributerequest) if err != nil { return nil, err } @@ -11432,12 +11412,11 @@ func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11548,8 +11527,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Head func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddfulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaaddfulfillmentplacesrequest) if err != nil { return nil, err } @@ -11667,8 +11645,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Heade func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddlocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaaddlocalinventoriesrequest) if err != nil { return nil, err } @@ -11784,8 +11761,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaproduct) if err != nil { return nil, err } @@ -11893,12 +11869,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11994,8 +11969,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsExportCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaexportproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaexportproductsrequest) if err != nil { return nil, err } @@ -12111,12 +12085,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12214,8 +12187,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Head func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaimportproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaimportproductsrequest) if err != nil { return nil, err } @@ -12379,12 +12351,11 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12521,8 +12492,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Heade func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaproduct) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaproduct) if err != nil { return nil, err } @@ -12633,8 +12603,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Header() http.Heade func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapurgeproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betapurgeproductsrequest) if err != nil { return nil, err } @@ -12753,8 +12722,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) H func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovefulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaremovefulfillmentplacesrequest) if err != nil { return nil, err } @@ -12870,8 +12838,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) He func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovelocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaremovelocalinventoriesrequest) if err != nil { return nil, err } @@ -12995,8 +12962,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() htt func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasetinventoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betasetinventoryrequest) if err != nil { return nil, err } @@ -13103,8 +13069,7 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaimportcompletiondatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaimportcompletiondatarequest) if err != nil { return nil, err } @@ -13216,8 +13181,7 @@ func (c *ProjectsLocationsCatalogsControlsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betacontrol) if err != nil { return nil, err } @@ -13319,12 +13283,11 @@ func (c *ProjectsLocationsCatalogsControlsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13429,12 +13392,11 @@ func (c *ProjectsLocationsCatalogsControlsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13562,12 +13524,11 @@ func (c *ProjectsLocationsCatalogsControlsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13692,8 +13653,7 @@ func (c *ProjectsLocationsCatalogsControlsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betacontrol) if err != nil { return nil, err } @@ -13795,8 +13755,7 @@ func (c *ProjectsLocationsCatalogsGenerativeQuestionBatchUpdateCall) Header() ht func (c *ProjectsLocationsCatalogsGenerativeQuestionBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betabatchupdategenerativequestionconfigsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betabatchupdategenerativequestionconfigsrequest) if err != nil { return nil, err } @@ -13908,12 +13867,11 @@ func (c *ProjectsLocationsCatalogsGenerativeQuestionsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/generativeQuestions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14014,8 +13972,7 @@ func (c *ProjectsLocationsCatalogsModelsCreateCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betamodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betamodel) if err != nil { return nil, err } @@ -14116,12 +14073,11 @@ func (c *ProjectsLocationsCatalogsModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14226,12 +14182,11 @@ func (c *ProjectsLocationsCatalogsModelsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14350,12 +14305,11 @@ func (c *ProjectsLocationsCatalogsModelsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14482,8 +14436,7 @@ func (c *ProjectsLocationsCatalogsModelsPatchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betamodel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betamodel) if err != nil { return nil, err } @@ -14586,8 +14539,7 @@ func (c *ProjectsLocationsCatalogsModelsPauseCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapausemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betapausemodelrequest) if err != nil { return nil, err } @@ -14690,8 +14642,7 @@ func (c *ProjectsLocationsCatalogsModelsResumeCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaresumemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaresumemodelrequest) if err != nil { return nil, err } @@ -14794,8 +14745,7 @@ func (c *ProjectsLocationsCatalogsModelsTuneCall) Header() http.Header { func (c *ProjectsLocationsCatalogsModelsTuneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betatunemodelrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betatunemodelrequest) if err != nil { return nil, err } @@ -14908,12 +14858,11 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15037,12 +14986,11 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15167,8 +15115,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betapredictrequest) if err != nil { return nil, err } @@ -15276,8 +15223,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betasearchrequest) if err != nil { return nil, err } @@ -15407,8 +15353,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Header() http.He func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddcontrolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaaddcontrolrequest) if err != nil { return nil, err } @@ -15520,8 +15465,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaservingconfig) if err != nil { return nil, err } @@ -15623,12 +15567,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15734,12 +15677,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15859,12 +15801,11 @@ func (c *ProjectsLocationsCatalogsServingConfigsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15987,8 +15928,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaservingconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaservingconfig) if err != nil { return nil, err } @@ -16100,8 +16040,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Heade func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapredictrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betapredictrequest) if err != nil { return nil, err } @@ -16206,8 +16145,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Header() http func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovecontrolrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaremovecontrolrequest) if err != nil { return nil, err } @@ -16315,8 +16253,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasearchrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betasearchrequest) if err != nil { return nil, err } @@ -16493,12 +16430,11 @@ func (c *ProjectsLocationsCatalogsUserEventsCollectCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16593,8 +16529,7 @@ func (c *ProjectsLocationsCatalogsUserEventsExportCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaexportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaexportusereventsrequest) if err != nil { return nil, err } @@ -16699,8 +16634,7 @@ func (c *ProjectsLocationsCatalogsUserEventsImportCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betaimportusereventsrequest) if err != nil { return nil, err } @@ -16806,8 +16740,7 @@ func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betapurgeusereventsrequest) if err != nil { return nil, err } @@ -16916,8 +16849,7 @@ func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betarejoinusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betarejoinusereventsrequest) if err != nil { return nil, err } @@ -17029,8 +16961,7 @@ func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Header() http.Header { func (c *ProjectsLocationsCatalogsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betauserevent) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudretailv2betauserevent) if err != nil { return nil, err } @@ -17143,12 +17074,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17272,12 +17202,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17403,12 +17332,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17532,12 +17460,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/run/v1/run-gen.go b/run/v1/run-gen.go index 537ba1f1a75..50d8fd062d5 100644 --- a/run/v1/run-gen.go +++ b/run/v1/run-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Namespaces = NewNamespacesService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Namespaces = NewNamespacesService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -5467,12 +5466,11 @@ func (c *NamespacesAuthorizeddomainsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/domains.cloudrun.com/v1/{+parent}/authorizeddomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5597,12 +5595,11 @@ func (c *NamespacesConfigurationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5754,12 +5751,11 @@ func (c *NamespacesConfigurationsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+parent}/configurations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5863,8 +5859,7 @@ func (c *NamespacesDomainmappingsCreateCall) Header() http.Header { func (c *NamespacesDomainmappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -5996,12 +5991,11 @@ func (c *NamespacesDomainmappingsDeleteCall) Header() http.Header { func (c *NamespacesDomainmappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/domains.cloudrun.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6105,12 +6099,11 @@ func (c *NamespacesDomainmappingsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/domains.cloudrun.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6269,12 +6262,11 @@ func (c *NamespacesDomainmappingsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/domains.cloudrun.com/v1/{+parent}/domainmappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6369,8 +6361,7 @@ func (c *NamespacesExecutionsCancelCall) Header() http.Header { func (c *NamespacesExecutionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelexecutionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelexecutionrequest) if err != nil { return nil, err } @@ -6491,12 +6482,11 @@ func (c *NamespacesExecutionsDeleteCall) Header() http.Header { func (c *NamespacesExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6600,12 +6590,11 @@ func (c *NamespacesExecutionsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6758,12 +6747,11 @@ func (c *NamespacesExecutionsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6858,8 +6846,7 @@ func (c *NamespacesJobsCreateCall) Header() http.Header { func (c *NamespacesJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -6983,12 +6970,11 @@ func (c *NamespacesJobsDeleteCall) Header() http.Header { func (c *NamespacesJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7092,12 +7078,11 @@ func (c *NamespacesJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7250,12 +7235,11 @@ func (c *NamespacesJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7353,8 +7337,7 @@ func (c *NamespacesJobsReplaceJobCall) Header() http.Header { func (c *NamespacesJobsReplaceJobCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -7456,8 +7439,7 @@ func (c *NamespacesJobsRunCall) Header() http.Header { func (c *NamespacesJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runjobrequest) if err != nil { return nil, err } @@ -7587,12 +7569,11 @@ func (c *NamespacesRevisionsDeleteCall) Header() http.Header { func (c *NamespacesRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7696,12 +7677,11 @@ func (c *NamespacesRevisionsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7859,12 +7839,11 @@ func (c *NamespacesRevisionsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+parent}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7969,12 +7948,11 @@ func (c *NamespacesRoutesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8132,12 +8110,11 @@ func (c *NamespacesRoutesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+parent}/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8245,8 +8222,7 @@ func (c *NamespacesServicesCreateCall) Header() http.Header { func (c *NamespacesServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -8380,12 +8356,11 @@ func (c *NamespacesServicesDeleteCall) Header() http.Header { func (c *NamespacesServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8493,12 +8468,11 @@ func (c *NamespacesServicesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8656,12 +8630,11 @@ func (c *NamespacesServicesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/serving.knative.dev/v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8772,8 +8745,7 @@ func (c *NamespacesServicesReplaceServiceCall) Header() http.Header { func (c *NamespacesServicesReplaceServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -8885,12 +8857,11 @@ func (c *NamespacesTasksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9055,12 +9026,11 @@ func (c *NamespacesTasksListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "apis/run.googleapis.com/v1/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9178,12 +9148,11 @@ func (c *ProjectsAuthorizeddomainsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authorizeddomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9331,12 +9300,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9475,12 +9443,11 @@ func (c *ProjectsLocationsAuthorizeddomainsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authorizeddomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9605,12 +9572,11 @@ func (c *ProjectsLocationsConfigurationsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9762,12 +9728,11 @@ func (c *ProjectsLocationsConfigurationsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configurations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9871,8 +9836,7 @@ func (c *ProjectsLocationsDomainmappingsCreateCall) Header() http.Header { func (c *ProjectsLocationsDomainmappingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainmapping) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.domainmapping) if err != nil { return nil, err } @@ -10004,12 +9968,11 @@ func (c *ProjectsLocationsDomainmappingsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDomainmappingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10113,12 +10076,11 @@ func (c *ProjectsLocationsDomainmappingsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10277,12 +10239,11 @@ func (c *ProjectsLocationsDomainmappingsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/domainmappings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10405,12 +10366,11 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10505,8 +10465,7 @@ func (c *ProjectsLocationsJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10610,8 +10569,7 @@ func (c *ProjectsLocationsJobsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10713,12 +10671,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10822,12 +10779,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10956,12 +10912,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11083,8 +11038,7 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningwaitoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningwaitoperationrequest) if err != nil { return nil, err } @@ -11215,12 +11169,11 @@ func (c *ProjectsLocationsRevisionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11324,12 +11277,11 @@ func (c *ProjectsLocationsRevisionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11487,12 +11439,11 @@ func (c *ProjectsLocationsRevisionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11597,12 +11548,11 @@ func (c *ProjectsLocationsRoutesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11760,12 +11710,11 @@ func (c *ProjectsLocationsRoutesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11873,8 +11822,7 @@ func (c *ProjectsLocationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -12008,12 +11956,11 @@ func (c *ProjectsLocationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12121,12 +12068,11 @@ func (c *ProjectsLocationsServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12249,12 +12195,11 @@ func (c *ProjectsLocationsServicesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12412,12 +12357,11 @@ func (c *ProjectsLocationsServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12528,8 +12472,7 @@ func (c *ProjectsLocationsServicesReplaceServiceCall) Header() http.Header { func (c *ProjectsLocationsServicesReplaceServiceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -12632,8 +12575,7 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12737,8 +12679,7 @@ func (c *ProjectsLocationsServicesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/run/v2/run-gen.go b/run/v2/run-gen.go index 7a6b1c4da54..eb4b3b739f0 100644 --- a/run/v2/run-gen.go +++ b/run/v2/run-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5166,8 +5165,7 @@ func (c *ProjectsLocationsExportImageCall) Header() http.Header { func (c *ProjectsLocationsExportImageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2exportimagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2exportimagerequest) if err != nil { return nil, err } @@ -5283,12 +5281,11 @@ func (c *ProjectsLocationsExportImageMetadataCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:exportImageMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5398,12 +5395,11 @@ func (c *ProjectsLocationsExportMetadataCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:exportMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5509,12 +5505,11 @@ func (c *ProjectsLocationsExportProjectMetadataCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:exportProjectMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5609,8 +5604,7 @@ func (c *ProjectsLocationsBuildsSubmitCall) Header() http.Header { func (c *ProjectsLocationsBuildsSubmitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2submitbuildrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2submitbuildrequest) if err != nil { return nil, err } @@ -5728,8 +5722,7 @@ func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2job) if err != nil { return nil, err } @@ -5845,12 +5838,11 @@ func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5955,12 +5947,11 @@ func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6083,12 +6074,11 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6214,12 +6204,11 @@ func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6350,8 +6339,7 @@ func (c *ProjectsLocationsJobsPatchCall) Header() http.Header { func (c *ProjectsLocationsJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2job) if err != nil { return nil, err } @@ -6454,8 +6442,7 @@ func (c *ProjectsLocationsJobsRunCall) Header() http.Header { func (c *ProjectsLocationsJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2runjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2runjobrequest) if err != nil { return nil, err } @@ -6559,8 +6546,7 @@ func (c *ProjectsLocationsJobsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -6665,8 +6651,7 @@ func (c *ProjectsLocationsJobsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -6769,8 +6754,7 @@ func (c *ProjectsLocationsJobsExecutionsCancelCall) Header() http.Header { func (c *ProjectsLocationsJobsExecutionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2cancelexecutionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2cancelexecutionrequest) if err != nil { return nil, err } @@ -6886,12 +6870,11 @@ func (c *ProjectsLocationsJobsExecutionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobsExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7002,12 +6985,11 @@ func (c *ProjectsLocationsJobsExecutionsExportStatusCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/{+operationId}:exportStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7113,12 +7095,11 @@ func (c *ProjectsLocationsJobsExecutionsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7246,12 +7227,11 @@ func (c *ProjectsLocationsJobsExecutionsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7377,12 +7357,11 @@ func (c *ProjectsLocationsJobsExecutionsTasksGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7509,12 +7488,11 @@ func (c *ProjectsLocationsJobsExecutionsTasksListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7629,12 +7607,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7739,12 +7716,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7873,12 +7849,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8000,8 +7975,7 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningwaitoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningwaitoperationrequest) if err != nil { return nil, err } @@ -8121,8 +8095,7 @@ func (c *ProjectsLocationsServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2service) if err != nil { return nil, err } @@ -8239,12 +8212,11 @@ func (c *ProjectsLocationsServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8349,12 +8321,11 @@ func (c *ProjectsLocationsServicesGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8478,12 +8449,11 @@ func (c *ProjectsLocationsServicesGetIamPolicyCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8610,12 +8580,11 @@ func (c *ProjectsLocationsServicesListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8756,8 +8725,7 @@ func (c *ProjectsLocationsServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrunv2service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudrunv2service) if err != nil { return nil, err } @@ -8861,8 +8829,7 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1setiampolicyrequest) if err != nil { return nil, err } @@ -8967,8 +8934,7 @@ func (c *ProjectsLocationsServicesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleiamv1testiampermissionsrequest) if err != nil { return nil, err } @@ -9084,12 +9050,11 @@ func (c *ProjectsLocationsServicesRevisionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsServicesRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9200,12 +9165,11 @@ func (c *ProjectsLocationsServicesRevisionsExportStatusCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/{+operationId}:exportStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9311,12 +9275,11 @@ func (c *ProjectsLocationsServicesRevisionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9443,12 +9406,11 @@ func (c *ProjectsLocationsServicesRevisionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/revisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/runtimeconfig/v1/runtimeconfig-gen.go b/runtimeconfig/v1/runtimeconfig-gen.go index 12c125ccf7f..a7bd378ee92 100644 --- a/runtimeconfig/v1/runtimeconfig-gen.go +++ b/runtimeconfig/v1/runtimeconfig-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -343,8 +342,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -445,12 +443,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -573,12 +570,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/runtimeconfig/v1beta1/runtimeconfig-gen.go b/runtimeconfig/v1beta1/runtimeconfig-gen.go index 2c2527785af..ad014225a06 100644 --- a/runtimeconfig/v1beta1/runtimeconfig-gen.go +++ b/runtimeconfig/v1beta1/runtimeconfig-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1031,8 +1030,7 @@ func (c *ProjectsConfigsCreateCall) Header() http.Header { func (c *ProjectsConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtimeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtimeconfig) if err != nil { return nil, err } @@ -1131,12 +1129,11 @@ func (c *ProjectsConfigsDeleteCall) Header() http.Header { func (c *ProjectsConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1239,12 +1236,11 @@ func (c *ProjectsConfigsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1366,12 +1362,11 @@ func (c *ProjectsConfigsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1491,12 +1486,11 @@ func (c *ProjectsConfigsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/configs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1614,8 +1608,7 @@ func (c *ProjectsConfigsSetIamPolicyCall) Header() http.Header { func (c *ProjectsConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -1722,8 +1715,7 @@ func (c *ProjectsConfigsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -1826,8 +1818,7 @@ func (c *ProjectsConfigsUpdateCall) Header() http.Header { func (c *ProjectsConfigsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtimeconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtimeconfig) if err != nil { return nil, err } @@ -1939,12 +1930,11 @@ func (c *ProjectsConfigsOperationsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2043,8 +2033,7 @@ func (c *ProjectsConfigsOperationsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsConfigsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2164,8 +2153,7 @@ func (c *ProjectsConfigsVariablesCreateCall) Header() http.Header { func (c *ProjectsConfigsVariablesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variable) if err != nil { return nil, err } @@ -2274,12 +2262,11 @@ func (c *ProjectsConfigsVariablesDeleteCall) Header() http.Header { func (c *ProjectsConfigsVariablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2382,12 +2369,11 @@ func (c *ProjectsConfigsVariablesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2527,12 +2513,11 @@ func (c *ProjectsConfigsVariablesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/variables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2653,8 +2638,7 @@ func (c *ProjectsConfigsVariablesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsConfigsVariablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2756,8 +2740,7 @@ func (c *ProjectsConfigsVariablesUpdateCall) Header() http.Header { func (c *ProjectsConfigsVariablesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variable) if err != nil { return nil, err } @@ -2867,8 +2850,7 @@ func (c *ProjectsConfigsVariablesWatchCall) Header() http.Header { func (c *ProjectsConfigsVariablesWatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchvariablerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.watchvariablerequest) if err != nil { return nil, err } @@ -2986,8 +2968,7 @@ func (c *ProjectsConfigsWaitersCreateCall) Header() http.Header { func (c *ProjectsConfigsWaitersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.waiter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.waiter) if err != nil { return nil, err } @@ -3086,12 +3067,11 @@ func (c *ProjectsConfigsWaitersDeleteCall) Header() http.Header { func (c *ProjectsConfigsWaitersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3195,12 +3175,11 @@ func (c *ProjectsConfigsWaitersGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3320,12 +3299,11 @@ func (c *ProjectsConfigsWaitersListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/waiters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3446,8 +3424,7 @@ func (c *ProjectsConfigsWaitersTestIamPermissionsCall) Header() http.Header { func (c *ProjectsConfigsWaitersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/safebrowsing/v4/safebrowsing-gen.go b/safebrowsing/v4/safebrowsing-gen.go index 5567f02c120..66e29a39846 100644 --- a/safebrowsing/v4/safebrowsing-gen.go +++ b/safebrowsing/v4/safebrowsing-gen.go @@ -103,7 +103,14 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.EncodedFullHashes = NewEncodedFullHashesService(s) + s.EncodedUpdates = NewEncodedUpdatesService(s) + s.FullHashes = NewFullHashesService(s) + s.ThreatHits = NewThreatHitsService(s) + s.ThreatListUpdates = NewThreatListUpdatesService(s) + s.ThreatLists = NewThreatListsService(s) + s.ThreatMatches = NewThreatMatchesService(s) if err != nil { return nil, err } @@ -122,15 +129,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.EncodedFullHashes = NewEncodedFullHashesService(s) - s.EncodedUpdates = NewEncodedUpdatesService(s) - s.FullHashes = NewFullHashesService(s) - s.ThreatHits = NewThreatHitsService(s) - s.ThreatListUpdates = NewThreatListUpdatesService(s) - s.ThreatLists = NewThreatListsService(s) - s.ThreatMatches = NewThreatMatchesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1353,12 +1352,11 @@ func (c *EncodedFullHashesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/encodedFullHashes/{encodedRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1475,12 +1473,11 @@ func (c *EncodedUpdatesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/encodedUpdates/{encodedRequest}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1569,8 +1566,7 @@ func (c *FullHashesFindCall) Header() http.Header { func (c *FullHashesFindCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4findfullhashesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlesecuritysafebrowsingv4findfullhashesrequest) if err != nil { return nil, err } @@ -1665,8 +1661,7 @@ func (c *ThreatHitsCreateCall) Header() http.Header { func (c *ThreatHitsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4threathit) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlesecuritysafebrowsingv4threathit) if err != nil { return nil, err } @@ -1761,8 +1756,7 @@ func (c *ThreatListUpdatesFetchCall) Header() http.Header { func (c *ThreatListUpdatesFetchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest) if err != nil { return nil, err } @@ -1866,12 +1860,11 @@ func (c *ThreatListsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/threatLists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1957,8 +1950,7 @@ func (c *ThreatMatchesFindCall) Header() http.Header { func (c *ThreatMatchesFindCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4findthreatmatchesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlesecuritysafebrowsingv4findthreatmatchesrequest) if err != nil { return nil, err } diff --git a/safebrowsing/v5/safebrowsing-gen.go b/safebrowsing/v5/safebrowsing-gen.go index c9b3df52c1d..df5fb8053b8 100644 --- a/safebrowsing/v5/safebrowsing-gen.go +++ b/safebrowsing/v5/safebrowsing-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Hashes = NewHashesService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Hashes = NewHashesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -361,12 +360,11 @@ func (c *HashesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v5/hashes:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/sasportal/v1alpha1/sasportal-gen.go b/sasportal/v1alpha1/sasportal-gen.go index baec6676a02..8e267b7c822 100644 --- a/sasportal/v1alpha1/sasportal-gen.go +++ b/sasportal/v1alpha1/sasportal-gen.go @@ -124,7 +124,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.Deployments = NewDeploymentsService(s) + s.Installer = NewInstallerService(s) + s.Nodes = NewNodesService(s) + s.Policies = NewPoliciesService(s) if err != nil { return nil, err } @@ -143,13 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.Deployments = NewDeploymentsService(s) - s.Installer = NewInstallerService(s) - s.Nodes = NewNodesService(s) - s.Policies = NewPoliciesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1987,12 +1986,11 @@ func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2106,12 +2104,11 @@ func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2229,12 +2226,11 @@ func (c *CustomersListGcpProjectDeploymentsCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:listGcpProjectDeployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2330,12 +2326,11 @@ func (c *CustomersListLegacyOrganizationsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:listLegacyOrganizations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2424,8 +2419,7 @@ func (c *CustomersMigrateOrganizationCall) Header() http.Header { func (c *CustomersMigrateOrganizationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmigrateorganizationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmigrateorganizationrequest) if err != nil { return nil, err } @@ -2529,8 +2523,7 @@ func (c *CustomersPatchCall) Header() http.Header { func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcustomer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcustomer) if err != nil { return nil, err } @@ -2628,8 +2621,7 @@ func (c *CustomersProvisionDeploymentCall) Header() http.Header { func (c *CustomersProvisionDeploymentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalprovisiondeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalprovisiondeploymentrequest) if err != nil { return nil, err } @@ -2726,8 +2718,7 @@ func (c *CustomersSetupSasAnalyticsCall) Header() http.Header { func (c *CustomersSetupSasAnalyticsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsetupsasanalyticsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsetupsasanalyticsrequest) if err != nil { return nil, err } @@ -2825,8 +2816,7 @@ func (c *CustomersDeploymentsCreateCall) Header() http.Header { func (c *CustomersDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -2925,12 +2915,11 @@ func (c *CustomersDeploymentsDeleteCall) Header() http.Header { func (c *CustomersDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3032,12 +3021,11 @@ func (c *CustomersDeploymentsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3165,12 +3153,11 @@ func (c *CustomersDeploymentsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3284,8 +3271,7 @@ func (c *CustomersDeploymentsMoveCall) Header() http.Header { func (c *CustomersDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedeploymentrequest) if err != nil { return nil, err } @@ -3392,8 +3378,7 @@ func (c *CustomersDeploymentsPatchCall) Header() http.Header { func (c *CustomersDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -3494,8 +3479,7 @@ func (c *CustomersDeploymentsDevicesCreateCall) Header() http.Header { func (c *CustomersDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -3596,8 +3580,7 @@ func (c *CustomersDeploymentsDevicesCreateSignedCall) Header() http.Header { func (c *CustomersDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -3733,12 +3716,11 @@ func (c *CustomersDeploymentsDevicesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3852,8 +3834,7 @@ func (c *CustomersDevicesCreateCall) Header() http.Header { func (c *CustomersDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -3954,8 +3935,7 @@ func (c *CustomersDevicesCreateSignedCall) Header() http.Header { func (c *CustomersDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -4054,12 +4034,11 @@ func (c *CustomersDevicesDeleteCall) Header() http.Header { func (c *CustomersDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4161,12 +4140,11 @@ func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4294,12 +4272,11 @@ func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4413,8 +4390,7 @@ func (c *CustomersDevicesMoveCall) Header() http.Header { func (c *CustomersDevicesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest) if err != nil { return nil, err } @@ -4521,8 +4497,7 @@ func (c *CustomersDevicesPatchCall) Header() http.Header { func (c *CustomersDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -4623,8 +4598,7 @@ func (c *CustomersDevicesSignDeviceCall) Header() http.Header { func (c *CustomersDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsigndevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest) if err != nil { return nil, err } @@ -4724,8 +4698,7 @@ func (c *CustomersDevicesUpdateSignedCall) Header() http.Header { func (c *CustomersDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalupdatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest) if err != nil { return nil, err } @@ -4826,8 +4799,7 @@ func (c *CustomersNodesCreateCall) Header() http.Header { func (c *CustomersNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -4925,12 +4897,11 @@ func (c *CustomersNodesDeleteCall) Header() http.Header { func (c *CustomersNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5032,12 +5003,11 @@ func (c *CustomersNodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5163,12 +5133,11 @@ func (c *CustomersNodesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5282,8 +5251,7 @@ func (c *CustomersNodesMoveCall) Header() http.Header { func (c *CustomersNodesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovenoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovenoderequest) if err != nil { return nil, err } @@ -5390,8 +5358,7 @@ func (c *CustomersNodesPatchCall) Header() http.Header { func (c *CustomersNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -5491,8 +5458,7 @@ func (c *CustomersNodesDeploymentsCreateCall) Header() http.Header { func (c *CustomersNodesDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -5628,12 +5594,11 @@ func (c *CustomersNodesDeploymentsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5747,8 +5712,7 @@ func (c *CustomersNodesDevicesCreateCall) Header() http.Header { func (c *CustomersNodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -5849,8 +5813,7 @@ func (c *CustomersNodesDevicesCreateSignedCall) Header() http.Header { func (c *CustomersNodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -5986,12 +5949,11 @@ func (c *CustomersNodesDevicesListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6105,8 +6067,7 @@ func (c *CustomersNodesNodesCreateCall) Header() http.Header { func (c *CustomersNodesNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -6240,12 +6201,11 @@ func (c *CustomersNodesNodesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6369,12 +6329,11 @@ func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6465,12 +6424,11 @@ func (c *DeploymentsDevicesDeleteCall) Header() http.Header { func (c *DeploymentsDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6572,12 +6530,11 @@ func (c *DeploymentsDevicesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6670,8 +6627,7 @@ func (c *DeploymentsDevicesMoveCall) Header() http.Header { func (c *DeploymentsDevicesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest) if err != nil { return nil, err } @@ -6778,8 +6734,7 @@ func (c *DeploymentsDevicesPatchCall) Header() http.Header { func (c *DeploymentsDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -6880,8 +6835,7 @@ func (c *DeploymentsDevicesSignDeviceCall) Header() http.Header { func (c *DeploymentsDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsigndevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest) if err != nil { return nil, err } @@ -6981,8 +6935,7 @@ func (c *DeploymentsDevicesUpdateSignedCall) Header() http.Header { func (c *DeploymentsDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalupdatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest) if err != nil { return nil, err } @@ -7079,8 +7032,7 @@ func (c *InstallerGenerateSecretCall) Header() http.Header { func (c *InstallerGenerateSecretCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalgeneratesecretrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalgeneratesecretrequest) if err != nil { return nil, err } @@ -7175,8 +7127,7 @@ func (c *InstallerValidateCall) Header() http.Header { func (c *InstallerValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalvalidateinstallerrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalvalidateinstallerrequest) if err != nil { return nil, err } @@ -7284,12 +7235,11 @@ func (c *NodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7379,12 +7329,11 @@ func (c *NodesDeploymentsDeleteCall) Header() http.Header { func (c *NodesDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7486,12 +7435,11 @@ func (c *NodesDeploymentsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7619,12 +7567,11 @@ func (c *NodesDeploymentsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7738,8 +7685,7 @@ func (c *NodesDeploymentsMoveCall) Header() http.Header { func (c *NodesDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedeploymentrequest) if err != nil { return nil, err } @@ -7846,8 +7792,7 @@ func (c *NodesDeploymentsPatchCall) Header() http.Header { func (c *NodesDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -7948,8 +7893,7 @@ func (c *NodesDeploymentsDevicesCreateCall) Header() http.Header { func (c *NodesDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -8050,8 +7994,7 @@ func (c *NodesDeploymentsDevicesCreateSignedCall) Header() http.Header { func (c *NodesDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -8187,12 +8130,11 @@ func (c *NodesDeploymentsDevicesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8306,8 +8248,7 @@ func (c *NodesDevicesCreateCall) Header() http.Header { func (c *NodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -8408,8 +8349,7 @@ func (c *NodesDevicesCreateSignedCall) Header() http.Header { func (c *NodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -8508,12 +8448,11 @@ func (c *NodesDevicesDeleteCall) Header() http.Header { func (c *NodesDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8615,12 +8554,11 @@ func (c *NodesDevicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8748,12 +8686,11 @@ func (c *NodesDevicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8867,8 +8804,7 @@ func (c *NodesDevicesMoveCall) Header() http.Header { func (c *NodesDevicesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest) if err != nil { return nil, err } @@ -8975,8 +8911,7 @@ func (c *NodesDevicesPatchCall) Header() http.Header { func (c *NodesDevicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -9077,8 +9012,7 @@ func (c *NodesDevicesSignDeviceCall) Header() http.Header { func (c *NodesDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsigndevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest) if err != nil { return nil, err } @@ -9178,8 +9112,7 @@ func (c *NodesDevicesUpdateSignedCall) Header() http.Header { func (c *NodesDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalupdatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest) if err != nil { return nil, err } @@ -9280,8 +9213,7 @@ func (c *NodesNodesCreateCall) Header() http.Header { func (c *NodesNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -9379,12 +9311,11 @@ func (c *NodesNodesDeleteCall) Header() http.Header { func (c *NodesNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9486,12 +9417,11 @@ func (c *NodesNodesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9617,12 +9547,11 @@ func (c *NodesNodesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9736,8 +9665,7 @@ func (c *NodesNodesMoveCall) Header() http.Header { func (c *NodesNodesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovenoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovenoderequest) if err != nil { return nil, err } @@ -9844,8 +9772,7 @@ func (c *NodesNodesPatchCall) Header() http.Header { func (c *NodesNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -9945,8 +9872,7 @@ func (c *NodesNodesDeploymentsCreateCall) Header() http.Header { func (c *NodesNodesDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldeployment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment) if err != nil { return nil, err } @@ -10082,12 +10008,11 @@ func (c *NodesNodesDeploymentsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10201,8 +10126,7 @@ func (c *NodesNodesDevicesCreateCall) Header() http.Header { func (c *NodesNodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice) if err != nil { return nil, err } @@ -10303,8 +10227,7 @@ func (c *NodesNodesDevicesCreateSignedCall) Header() http.Header { func (c *NodesNodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest) if err != nil { return nil, err } @@ -10440,12 +10363,11 @@ func (c *NodesNodesDevicesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10559,8 +10481,7 @@ func (c *NodesNodesNodesCreateCall) Header() http.Header { func (c *NodesNodesNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalnode) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode) if err != nil { return nil, err } @@ -10694,12 +10615,11 @@ func (c *NodesNodesNodesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10810,8 +10730,7 @@ func (c *PoliciesGetCall) Header() http.Header { func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalgetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalgetpolicyrequest) if err != nil { return nil, err } @@ -10906,8 +10825,7 @@ func (c *PoliciesSetCall) Header() http.Header { func (c *PoliciesSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsetpolicyrequest) if err != nil { return nil, err } @@ -11001,8 +10919,7 @@ func (c *PoliciesTestCall) Header() http.Header { func (c *PoliciesTestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaltestpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaltestpermissionsrequest) if err != nil { return nil, err } diff --git a/script/v1/script-gen.go b/script/v1/script-gen.go index 89f1e19f142..8f24925c1a9 100644 --- a/script/v1/script-gen.go +++ b/script/v1/script-gen.go @@ -188,7 +188,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Processes = NewProcessesService(s) + s.Projects = NewProjectsService(s) + s.Scripts = NewScriptsService(s) if err != nil { return nil, err } @@ -207,11 +210,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Processes = NewProcessesService(s) - s.Projects = NewProjectsService(s) - s.Scripts = NewScriptsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1612,12 +1611,11 @@ func (c *ProcessesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/processes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1848,12 +1846,11 @@ func (c *ProcessesListScriptProcessesCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/processes:listScriptProcesses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1961,8 +1958,7 @@ func (c *ProjectsCreateCall) Header() http.Header { func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createprojectrequest) if err != nil { return nil, err } @@ -2069,12 +2065,11 @@ func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2185,12 +2180,11 @@ func (c *ProjectsGetContentCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/content") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2317,12 +2311,11 @@ func (c *ProjectsGetMetricsCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/metrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2418,8 +2411,7 @@ func (c *ProjectsUpdateContentCall) Header() http.Header { func (c *ProjectsUpdateContentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.content) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.content) if err != nil { return nil, err } @@ -2519,8 +2511,7 @@ func (c *ProjectsDeploymentsCreateCall) Header() http.Header { func (c *ProjectsDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deploymentconfig) if err != nil { return nil, err } @@ -2621,12 +2612,11 @@ func (c *ProjectsDeploymentsDeleteCall) Header() http.Header { func (c *ProjectsDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2732,12 +2722,11 @@ func (c *ProjectsDeploymentsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2855,12 +2844,11 @@ func (c *ProjectsDeploymentsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2977,8 +2965,7 @@ func (c *ProjectsDeploymentsUpdateCall) Header() http.Header { func (c *ProjectsDeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedeploymentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatedeploymentrequest) if err != nil { return nil, err } @@ -3080,8 +3067,7 @@ func (c *ProjectsVersionsCreateCall) Header() http.Header { func (c *ProjectsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.version) if err != nil { return nil, err } @@ -3194,12 +3180,11 @@ func (c *ProjectsVersionsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions/{versionNumber}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3317,12 +3302,11 @@ func (c *ProjectsVersionsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3450,8 +3434,7 @@ func (c *ScriptsRunCall) Header() http.Header { func (c *ScriptsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executionrequest) if err != nil { return nil, err } diff --git a/searchads360/v0/searchads360-gen.go b/searchads360/v0/searchads360-gen.go index e083e9f4278..684e992bbff 100644 --- a/searchads360/v0/searchads360-gen.go +++ b/searchads360/v0/searchads360-gen.go @@ -114,7 +114,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Customers = NewCustomersService(s) + s.SearchAds360Fields = NewSearchAds360FieldsService(s) if err != nil { return nil, err } @@ -133,10 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Customers = NewCustomersService(s) - s.SearchAds360Fields = NewSearchAds360FieldsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9073,12 +9072,11 @@ func (c *CustomersListAccessibleCustomersCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v0/customers:listAccessibleCustomers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9178,12 +9176,11 @@ func (c *CustomersCustomColumnsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v0/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9288,12 +9285,11 @@ func (c *CustomersCustomColumnsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v0/customers/{+customerId}/customColumns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9388,8 +9384,7 @@ func (c *CustomersSearchAds360SearchCall) Header() http.Header { func (c *CustomersSearchAds360SearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleadssearchads360v0services__searchsearchads360request) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleadssearchads360v0services__searchsearchads360request) if err != nil { return nil, err } @@ -9523,12 +9518,11 @@ func (c *SearchAds360FieldsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v0/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9621,8 +9615,7 @@ func (c *SearchAds360FieldsSearchCall) Header() http.Header { func (c *SearchAds360FieldsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleadssearchads360v0services__searchsearchads360fieldsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleadssearchads360v0services__searchsearchads360fieldsrequest) if err != nil { return nil, err } diff --git a/searchconsole/v1/searchconsole-gen.go b/searchconsole/v1/searchconsole-gen.go index 1249e5abc57..68feb9708ea 100644 --- a/searchconsole/v1/searchconsole-gen.go +++ b/searchconsole/v1/searchconsole-gen.go @@ -123,7 +123,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Searchanalytics = NewSearchanalyticsService(s) + s.Sitemaps = NewSitemapsService(s) + s.Sites = NewSitesService(s) + s.UrlInspection = NewUrlInspectionService(s) + s.UrlTestingTools = NewUrlTestingToolsService(s) if err != nil { return nil, err } @@ -142,13 +147,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Searchanalytics = NewSearchanalyticsService(s) - s.Sitemaps = NewSitemapsService(s) - s.Sites = NewSitesService(s) - s.UrlInspection = NewUrlInspectionService(s) - s.UrlTestingTools = NewUrlTestingToolsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1449,8 +1448,7 @@ func (c *SearchanalyticsQueryCall) Header() http.Header { func (c *SearchanalyticsQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchanalyticsqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchanalyticsqueryrequest) if err != nil { return nil, err } @@ -1556,12 +1554,11 @@ func (c *SitemapsDeleteCall) Header() http.Header { func (c *SitemapsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1646,12 +1643,11 @@ func (c *SitemapsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1764,12 +1760,11 @@ func (c *SitemapsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1865,12 +1860,11 @@ func (c *SitemapsSubmitCall) Header() http.Header { func (c *SitemapsSubmitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, nil) if err != nil { return nil, err } @@ -1938,12 +1932,11 @@ func (c *SitesAddCall) Header() http.Header { func (c *SitesAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, nil) if err != nil { return nil, err } @@ -2011,12 +2004,11 @@ func (c *SitesDeleteCall) Header() http.Header { func (c *SitesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2096,12 +2088,11 @@ func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2199,12 +2190,11 @@ func (c *SitesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2290,8 +2280,7 @@ func (c *UrlInspectionIndexInspectCall) Header() http.Header { func (c *UrlInspectionIndexInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inspecturlindexrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.inspecturlindexrequest) if err != nil { return nil, err } @@ -2385,8 +2374,7 @@ func (c *UrlTestingToolsMobileFriendlyTestRunCall) Header() http.Header { func (c *UrlTestingToolsMobileFriendlyTestRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runmobilefriendlytestrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runmobilefriendlytestrequest) if err != nil { return nil, err } diff --git a/secretmanager/v1/secretmanager-gen.go b/secretmanager/v1/secretmanager-gen.go index 359558a4b16..9c665688d45 100644 --- a/secretmanager/v1/secretmanager-gen.go +++ b/secretmanager/v1/secretmanager-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1448,12 +1447,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1579,12 +1577,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1701,8 +1698,7 @@ func (c *ProjectsLocationsSecretsAddVersionCall) Header() http.Header { func (c *ProjectsLocationsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsecretversionrequest) if err != nil { return nil, err } @@ -1812,8 +1808,7 @@ func (c *ProjectsLocationsSecretsCreateCall) Header() http.Header { func (c *ProjectsLocationsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -1920,12 +1915,11 @@ func (c *ProjectsLocationsSecretsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2028,12 +2022,11 @@ func (c *ProjectsLocationsSecretsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2155,12 +2148,11 @@ func (c *ProjectsLocationsSecretsGetIamPolicyCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2288,12 +2280,11 @@ func (c *ProjectsLocationsSecretsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/secrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2415,8 +2406,7 @@ func (c *ProjectsLocationsSecretsPatchCall) Header() http.Header { func (c *ProjectsLocationsSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -2520,8 +2510,7 @@ func (c *ProjectsLocationsSecretsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2628,8 +2617,7 @@ func (c *ProjectsLocationsSecretsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2747,12 +2735,11 @@ func (c *ProjectsLocationsSecretsVersionsAccessCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2848,8 +2835,7 @@ func (c *ProjectsLocationsSecretsVersionsDestroyCall) Header() http.Header { func (c *ProjectsLocationsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.destroysecretversionrequest) if err != nil { return nil, err } @@ -2952,8 +2938,7 @@ func (c *ProjectsLocationsSecretsVersionsDisableCall) Header() http.Header { func (c *ProjectsLocationsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablesecretversionrequest) if err != nil { return nil, err } @@ -3056,8 +3041,7 @@ func (c *ProjectsLocationsSecretsVersionsEnableCall) Header() http.Header { func (c *ProjectsLocationsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablesecretversionrequest) if err != nil { return nil, err } @@ -3174,12 +3158,11 @@ func (c *ProjectsLocationsSecretsVersionsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3309,12 +3292,11 @@ func (c *ProjectsLocationsSecretsVersionsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3431,8 +3413,7 @@ func (c *ProjectsSecretsAddVersionCall) Header() http.Header { func (c *ProjectsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsecretversionrequest) if err != nil { return nil, err } @@ -3542,8 +3523,7 @@ func (c *ProjectsSecretsCreateCall) Header() http.Header { func (c *ProjectsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -3650,12 +3630,11 @@ func (c *ProjectsSecretsDeleteCall) Header() http.Header { func (c *ProjectsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3758,12 +3737,11 @@ func (c *ProjectsSecretsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3885,12 +3863,11 @@ func (c *ProjectsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4018,12 +3995,11 @@ func (c *ProjectsSecretsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/secrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4145,8 +4121,7 @@ func (c *ProjectsSecretsPatchCall) Header() http.Header { func (c *ProjectsSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -4250,8 +4225,7 @@ func (c *ProjectsSecretsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4358,8 +4332,7 @@ func (c *ProjectsSecretsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4477,12 +4450,11 @@ func (c *ProjectsSecretsVersionsAccessCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4578,8 +4550,7 @@ func (c *ProjectsSecretsVersionsDestroyCall) Header() http.Header { func (c *ProjectsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.destroysecretversionrequest) if err != nil { return nil, err } @@ -4682,8 +4653,7 @@ func (c *ProjectsSecretsVersionsDisableCall) Header() http.Header { func (c *ProjectsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablesecretversionrequest) if err != nil { return nil, err } @@ -4786,8 +4756,7 @@ func (c *ProjectsSecretsVersionsEnableCall) Header() http.Header { func (c *ProjectsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablesecretversionrequest) if err != nil { return nil, err } @@ -4904,12 +4873,11 @@ func (c *ProjectsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5039,12 +5007,11 @@ func (c *ProjectsSecretsVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/secretmanager/v1beta1/secretmanager-gen.go b/secretmanager/v1beta1/secretmanager-gen.go index db561f3ba98..64c9e627d3d 100644 --- a/secretmanager/v1beta1/secretmanager-gen.go +++ b/secretmanager/v1beta1/secretmanager-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1038,12 +1037,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1169,12 +1167,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1290,8 +1287,7 @@ func (c *ProjectsSecretsAddVersionCall) Header() http.Header { func (c *ProjectsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsecretversionrequest) if err != nil { return nil, err } @@ -1401,8 +1397,7 @@ func (c *ProjectsSecretsCreateCall) Header() http.Header { func (c *ProjectsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -1501,12 +1496,11 @@ func (c *ProjectsSecretsDeleteCall) Header() http.Header { func (c *ProjectsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1609,12 +1603,11 @@ func (c *ProjectsSecretsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1736,12 +1729,11 @@ func (c *ProjectsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1860,12 +1852,11 @@ func (c *ProjectsSecretsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/secrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1987,8 +1978,7 @@ func (c *ProjectsSecretsPatchCall) Header() http.Header { func (c *ProjectsSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -2092,8 +2082,7 @@ func (c *ProjectsSecretsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2200,8 +2189,7 @@ func (c *ProjectsSecretsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2315,12 +2303,11 @@ func (c *ProjectsSecretsVersionsAccessCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2415,8 +2402,7 @@ func (c *ProjectsSecretsVersionsDestroyCall) Header() http.Header { func (c *ProjectsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.destroysecretversionrequest) if err != nil { return nil, err } @@ -2518,8 +2504,7 @@ func (c *ProjectsSecretsVersionsDisableCall) Header() http.Header { func (c *ProjectsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablesecretversionrequest) if err != nil { return nil, err } @@ -2621,8 +2606,7 @@ func (c *ProjectsSecretsVersionsEnableCall) Header() http.Header { func (c *ProjectsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablesecretversionrequest) if err != nil { return nil, err } @@ -2736,12 +2720,11 @@ func (c *ProjectsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2860,12 +2843,11 @@ func (c *ProjectsSecretsVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/secretmanager/v1beta2/secretmanager-gen.go b/secretmanager/v1beta2/secretmanager-gen.go index 455a6ed497a..57e2e6e5952 100644 --- a/secretmanager/v1beta2/secretmanager-gen.go +++ b/secretmanager/v1beta2/secretmanager-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1448,12 +1447,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1579,12 +1577,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1701,8 +1698,7 @@ func (c *ProjectsLocationsSecretsAddVersionCall) Header() http.Header { func (c *ProjectsLocationsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsecretversionrequest) if err != nil { return nil, err } @@ -1812,8 +1808,7 @@ func (c *ProjectsLocationsSecretsCreateCall) Header() http.Header { func (c *ProjectsLocationsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -1920,12 +1915,11 @@ func (c *ProjectsLocationsSecretsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2028,12 +2022,11 @@ func (c *ProjectsLocationsSecretsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2155,12 +2148,11 @@ func (c *ProjectsLocationsSecretsGetIamPolicyCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2288,12 +2280,11 @@ func (c *ProjectsLocationsSecretsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/secrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2415,8 +2406,7 @@ func (c *ProjectsLocationsSecretsPatchCall) Header() http.Header { func (c *ProjectsLocationsSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -2520,8 +2510,7 @@ func (c *ProjectsLocationsSecretsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2628,8 +2617,7 @@ func (c *ProjectsLocationsSecretsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsLocationsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2747,12 +2735,11 @@ func (c *ProjectsLocationsSecretsVersionsAccessCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2848,8 +2835,7 @@ func (c *ProjectsLocationsSecretsVersionsDestroyCall) Header() http.Header { func (c *ProjectsLocationsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.destroysecretversionrequest) if err != nil { return nil, err } @@ -2952,8 +2938,7 @@ func (c *ProjectsLocationsSecretsVersionsDisableCall) Header() http.Header { func (c *ProjectsLocationsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablesecretversionrequest) if err != nil { return nil, err } @@ -3056,8 +3041,7 @@ func (c *ProjectsLocationsSecretsVersionsEnableCall) Header() http.Header { func (c *ProjectsLocationsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablesecretversionrequest) if err != nil { return nil, err } @@ -3174,12 +3158,11 @@ func (c *ProjectsLocationsSecretsVersionsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3309,12 +3292,11 @@ func (c *ProjectsLocationsSecretsVersionsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3431,8 +3413,7 @@ func (c *ProjectsSecretsAddVersionCall) Header() http.Header { func (c *ProjectsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsecretversionrequest) if err != nil { return nil, err } @@ -3542,8 +3523,7 @@ func (c *ProjectsSecretsCreateCall) Header() http.Header { func (c *ProjectsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -3650,12 +3630,11 @@ func (c *ProjectsSecretsDeleteCall) Header() http.Header { func (c *ProjectsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3758,12 +3737,11 @@ func (c *ProjectsSecretsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3885,12 +3863,11 @@ func (c *ProjectsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4018,12 +3995,11 @@ func (c *ProjectsSecretsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/secrets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4145,8 +4121,7 @@ func (c *ProjectsSecretsPatchCall) Header() http.Header { func (c *ProjectsSecretsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.secret) if err != nil { return nil, err } @@ -4250,8 +4225,7 @@ func (c *ProjectsSecretsSetIamPolicyCall) Header() http.Header { func (c *ProjectsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4358,8 +4332,7 @@ func (c *ProjectsSecretsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4477,12 +4450,11 @@ func (c *ProjectsSecretsVersionsAccessCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:access") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4578,8 +4550,7 @@ func (c *ProjectsSecretsVersionsDestroyCall) Header() http.Header { func (c *ProjectsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.destroysecretversionrequest) if err != nil { return nil, err } @@ -4682,8 +4653,7 @@ func (c *ProjectsSecretsVersionsDisableCall) Header() http.Header { func (c *ProjectsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablesecretversionrequest) if err != nil { return nil, err } @@ -4786,8 +4756,7 @@ func (c *ProjectsSecretsVersionsEnableCall) Header() http.Header { func (c *ProjectsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablesecretversionrequest) if err != nil { return nil, err } @@ -4904,12 +4873,11 @@ func (c *ProjectsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5039,12 +5007,11 @@ func (c *ProjectsSecretsVersionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/securitycenter/v1/securitycenter-gen.go b/securitycenter/v1/securitycenter-gen.go index 5cbab89809e..31884a7ed9b 100644 --- a/securitycenter/v1/securitycenter-gen.go +++ b/securitycenter/v1/securitycenter-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -12101,8 +12100,7 @@ func (c *FoldersAssetsGroupCall) Header() http.Header { func (c *FoldersAssetsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupassetsrequest) if err != nil { return nil, err } @@ -12353,12 +12351,11 @@ func (c *FoldersAssetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12495,8 +12492,7 @@ func (c *FoldersAssetsUpdateSecurityMarksCall) Header() http.Header { func (c *FoldersAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitymarks) if err != nil { return nil, err } @@ -12608,8 +12604,7 @@ func (c *FoldersBigQueryExportsCreateCall) Header() http.Header { func (c *FoldersBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -12711,12 +12706,11 @@ func (c *FoldersBigQueryExportsDeleteCall) Header() http.Header { func (c *FoldersBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12821,12 +12815,11 @@ func (c *FoldersBigQueryExportsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12953,12 +12946,11 @@ func (c *FoldersBigQueryExportsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13085,8 +13077,7 @@ func (c *FoldersBigQueryExportsPatchCall) Header() http.Header { func (c *FoldersBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -13192,8 +13183,7 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Header() h func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateeventthreatdetectioncustommodulerequest) if err != nil { return nil, err } @@ -13300,8 +13290,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Header() ht func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -13406,12 +13395,11 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Header() ht func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13517,12 +13505,11 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13649,12 +13636,11 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13801,12 +13787,11 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13937,8 +13922,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Header() htt func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -14057,12 +14041,11 @@ func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14189,12 +14172,11 @@ func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14314,8 +14296,7 @@ func (c *FoldersFindingsBulkMuteCall) Header() http.Header { func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkmutefindingsrequest) if err != nil { return nil, err } @@ -14419,12 +14400,11 @@ func (c *FoldersLocationsMuteConfigsDeleteCall) Header() http.Header { func (c *FoldersLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14532,12 +14512,11 @@ func (c *FoldersLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14643,8 +14622,7 @@ func (c *FoldersLocationsMuteConfigsPatchCall) Header() http.Header { func (c *FoldersLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -14757,8 +14735,7 @@ func (c *FoldersMuteConfigsCreateCall) Header() http.Header { func (c *FoldersMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -14863,12 +14840,11 @@ func (c *FoldersMuteConfigsDeleteCall) Header() http.Header { func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14976,12 +14952,11 @@ func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15104,12 +15079,11 @@ func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15236,8 +15210,7 @@ func (c *FoldersMuteConfigsPatchCall) Header() http.Header { func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -15349,8 +15322,7 @@ func (c *FoldersNotificationConfigsCreateCall) Header() http.Header { func (c *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationconfig) if err != nil { return nil, err } @@ -15452,12 +15424,11 @@ func (c *FoldersNotificationConfigsDeleteCall) Header() http.Header { func (c *FoldersNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15562,12 +15533,11 @@ func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15689,12 +15659,11 @@ func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15822,8 +15791,7 @@ func (c *FoldersNotificationConfigsPatchCall) Header() http.Header { func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationconfig) if err != nil { return nil, err } @@ -15930,8 +15898,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -16038,12 +16005,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16151,12 +16117,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16279,12 +16244,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16428,12 +16392,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16567,8 +16530,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -16674,8 +16636,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Header func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.simulatesecurityhealthanalyticscustommodulerequest) if err != nil { return nil, err } @@ -16792,12 +16753,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16920,12 +16880,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17067,12 +17026,11 @@ func (c *FoldersSourcesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17196,8 +17154,7 @@ func (c *FoldersSourcesFindingsGroupCall) Header() http.Header { func (c *FoldersSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupfindingsrequest) if err != nil { return nil, err } @@ -17445,12 +17402,11 @@ func (c *FoldersSourcesFindingsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17581,8 +17537,7 @@ func (c *FoldersSourcesFindingsPatchCall) Header() http.Header { func (c *FoldersSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finding) if err != nil { return nil, err } @@ -17687,8 +17642,7 @@ func (c *FoldersSourcesFindingsSetMuteCall) Header() http.Header { func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmuterequest) if err != nil { return nil, err } @@ -17793,8 +17747,7 @@ func (c *FoldersSourcesFindingsSetStateCall) Header() http.Header { func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setfindingstaterequest) if err != nil { return nil, err } @@ -17917,8 +17870,7 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitymarks) if err != nil { return nil, err } @@ -18029,8 +17981,7 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Header() http.Header { func (c *FoldersSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1externalsystem) if err != nil { return nil, err } @@ -18142,12 +18093,11 @@ func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18250,8 +18200,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.organizationsettings) if err != nil { return nil, err } @@ -18355,8 +18304,7 @@ func (c *OrganizationsAssetsGroupCall) Header() http.Header { func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupassetsrequest) if err != nil { return nil, err } @@ -18607,12 +18555,11 @@ func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18730,8 +18677,7 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetdiscoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runassetdiscoveryrequest) if err != nil { return nil, err } @@ -18854,8 +18800,7 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitymarks) if err != nil { return nil, err } @@ -18997,12 +18942,11 @@ func (c *OrganizationsAttackPathsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19128,8 +19072,7 @@ func (c *OrganizationsBigQueryExportsCreateCall) Header() http.Header { func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -19231,12 +19174,11 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -19341,12 +19283,11 @@ func (c *OrganizationsBigQueryExportsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19473,12 +19414,11 @@ func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19605,8 +19545,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) Header() http.Header { func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -19712,8 +19651,7 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Head func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateeventthreatdetectioncustommodulerequest) if err != nil { return nil, err } @@ -19820,8 +19758,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Heade func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -19926,12 +19863,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Heade func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -20037,12 +19973,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20169,12 +20104,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20321,12 +20255,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCal if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20457,8 +20390,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Header func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -20577,12 +20509,11 @@ func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20709,12 +20640,11 @@ func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -20834,8 +20764,7 @@ func (c *OrganizationsFindingsBulkMuteCall) Header() http.Header { func (c *OrganizationsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkmutefindingsrequest) if err != nil { return nil, err } @@ -20939,12 +20868,11 @@ func (c *OrganizationsLocationsMuteConfigsDeleteCall) Header() http.Header { func (c *OrganizationsLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21052,12 +20980,11 @@ func (c *OrganizationsLocationsMuteConfigsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21163,8 +21090,7 @@ func (c *OrganizationsLocationsMuteConfigsPatchCall) Header() http.Header { func (c *OrganizationsLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -21277,8 +21203,7 @@ func (c *OrganizationsMuteConfigsCreateCall) Header() http.Header { func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -21383,12 +21308,11 @@ func (c *OrganizationsMuteConfigsDeleteCall) Header() http.Header { func (c *OrganizationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -21496,12 +21420,11 @@ func (c *OrganizationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21624,12 +21547,11 @@ func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -21756,8 +21678,7 @@ func (c *OrganizationsMuteConfigsPatchCall) Header() http.Header { func (c *OrganizationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -21869,8 +21790,7 @@ func (c *OrganizationsNotificationConfigsCreateCall) Header() http.Header { func (c *OrganizationsNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationconfig) if err != nil { return nil, err } @@ -21972,12 +21892,11 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Header() http.Header { func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22082,12 +22001,11 @@ func (c *OrganizationsNotificationConfigsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22209,12 +22127,11 @@ func (c *OrganizationsNotificationConfigsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22342,8 +22259,7 @@ func (c *OrganizationsNotificationConfigsPatchCall) Header() http.Header { func (c *OrganizationsNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationconfig) if err != nil { return nil, err } @@ -22450,12 +22366,11 @@ func (c *OrganizationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -22548,12 +22463,11 @@ func (c *OrganizationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -22657,12 +22571,11 @@ func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22785,12 +22698,11 @@ func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -22907,8 +22819,7 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Header() http.Header func (c *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateresourcevalueconfigsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateresourcevalueconfigsrequest) if err != nil { return nil, err } @@ -23007,12 +22918,11 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Header() http.Header { func (c *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23115,12 +23025,11 @@ func (c *OrganizationsResourceValueConfigsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23243,12 +23152,11 @@ func (c *OrganizationsResourceValueConfigsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourceValueConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23369,8 +23277,7 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Header() http.Header { func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1resourcevalueconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1resourcevalueconfig) if err != nil { return nil, err } @@ -23477,8 +23384,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) He func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -23585,12 +23491,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) He func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -23698,12 +23603,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23826,12 +23730,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -23975,12 +23878,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24114,8 +24016,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Hea func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -24221,8 +24122,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.simulatesecurityhealthanalyticscustommodulerequest) if err != nil { return nil, err } @@ -24339,12 +24239,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24467,12 +24366,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24599,12 +24497,11 @@ func (c *OrganizationsSimulationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24738,12 +24635,11 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -24908,12 +24804,11 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25069,12 +24964,11 @@ func (c *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25200,12 +25094,11 @@ func (c *OrganizationsSimulationsValuedResourcesGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25348,12 +25241,11 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25509,12 +25401,11 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25629,8 +25520,7 @@ func (c *OrganizationsSourcesCreateCall) Header() http.Header { func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -25741,12 +25631,11 @@ func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -25840,8 +25729,7 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -25969,12 +25857,11 @@ func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26098,8 +25985,7 @@ func (c *OrganizationsSourcesPatchCall) Header() http.Header { func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -26201,8 +26087,7 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -26306,8 +26191,7 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -26419,8 +26303,7 @@ func (c *OrganizationsSourcesFindingsCreateCall) Header() http.Header { func (c *OrganizationsSourcesFindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finding) if err != nil { return nil, err } @@ -26530,8 +26413,7 @@ func (c *OrganizationsSourcesFindingsGroupCall) Header() http.Header { func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupfindingsrequest) if err != nil { return nil, err } @@ -26779,12 +26661,11 @@ func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -26915,8 +26796,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) Header() http.Header { func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finding) if err != nil { return nil, err } @@ -27021,8 +26901,7 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmuterequest) if err != nil { return nil, err } @@ -27127,8 +27006,7 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setfindingstaterequest) if err != nil { return nil, err } @@ -27251,8 +27129,7 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Head func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitymarks) if err != nil { return nil, err } @@ -27363,8 +27240,7 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Hea func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1externalsystem) if err != nil { return nil, err } @@ -27516,12 +27392,11 @@ func (c *OrganizationsValuedResourcesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -27638,8 +27513,7 @@ func (c *ProjectsAssetsGroupCall) Header() http.Header { func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupassetsrequest) if err != nil { return nil, err } @@ -27890,12 +27764,11 @@ func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28032,8 +27905,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitymarks) if err != nil { return nil, err } @@ -28145,8 +28017,7 @@ func (c *ProjectsBigQueryExportsCreateCall) Header() http.Header { func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -28248,12 +28119,11 @@ func (c *ProjectsBigQueryExportsDeleteCall) Header() http.Header { func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -28358,12 +28228,11 @@ func (c *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28490,12 +28359,11 @@ func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -28622,8 +28490,7 @@ func (c *ProjectsBigQueryExportsPatchCall) Header() http.Header { func (c *ProjectsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -28729,8 +28596,7 @@ func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Header() func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateeventthreatdetectioncustommodulerequest) if err != nil { return nil, err } @@ -28837,8 +28703,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Header() h func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -28943,12 +28808,11 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Header() h func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -29054,12 +28918,11 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29186,12 +29049,11 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29338,12 +29200,11 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) do if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29474,8 +29335,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Header() ht func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -29594,12 +29454,11 @@ func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) doRe if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29726,12 +29585,11 @@ func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) doR if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -29851,8 +29709,7 @@ func (c *ProjectsFindingsBulkMuteCall) Header() http.Header { func (c *ProjectsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkmutefindingsrequest) if err != nil { return nil, err } @@ -29956,12 +29813,11 @@ func (c *ProjectsLocationsMuteConfigsDeleteCall) Header() http.Header { func (c *ProjectsLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30069,12 +29925,11 @@ func (c *ProjectsLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30180,8 +30035,7 @@ func (c *ProjectsLocationsMuteConfigsPatchCall) Header() http.Header { func (c *ProjectsLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -30294,8 +30148,7 @@ func (c *ProjectsMuteConfigsCreateCall) Header() http.Header { func (c *ProjectsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -30400,12 +30253,11 @@ func (c *ProjectsMuteConfigsDeleteCall) Header() http.Header { func (c *ProjectsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -30513,12 +30365,11 @@ func (c *ProjectsMuteConfigsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30641,12 +30492,11 @@ func (c *ProjectsMuteConfigsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -30773,8 +30623,7 @@ func (c *ProjectsMuteConfigsPatchCall) Header() http.Header { func (c *ProjectsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -30886,8 +30735,7 @@ func (c *ProjectsNotificationConfigsCreateCall) Header() http.Header { func (c *ProjectsNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationconfig) if err != nil { return nil, err } @@ -30989,12 +30837,11 @@ func (c *ProjectsNotificationConfigsDeleteCall) Header() http.Header { func (c *ProjectsNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31099,12 +30946,11 @@ func (c *ProjectsNotificationConfigsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31226,12 +31072,11 @@ func (c *ProjectsNotificationConfigsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31359,8 +31204,7 @@ func (c *ProjectsNotificationConfigsPatchCall) Header() http.Header { func (c *ProjectsNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notificationconfig) if err != nil { return nil, err } @@ -31467,8 +31311,7 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header( func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -31575,12 +31418,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header( func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -31688,12 +31530,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31816,12 +31657,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -31965,12 +31805,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32104,8 +31943,7 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -32211,8 +32049,7 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Heade func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.simulatesecurityhealthanalyticscustommodulerequest) if err != nil { return nil, err } @@ -32329,12 +32166,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32457,12 +32293,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32604,12 +32439,11 @@ func (c *ProjectsSourcesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -32733,8 +32567,7 @@ func (c *ProjectsSourcesFindingsGroupCall) Header() http.Header { func (c *ProjectsSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupfindingsrequest) if err != nil { return nil, err } @@ -32982,12 +32815,11 @@ func (c *ProjectsSourcesFindingsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -33118,8 +32950,7 @@ func (c *ProjectsSourcesFindingsPatchCall) Header() http.Header { func (c *ProjectsSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finding) if err != nil { return nil, err } @@ -33224,8 +33055,7 @@ func (c *ProjectsSourcesFindingsSetMuteCall) Header() http.Header { func (c *ProjectsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setmuterequest) if err != nil { return nil, err } @@ -33330,8 +33160,7 @@ func (c *ProjectsSourcesFindingsSetStateCall) Header() http.Header { func (c *ProjectsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setfindingstaterequest) if err != nil { return nil, err } @@ -33454,8 +33283,7 @@ func (c *ProjectsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { func (c *ProjectsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securitymarks) if err != nil { return nil, err } @@ -33566,8 +33394,7 @@ func (c *ProjectsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { func (c *ProjectsSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1externalsystem) if err != nil { return nil, err } diff --git a/securitycenter/v1beta1/securitycenter-gen.go b/securitycenter/v1beta1/securitycenter-gen.go index 21bcfcb265c..05865727f86 100644 --- a/securitycenter/v1beta1/securitycenter-gen.go +++ b/securitycenter/v1beta1/securitycenter-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Organizations = NewOrganizationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9928,12 +9927,11 @@ func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10035,8 +10033,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.organizationsettings) if err != nil { return nil, err } @@ -10139,8 +10136,7 @@ func (c *OrganizationsAssetsGroupCall) Header() http.Header { func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupassetsrequest) if err != nil { return nil, err } @@ -10359,12 +10355,11 @@ func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10482,8 +10477,7 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetdiscoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runassetdiscoveryrequest) if err != nil { return nil, err } @@ -10602,8 +10596,7 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1beta1securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1beta1securitymarks) if err != nil { return nil, err } @@ -10712,8 +10705,7 @@ func (c *OrganizationsOperationsCancelCall) Header() http.Header { func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -10814,12 +10806,11 @@ func (c *OrganizationsOperationsDeleteCall) Header() http.Header { func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10923,12 +10914,11 @@ func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11051,12 +11041,11 @@ func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11171,8 +11160,7 @@ func (c *OrganizationsSourcesCreateCall) Header() http.Header { func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -11283,12 +11271,11 @@ func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11382,8 +11369,7 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -11510,12 +11496,11 @@ func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11638,8 +11623,7 @@ func (c *OrganizationsSourcesPatchCall) Header() http.Header { func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -11741,8 +11725,7 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11846,8 +11829,7 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11959,8 +11941,7 @@ func (c *OrganizationsSourcesFindingsCreateCall) Header() http.Header { func (c *OrganizationsSourcesFindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1beta1finding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1beta1finding) if err != nil { return nil, err } @@ -12067,8 +12048,7 @@ func (c *OrganizationsSourcesFindingsGroupCall) Header() http.Header { func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupfindingsrequest) if err != nil { return nil, err } @@ -12270,12 +12250,11 @@ func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12401,8 +12380,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) Header() http.Header { func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1beta1finding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1beta1finding) if err != nil { return nil, err } @@ -12506,8 +12484,7 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setfindingstaterequest) if err != nil { return nil, err } @@ -12627,8 +12604,7 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Head func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1beta1securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudsecuritycenterv1beta1securitymarks) if err != nil { return nil, err } diff --git a/securitycenter/v1beta2/securitycenter-gen.go b/securitycenter/v1beta2/securitycenter-gen.go index c5e2086337d..c4a51a440b0 100644 --- a/securitycenter/v1beta2/securitycenter-gen.go +++ b/securitycenter/v1beta2/securitycenter-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Folders = NewFoldersService(s) + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Folders = NewFoldersService(s) - s.Organizations = NewOrganizationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9494,12 +9493,11 @@ func (c *FoldersGetContainerThreatDetectionSettingsCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9611,12 +9609,11 @@ func (c *FoldersGetEventThreatDetectionSettingsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9730,12 +9727,11 @@ func (c *FoldersGetRapidVulnerabilityDetectionSettingsCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9841,12 +9837,11 @@ func (c *FoldersGetSecurityCenterSettingsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9958,12 +9953,11 @@ func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10077,12 +10071,11 @@ func (c *FoldersGetVirtualMachineThreatDetectionSettingsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10194,12 +10187,11 @@ func (c *FoldersGetWebSecurityScannerSettingsCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10306,8 +10298,7 @@ func (c *FoldersUpdateContainerThreatDetectionSettingsCall) Header() http.Header func (c *FoldersUpdateContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.containerthreatdetectionsettings) if err != nil { return nil, err } @@ -10419,8 +10410,7 @@ func (c *FoldersUpdateEventThreatDetectionSettingsCall) Header() http.Header { func (c *FoldersUpdateEventThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectionsettings) if err != nil { return nil, err } @@ -10533,8 +10523,7 @@ func (c *FoldersUpdateRapidVulnerabilityDetectionSettingsCall) Header() http.Hea func (c *FoldersUpdateRapidVulnerabilityDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rapidvulnerabilitydetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rapidvulnerabilitydetectionsettings) if err != nil { return nil, err } @@ -10647,8 +10636,7 @@ func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) Header() http.Header func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityhealthanalyticssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityhealthanalyticssettings) if err != nil { return nil, err } @@ -10761,8 +10749,7 @@ func (c *FoldersUpdateVirtualMachineThreatDetectionSettingsCall) Header() http.H func (c *FoldersUpdateVirtualMachineThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.virtualmachinethreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.virtualmachinethreatdetectionsettings) if err != nil { return nil, err } @@ -10874,8 +10861,7 @@ func (c *FoldersUpdateWebSecurityScannerSettingsCall) Header() http.Header { func (c *FoldersUpdateWebSecurityScannerSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.websecurityscannersettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.websecurityscannersettings) if err != nil { return nil, err } @@ -11005,12 +10991,11 @@ func (c *FoldersContainerThreatDetectionSettingsCalculateCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11130,12 +11115,11 @@ func (c *FoldersEventThreatDetectionSettingsCalculateCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11248,12 +11232,11 @@ func (c *FoldersRapidVulnerabilityDetectionSettingsCalculateCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11373,12 +11356,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11499,12 +11481,11 @@ func (c *FoldersVirtualMachineThreatDetectionSettingsCalculateCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11624,12 +11605,11 @@ func (c *FoldersWebSecurityScannerSettingsCalculateCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11744,12 +11724,11 @@ func (c *OrganizationsGetContainerThreatDetectionSettingsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11861,12 +11840,11 @@ func (c *OrganizationsGetEventThreatDetectionSettingsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11980,12 +11958,11 @@ func (c *OrganizationsGetRapidVulnerabilityDetectionSettingsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12091,12 +12068,11 @@ func (c *OrganizationsGetSecurityCenterSettingsCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12208,12 +12184,11 @@ func (c *OrganizationsGetSecurityHealthAnalyticsSettingsCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12317,12 +12292,11 @@ func (c *OrganizationsGetSubscriptionCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12435,12 +12409,11 @@ func (c *OrganizationsGetVirtualMachineThreatDetectionSettingsCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12552,12 +12525,11 @@ func (c *OrganizationsGetWebSecurityScannerSettingsCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12664,8 +12636,7 @@ func (c *OrganizationsUpdateContainerThreatDetectionSettingsCall) Header() http. func (c *OrganizationsUpdateContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.containerthreatdetectionsettings) if err != nil { return nil, err } @@ -12777,8 +12748,7 @@ func (c *OrganizationsUpdateEventThreatDetectionSettingsCall) Header() http.Head func (c *OrganizationsUpdateEventThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectionsettings) if err != nil { return nil, err } @@ -12891,8 +12861,7 @@ func (c *OrganizationsUpdateRapidVulnerabilityDetectionSettingsCall) Header() ht func (c *OrganizationsUpdateRapidVulnerabilityDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rapidvulnerabilitydetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rapidvulnerabilitydetectionsettings) if err != nil { return nil, err } @@ -13005,8 +12974,7 @@ func (c *OrganizationsUpdateSecurityHealthAnalyticsSettingsCall) Header() http.H func (c *OrganizationsUpdateSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityhealthanalyticssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityhealthanalyticssettings) if err != nil { return nil, err } @@ -13119,8 +13087,7 @@ func (c *OrganizationsUpdateVirtualMachineThreatDetectionSettingsCall) Header() func (c *OrganizationsUpdateVirtualMachineThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.virtualmachinethreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.virtualmachinethreatdetectionsettings) if err != nil { return nil, err } @@ -13232,8 +13199,7 @@ func (c *OrganizationsUpdateWebSecurityScannerSettingsCall) Header() http.Header func (c *OrganizationsUpdateWebSecurityScannerSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.websecurityscannersettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.websecurityscannersettings) if err != nil { return nil, err } @@ -13363,12 +13329,11 @@ func (c *OrganizationsContainerThreatDetectionSettingsCalculateCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13488,12 +13453,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCalculateCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13606,12 +13570,11 @@ func (c *OrganizationsRapidVulnerabilityDetectionSettingsCalculateCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13731,12 +13694,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCalculateCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13857,12 +13819,11 @@ func (c *OrganizationsVirtualMachineThreatDetectionSettingsCalculateCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13982,12 +13943,11 @@ func (c *OrganizationsWebSecurityScannerSettingsCalculateCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14102,12 +14062,11 @@ func (c *ProjectsGetContainerThreatDetectionSettingsCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14219,12 +14178,11 @@ func (c *ProjectsGetEventThreatDetectionSettingsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14338,12 +14296,11 @@ func (c *ProjectsGetRapidVulnerabilityDetectionSettingsCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14449,12 +14406,11 @@ func (c *ProjectsGetSecurityCenterSettingsCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14566,12 +14522,11 @@ func (c *ProjectsGetSecurityHealthAnalyticsSettingsCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14685,12 +14640,11 @@ func (c *ProjectsGetVirtualMachineThreatDetectionSettingsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14802,12 +14756,11 @@ func (c *ProjectsGetWebSecurityScannerSettingsCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14914,8 +14867,7 @@ func (c *ProjectsUpdateContainerThreatDetectionSettingsCall) Header() http.Heade func (c *ProjectsUpdateContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.containerthreatdetectionsettings) if err != nil { return nil, err } @@ -15027,8 +14979,7 @@ func (c *ProjectsUpdateEventThreatDetectionSettingsCall) Header() http.Header { func (c *ProjectsUpdateEventThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventthreatdetectionsettings) if err != nil { return nil, err } @@ -15141,8 +15092,7 @@ func (c *ProjectsUpdateRapidVulnerabilityDetectionSettingsCall) Header() http.He func (c *ProjectsUpdateRapidVulnerabilityDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rapidvulnerabilitydetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rapidvulnerabilitydetectionsettings) if err != nil { return nil, err } @@ -15255,8 +15205,7 @@ func (c *ProjectsUpdateSecurityHealthAnalyticsSettingsCall) Header() http.Header func (c *ProjectsUpdateSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityhealthanalyticssettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.securityhealthanalyticssettings) if err != nil { return nil, err } @@ -15369,8 +15318,7 @@ func (c *ProjectsUpdateVirtualMachineThreatDetectionSettingsCall) Header() http. func (c *ProjectsUpdateVirtualMachineThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.virtualmachinethreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.virtualmachinethreatdetectionsettings) if err != nil { return nil, err } @@ -15482,8 +15430,7 @@ func (c *ProjectsUpdateWebSecurityScannerSettingsCall) Header() http.Header { func (c *ProjectsUpdateWebSecurityScannerSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.websecurityscannersettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.websecurityscannersettings) if err != nil { return nil, err } @@ -15613,12 +15560,11 @@ func (c *ProjectsContainerThreatDetectionSettingsCalculateCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15738,12 +15684,11 @@ func (c *ProjectsEventThreatDetectionSettingsCalculateCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15858,12 +15803,11 @@ func (c *ProjectsLocationsClustersGetContainerThreatDetectionSettingsCall) doReq if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15970,8 +15914,7 @@ func (c *ProjectsLocationsClustersUpdateContainerThreatDetectionSettingsCall) He func (c *ProjectsLocationsClustersUpdateContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerthreatdetectionsettings) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.containerthreatdetectionsettings) if err != nil { return nil, err } @@ -16101,12 +16044,11 @@ func (c *ProjectsLocationsClustersContainerThreatDetectionSettingsCalculateCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16219,12 +16161,11 @@ func (c *ProjectsRapidVulnerabilityDetectionSettingsCalculateCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16344,12 +16285,11 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCalculateCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16470,12 +16410,11 @@ func (c *ProjectsVirtualMachineThreatDetectionSettingsCalculateCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16595,12 +16534,11 @@ func (c *ProjectsWebSecurityScannerSettingsCalculateCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go index 81f8cf22be5..180ae7debfa 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -4343,8 +4342,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4445,12 +4443,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4554,12 +4551,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4682,12 +4678,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4847,12 +4842,11 @@ func (c *ServicesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4971,8 +4965,7 @@ func (c *ServicesTenancyUnitsAddProjectCall) Header() http.Header { func (c *ServicesTenancyUnitsAddProjectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addtenantprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addtenantprojectrequest) if err != nil { return nil, err } @@ -5086,8 +5079,7 @@ func (c *ServicesTenancyUnitsApplyProjectConfigCall) Header() http.Header { func (c *ServicesTenancyUnitsApplyProjectConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.applytenantprojectconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.applytenantprojectconfigrequest) if err != nil { return nil, err } @@ -5196,8 +5188,7 @@ func (c *ServicesTenancyUnitsAttachProjectCall) Header() http.Header { func (c *ServicesTenancyUnitsAttachProjectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attachtenantprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attachtenantprojectrequest) if err != nil { return nil, err } @@ -5305,8 +5296,7 @@ func (c *ServicesTenancyUnitsCreateCall) Header() http.Header { func (c *ServicesTenancyUnitsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtenancyunitrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createtenancyunitrequest) if err != nil { return nil, err } @@ -5406,12 +5396,11 @@ func (c *ServicesTenancyUnitsDeleteCall) Header() http.Header { func (c *ServicesTenancyUnitsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5511,8 +5500,7 @@ func (c *ServicesTenancyUnitsDeleteProjectCall) Header() http.Header { func (c *ServicesTenancyUnitsDeleteProjectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deletetenantprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deletetenantprojectrequest) if err != nil { return nil, err } @@ -5653,12 +5641,11 @@ func (c *ServicesTenancyUnitsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tenancyUnits") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5779,8 +5766,7 @@ func (c *ServicesTenancyUnitsRemoveProjectCall) Header() http.Header { func (c *ServicesTenancyUnitsRemoveProjectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removetenantprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removetenantprojectrequest) if err != nil { return nil, err } @@ -5885,8 +5871,7 @@ func (c *ServicesTenancyUnitsUndeleteProjectCall) Header() http.Header { func (c *ServicesTenancyUnitsUndeleteProjectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletetenantprojectrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletetenantprojectrequest) if err != nil { return nil, err } diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go index 0f0b9c7ecef..9703b869bc0 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go @@ -115,7 +115,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -134,10 +136,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -4271,12 +4270,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4403,12 +4401,11 @@ func (c *ServicesConsumerQuotaMetricsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4504,8 +4501,7 @@ func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) Header() http. func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1importproduceroverridesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v1beta1importproduceroverridesrequest) if err != nil { return nil, err } @@ -4608,8 +4604,7 @@ func (c *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) Header() h func (c *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1importproducerquotapoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v1beta1importproducerquotapoliciesrequest) if err != nil { return nil, err } @@ -4761,12 +4756,11 @@ func (c *ServicesConsumerQuotaMetricsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4916,12 +4910,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5064,8 +5057,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) Header() func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1quotaoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v1beta1quotaoverride) if err != nil { return nil, err } @@ -5207,12 +5199,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) Header() func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5332,12 +5323,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerOverrides") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5502,8 +5492,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Header() func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1quotaoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v1beta1quotaoverride) if err != nil { return nil, err } @@ -5638,8 +5627,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) Head func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1producerquotapolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v1beta1producerquotapolicy) if err != nil { return nil, err } @@ -5765,12 +5753,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) Head func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5890,12 +5877,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerQuotaPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6044,8 +6030,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) Heade func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1producerquotapolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.v1beta1producerquotapolicy) if err != nil { return nil, err } diff --git a/servicecontrol/v1/servicecontrol-gen.go b/servicecontrol/v1/servicecontrol-gen.go index 0409cad7805..4a129435515 100644 --- a/servicecontrol/v1/servicecontrol-gen.go +++ b/servicecontrol/v1/servicecontrol-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2857,8 +2856,7 @@ func (c *ServicesAllocateQuotaCall) Header() http.Header { func (c *ServicesAllocateQuotaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocatequotarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.allocatequotarequest) if err != nil { return nil, err } @@ -2972,8 +2970,7 @@ func (c *ServicesCheckCall) Header() http.Header { func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkrequest) if err != nil { return nil, err } @@ -3085,8 +3082,7 @@ func (c *ServicesReportCall) Header() http.Header { func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportrequest) if err != nil { return nil, err } diff --git a/servicecontrol/v2/servicecontrol-gen.go b/servicecontrol/v2/servicecontrol-gen.go index 8d5172c2784..0a5439927ae 100644 --- a/servicecontrol/v2/servicecontrol-gen.go +++ b/servicecontrol/v2/servicecontrol-gen.go @@ -124,7 +124,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -143,9 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1598,8 +1597,7 @@ func (c *ServicesCheckCall) Header() http.Header { func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkrequest) if err != nil { return nil, err } @@ -1714,8 +1712,7 @@ func (c *ServicesReportCall) Header() http.Header { func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reportrequest) if err != nil { return nil, err } diff --git a/servicedirectory/v1/servicedirectory-gen.go b/servicedirectory/v1/servicedirectory-gen.go index 77f027c8acc..475f1d3fdf3 100644 --- a/servicedirectory/v1/servicedirectory-gen.go +++ b/servicedirectory/v1/servicedirectory-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -1010,12 +1009,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1141,12 +1139,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1273,8 +1270,7 @@ func (c *ProjectsLocationsNamespacesCreateCall) Header() http.Header { func (c *ProjectsLocationsNamespacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -1373,12 +1369,11 @@ func (c *ProjectsLocationsNamespacesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNamespacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1480,12 +1475,11 @@ func (c *ProjectsLocationsNamespacesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1580,8 +1574,7 @@ func (c *ProjectsLocationsNamespacesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNamespacesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1737,12 +1730,11 @@ func (c *ProjectsLocationsNamespacesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/namespaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1864,8 +1856,7 @@ func (c *ProjectsLocationsNamespacesPatchCall) Header() http.Header { func (c *ProjectsLocationsNamespacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -1968,8 +1959,7 @@ func (c *ProjectsLocationsNamespacesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNamespacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2073,8 +2063,7 @@ func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2186,8 +2175,7 @@ func (c *ProjectsLocationsNamespacesServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -2286,12 +2274,11 @@ func (c *ProjectsLocationsNamespacesServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2393,12 +2380,11 @@ func (c *ProjectsLocationsNamespacesServicesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2493,8 +2479,7 @@ func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2652,12 +2637,11 @@ func (c *ProjectsLocationsNamespacesServicesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2779,8 +2763,7 @@ func (c *ProjectsLocationsNamespacesServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -2881,8 +2864,7 @@ func (c *ProjectsLocationsNamespacesServicesResolveCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesResolveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resolveservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resolveservicerequest) if err != nil { return nil, err } @@ -2986,8 +2968,7 @@ func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3091,8 +3072,7 @@ func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3204,8 +3184,7 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) Header() http.H func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } @@ -3303,12 +3282,11 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) Header() http.H func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3410,12 +3388,11 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3567,12 +3544,11 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3694,8 +3670,7 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Header() http.He func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } diff --git a/servicedirectory/v1beta1/servicedirectory-gen.go b/servicedirectory/v1beta1/servicedirectory-gen.go index f2ff34d40ba..2329bcf47be 100644 --- a/servicedirectory/v1beta1/servicedirectory-gen.go +++ b/servicedirectory/v1beta1/servicedirectory-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -1034,12 +1033,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1165,12 +1163,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1297,8 +1294,7 @@ func (c *ProjectsLocationsNamespacesCreateCall) Header() http.Header { func (c *ProjectsLocationsNamespacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -1397,12 +1393,11 @@ func (c *ProjectsLocationsNamespacesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNamespacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1504,12 +1499,11 @@ func (c *ProjectsLocationsNamespacesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1603,8 +1597,7 @@ func (c *ProjectsLocationsNamespacesGetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNamespacesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -1762,12 +1755,11 @@ func (c *ProjectsLocationsNamespacesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/namespaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1889,8 +1881,7 @@ func (c *ProjectsLocationsNamespacesPatchCall) Header() http.Header { func (c *ProjectsLocationsNamespacesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.namespace) if err != nil { return nil, err } @@ -1992,8 +1983,7 @@ func (c *ProjectsLocationsNamespacesSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsNamespacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -2097,8 +2087,7 @@ func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Header() http.Header func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -2210,8 +2199,7 @@ func (c *ProjectsLocationsNamespacesServicesCreateCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -2310,12 +2298,11 @@ func (c *ProjectsLocationsNamespacesServicesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2417,12 +2404,11 @@ func (c *ProjectsLocationsNamespacesServicesGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2516,8 +2502,7 @@ func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -2675,12 +2660,11 @@ func (c *ProjectsLocationsNamespacesServicesListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2802,8 +2786,7 @@ func (c *ProjectsLocationsNamespacesServicesPatchCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -2904,8 +2887,7 @@ func (c *ProjectsLocationsNamespacesServicesResolveCall) Header() http.Header { func (c *ProjectsLocationsNamespacesServicesResolveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resolveservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resolveservicerequest) if err != nil { return nil, err } @@ -3008,8 +2990,7 @@ func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) Header() http.Head func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -3113,8 +3094,7 @@ func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Header() htt func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -3226,8 +3206,7 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) Header() http.H func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } @@ -3325,12 +3304,11 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) Header() http.H func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3432,12 +3410,11 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3591,12 +3568,11 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpoints") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3718,8 +3694,7 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Header() http.He func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpoint) if err != nil { return nil, err } @@ -3821,8 +3796,7 @@ func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -3924,8 +3898,7 @@ func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Header() http.Hea func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4029,8 +4002,7 @@ func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Header() ht func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/servicemanagement/v1/servicemanagement-gen.go b/servicemanagement/v1/servicemanagement-gen.go index 760bb9a05f8..8db8446a872 100644 --- a/servicemanagement/v1/servicemanagement-gen.go +++ b/servicemanagement/v1/servicemanagement-gen.go @@ -133,7 +133,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -152,10 +154,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -4649,12 +4648,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4792,12 +4790,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4908,8 +4905,7 @@ func (c *ServicesCreateCall) Header() http.Header { func (c *ServicesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedservice) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedservice) if err != nil { return nil, err } @@ -5009,12 +5005,11 @@ func (c *ServicesDeleteCall) Header() http.Header { func (c *ServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5111,8 +5106,7 @@ func (c *ServicesGenerateConfigReportCall) Header() http.Header { func (c *ServicesGenerateConfigReportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateconfigreportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateconfigreportrequest) if err != nil { return nil, err } @@ -5222,12 +5216,11 @@ func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5354,12 +5347,11 @@ func (c *ServicesGetConfigCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/config") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5454,8 +5446,7 @@ func (c *ServicesGetIamPolicyCall) Header() http.Header { func (c *ServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -5593,12 +5584,11 @@ func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5713,8 +5703,7 @@ func (c *ServicesSetIamPolicyCall) Header() http.Header { func (c *ServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5821,8 +5810,7 @@ func (c *ServicesTestIamPermissionsCall) Header() http.Header { func (c *ServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -5926,12 +5914,11 @@ func (c *ServicesUndeleteCall) Header() http.Header { func (c *ServicesUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6029,8 +6016,7 @@ func (c *ServicesConfigsCreateCall) Header() http.Header { func (c *ServicesConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.service) if err != nil { return nil, err } @@ -6161,12 +6147,11 @@ func (c *ServicesConfigsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs/{configId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6287,12 +6272,11 @@ func (c *ServicesConfigsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6414,8 +6398,7 @@ func (c *ServicesConfigsSubmitCall) Header() http.Header { func (c *ServicesConfigsSubmitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitconfigsourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.submitconfigsourcerequest) if err != nil { return nil, err } @@ -6518,8 +6501,7 @@ func (c *ServicesConsumersGetIamPolicyCall) Header() http.Header { func (c *ServicesConsumersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -6623,8 +6605,7 @@ func (c *ServicesConsumersSetIamPolicyCall) Header() http.Header { func (c *ServicesConsumersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -6731,8 +6712,7 @@ func (c *ServicesConsumersTestIamPermissionsCall) Header() http.Header { func (c *ServicesConsumersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -6843,8 +6823,7 @@ func (c *ServicesRolloutsCreateCall) Header() http.Header { func (c *ServicesRolloutsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollout) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollout) if err != nil { return nil, err } @@ -6959,12 +6938,11 @@ func (c *ServicesRolloutsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts/{rolloutId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7094,12 +7072,11 @@ func (c *ServicesRolloutsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/servicenetworking/v1/servicenetworking-gen.go b/servicenetworking/v1/servicenetworking-gen.go index ba0f9a2c528..fa5c80c9b5c 100644 --- a/servicenetworking/v1/servicenetworking-gen.go +++ b/servicenetworking/v1/servicenetworking-gen.go @@ -124,7 +124,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -143,10 +145,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -4978,8 +4977,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5080,12 +5078,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5189,12 +5186,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5317,12 +5313,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5449,8 +5444,7 @@ func (c *ServicesAddSubnetworkCall) Header() http.Header { func (c *ServicesAddSubnetworkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsubnetworkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsubnetworkrequest) if err != nil { return nil, err } @@ -5552,8 +5546,7 @@ func (c *ServicesDisableVpcServiceControlsCall) Header() http.Header { func (c *ServicesDisableVpcServiceControlsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablevpcservicecontrolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disablevpcservicecontrolsrequest) if err != nil { return nil, err } @@ -5655,8 +5648,7 @@ func (c *ServicesEnableVpcServiceControlsCall) Header() http.Header { func (c *ServicesEnableVpcServiceControlsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablevpcservicecontrolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enablevpcservicecontrolsrequest) if err != nil { return nil, err } @@ -5763,8 +5755,7 @@ func (c *ServicesSearchRangeCall) Header() http.Header { func (c *ServicesSearchRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchrangerequest) if err != nil { return nil, err } @@ -5869,8 +5860,7 @@ func (c *ServicesValidateCall) Header() http.Header { func (c *ServicesValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateconsumerconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.validateconsumerconfigrequest) if err != nil { return nil, err } @@ -5979,8 +5969,7 @@ func (c *ServicesConnectionsCreateCall) Header() http.Header { func (c *ServicesConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -6086,8 +6075,7 @@ func (c *ServicesConnectionsDeleteConnectionCall) Header() http.Header { func (c *ServicesConnectionsDeleteConnectionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deleteconnectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deleteconnectionrequest) if err != nil { return nil, err } @@ -6213,12 +6201,11 @@ func (c *ServicesConnectionsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6332,8 +6319,7 @@ func (c *ServicesConnectionsPatchCall) Header() http.Header { func (c *ServicesConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connection) if err != nil { return nil, err } @@ -6436,8 +6422,7 @@ func (c *ServicesDnsRecordSetsAddCall) Header() http.Header { func (c *ServicesDnsRecordSetsAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adddnsrecordsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adddnsrecordsetrequest) if err != nil { return nil, err } @@ -6580,12 +6565,11 @@ func (c *ServicesDnsRecordSetsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsRecordSets:get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6708,12 +6692,11 @@ func (c *ServicesDnsRecordSetsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsRecordSets:list") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6809,8 +6792,7 @@ func (c *ServicesDnsRecordSetsRemoveCall) Header() http.Header { func (c *ServicesDnsRecordSetsRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removednsrecordsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removednsrecordsetrequest) if err != nil { return nil, err } @@ -6913,8 +6895,7 @@ func (c *ServicesDnsRecordSetsUpdateCall) Header() http.Header { func (c *ServicesDnsRecordSetsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatednsrecordsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatednsrecordsetrequest) if err != nil { return nil, err } @@ -7018,8 +6999,7 @@ func (c *ServicesDnsZonesAddCall) Header() http.Header { func (c *ServicesDnsZonesAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adddnszonerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adddnszonerequest) if err != nil { return nil, err } @@ -7123,8 +7103,7 @@ func (c *ServicesDnsZonesRemoveCall) Header() http.Header { func (c *ServicesDnsZonesRemoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removednszonerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removednszonerequest) if err != nil { return nil, err } @@ -7252,12 +7231,11 @@ func (c *ServicesProjectsGlobalNetworksGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7367,12 +7345,11 @@ func (c *ServicesProjectsGlobalNetworksGetVpcServiceControlsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/vpcServiceControls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7475,8 +7452,7 @@ func (c *ServicesProjectsGlobalNetworksUpdateConsumerConfigCall) Header() http.H func (c *ServicesProjectsGlobalNetworksUpdateConsumerConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateconsumerconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateconsumerconfigrequest) if err != nil { return nil, err } @@ -7594,12 +7570,11 @@ func (c *ServicesProjectsGlobalNetworksDnsZonesGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7711,12 +7686,11 @@ func (c *ServicesProjectsGlobalNetworksDnsZonesListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsZones:list") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7819,8 +7793,7 @@ func (c *ServicesProjectsGlobalNetworksPeeredDnsDomainsCreateCall) Header() http func (c *ServicesProjectsGlobalNetworksPeeredDnsDomainsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.peereddnsdomain) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.peereddnsdomain) if err != nil { return nil, err } @@ -7926,12 +7899,11 @@ func (c *ServicesProjectsGlobalNetworksPeeredDnsDomainsDeleteCall) Header() http func (c *ServicesProjectsGlobalNetworksPeeredDnsDomainsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8040,12 +8012,11 @@ func (c *ServicesProjectsGlobalNetworksPeeredDnsDomainsListCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/peeredDnsDomains") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8143,8 +8114,7 @@ func (c *ServicesRolesAddCall) Header() http.Header { func (c *ServicesRolesAddCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addrolesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addrolesrequest) if err != nil { return nil, err } diff --git a/servicenetworking/v1beta/servicenetworking-gen.go b/servicenetworking/v1beta/servicenetworking-gen.go index 2ecc7563468..c8f012aab0d 100644 --- a/servicenetworking/v1beta/servicenetworking-gen.go +++ b/servicenetworking/v1beta/servicenetworking-gen.go @@ -124,7 +124,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -143,10 +145,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -4123,12 +4122,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4234,8 +4232,7 @@ func (c *ServicesAddSubnetworkCall) Header() http.Header { func (c *ServicesAddSubnetworkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsubnetworkrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addsubnetworkrequest) if err != nil { return nil, err } @@ -4342,8 +4339,7 @@ func (c *ServicesSearchRangeCall) Header() http.Header { func (c *ServicesSearchRangeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrangerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchrangerequest) if err != nil { return nil, err } @@ -4463,8 +4459,7 @@ func (c *ServicesUpdateConnectionsCall) Header() http.Header { func (c *ServicesUpdateConnectionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicenetworkingv1betaconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudservicenetworkingv1betaconnection) if err != nil { return nil, err } @@ -4573,8 +4568,7 @@ func (c *ServicesConnectionsCreateCall) Header() http.Header { func (c *ServicesConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicenetworkingv1betaconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudservicenetworkingv1betaconnection) if err != nil { return nil, err } @@ -4700,12 +4694,11 @@ func (c *ServicesConnectionsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/serviceusage/v1/serviceusage-gen.go b/serviceusage/v1/serviceusage-gen.go index 934196b91cf..0b9ef47b899 100644 --- a/serviceusage/v1/serviceusage-gen.go +++ b/serviceusage/v1/serviceusage-gen.go @@ -129,7 +129,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -148,10 +150,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4721,8 +4720,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -4823,12 +4821,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4932,12 +4929,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5063,12 +5059,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5184,8 +5179,7 @@ func (c *ServicesBatchEnableCall) Header() http.Header { func (c *ServicesBatchEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchenableservicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchenableservicesrequest) if err != nil { return nil, err } @@ -5308,12 +5302,11 @@ func (c *ServicesBatchGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5413,8 +5406,7 @@ func (c *ServicesDisableCall) Header() http.Header { func (c *ServicesDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableservicerequest) if err != nil { return nil, err } @@ -5519,8 +5511,7 @@ func (c *ServicesEnableCall) Header() http.Header { func (c *ServicesEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableservicerequest) if err != nil { return nil, err } @@ -5633,12 +5624,11 @@ func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5774,12 +5764,11 @@ func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/serviceusage/v1beta1/serviceusage-gen.go b/serviceusage/v1beta1/serviceusage-gen.go index 2a54f2f3d78..ff7ef98b877 100644 --- a/serviceusage/v1beta1/serviceusage-gen.go +++ b/serviceusage/v1beta1/serviceusage-gen.go @@ -129,7 +129,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Services = NewServicesService(s) if err != nil { return nil, err } @@ -148,10 +150,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Services = NewServicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -5219,12 +5218,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5350,12 +5348,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5470,8 +5467,7 @@ func (c *ServicesBatchEnableCall) Header() http.Header { func (c *ServicesBatchEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchenableservicesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchenableservicesrequest) if err != nil { return nil, err } @@ -5579,8 +5575,7 @@ func (c *ServicesDisableCall) Header() http.Header { func (c *ServicesDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.disableservicerequest) if err != nil { return nil, err } @@ -5686,8 +5681,7 @@ func (c *ServicesEnableCall) Header() http.Header { func (c *ServicesEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableservicerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.enableservicerequest) if err != nil { return nil, err } @@ -5790,12 +5784,11 @@ func (c *ServicesGenerateServiceIdentityCall) Header() http.Header { func (c *ServicesGenerateServiceIdentityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:generateServiceIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5900,12 +5893,11 @@ func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6037,12 +6029,11 @@ func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/services") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6190,12 +6181,11 @@ func (c *ServicesConsumerQuotaMetricsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6291,8 +6281,7 @@ func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) Header() http.Hea func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importadminoverridesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importadminoverridesrequest) if err != nil { return nil, err } @@ -6395,8 +6384,7 @@ func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) Header() http. func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importconsumeroverridesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importconsumeroverridesrequest) if err != nil { return nil, err } @@ -6549,12 +6537,11 @@ func (c *ServicesConsumerQuotaMetricsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6702,12 +6689,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6843,8 +6829,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) Header() ht func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.quotaoverride) if err != nil { return nil, err } @@ -6980,12 +6965,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) Header() ht func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7105,12 +7089,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/adminOverrides") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7269,8 +7252,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) Header() htt func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.quotaoverride) if err != nil { return nil, err } @@ -7412,8 +7394,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) Header() func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.quotaoverride) if err != nil { return nil, err } @@ -7550,12 +7531,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) Header() func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7675,12 +7655,11 @@ func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerOverrides") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7840,8 +7819,7 @@ func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) Header() func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.quotaoverride) if err != nil { return nil, err } diff --git a/sheets/v4/sheets-gen.go b/sheets/v4/sheets-gen.go index 546a883eacf..fbda9d0c054 100644 --- a/sheets/v4/sheets-gen.go +++ b/sheets/v4/sheets-gen.go @@ -136,7 +136,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Spreadsheets = NewSpreadsheetsService(s) if err != nil { return nil, err } @@ -155,9 +156,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Spreadsheets = NewSpreadsheetsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -9413,8 +9412,7 @@ func (c *SpreadsheetsBatchUpdateCall) Header() http.Header { func (c *SpreadsheetsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatespreadsheetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatespreadsheetrequest) if err != nil { return nil, err } @@ -9511,8 +9509,7 @@ func (c *SpreadsheetsCreateCall) Header() http.Header { func (c *SpreadsheetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.spreadsheet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.spreadsheet) if err != nil { return nil, err } @@ -9649,12 +9646,11 @@ func (c *SpreadsheetsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/spreadsheets/{spreadsheetId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9757,8 +9753,7 @@ func (c *SpreadsheetsGetByDataFilterCall) Header() http.Header { func (c *SpreadsheetsGetByDataFilterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getspreadsheetbydatafilterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getspreadsheetbydatafilterrequest) if err != nil { return nil, err } @@ -9872,12 +9867,11 @@ func (c *SpreadsheetsDeveloperMetadataGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9975,8 +9969,7 @@ func (c *SpreadsheetsDeveloperMetadataSearchCall) Header() http.Header { func (c *SpreadsheetsDeveloperMetadataSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchdevelopermetadatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchdevelopermetadatarequest) if err != nil { return nil, err } @@ -10081,8 +10074,7 @@ func (c *SpreadsheetsSheetsCopyToCall) Header() http.Header { func (c *SpreadsheetsSheetsCopyToCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copysheettoanotherspreadsheetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.copysheettoanotherspreadsheetrequest) if err != nil { return nil, err } @@ -10303,8 +10295,7 @@ func (c *SpreadsheetsValuesAppendCall) Header() http.Header { func (c *SpreadsheetsValuesAppendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.valuerange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.valuerange) if err != nil { return nil, err } @@ -10409,8 +10400,7 @@ func (c *SpreadsheetsValuesBatchClearCall) Header() http.Header { func (c *SpreadsheetsValuesBatchClearCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchclearvaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchclearvaluesrequest) if err != nil { return nil, err } @@ -10515,8 +10505,7 @@ func (c *SpreadsheetsValuesBatchClearByDataFilterCall) Header() http.Header { func (c *SpreadsheetsValuesBatchClearByDataFilterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchclearvaluesbydatafilterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchclearvaluesbydatafilterrequest) if err != nil { return nil, err } @@ -10710,12 +10699,11 @@ func (c *SpreadsheetsValuesBatchGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/spreadsheets/{spreadsheetId}/values:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10811,8 +10799,7 @@ func (c *SpreadsheetsValuesBatchGetByDataFilterCall) Header() http.Header { func (c *SpreadsheetsValuesBatchGetByDataFilterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetvaluesbydatafilterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchgetvaluesbydatafilterrequest) if err != nil { return nil, err } @@ -10915,8 +10902,7 @@ func (c *SpreadsheetsValuesBatchUpdateCall) Header() http.Header { func (c *SpreadsheetsValuesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatevaluesrequest) if err != nil { return nil, err } @@ -11019,8 +11005,7 @@ func (c *SpreadsheetsValuesBatchUpdateByDataFilterCall) Header() http.Header { func (c *SpreadsheetsValuesBatchUpdateByDataFilterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatevaluesbydatafilterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatevaluesbydatafilterrequest) if err != nil { return nil, err } @@ -11127,8 +11112,7 @@ func (c *SpreadsheetsValuesClearCall) Header() http.Header { func (c *SpreadsheetsValuesClearCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearvaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clearvaluesrequest) if err != nil { return nil, err } @@ -11319,12 +11303,11 @@ func (c *SpreadsheetsValuesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v4/spreadsheets/{spreadsheetId}/values/{range}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11514,8 +11497,7 @@ func (c *SpreadsheetsValuesUpdateCall) Header() http.Header { func (c *SpreadsheetsValuesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.valuerange) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.valuerange) if err != nil { return nil, err } diff --git a/siteverification/v1/siteverification-gen.go b/siteverification/v1/siteverification-gen.go index 9af1774bcef..7bef2834ae2 100644 --- a/siteverification/v1/siteverification-gen.go +++ b/siteverification/v1/siteverification-gen.go @@ -121,7 +121,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.WebResource = NewWebResourceService(s) if err != nil { return nil, err } @@ -140,9 +141,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.WebResource = NewWebResourceService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -375,12 +374,11 @@ func (c *WebResourceDeleteCall) Header() http.Header { func (c *WebResourceDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -459,12 +457,11 @@ func (c *WebResourceGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -553,8 +550,7 @@ func (c *WebResourceGetTokenCall) Header() http.Header { func (c *WebResourceGetTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourcegettokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.siteverificationwebresourcegettokenrequest) if err != nil { return nil, err } @@ -651,8 +647,7 @@ func (c *WebResourceInsertCall) Header() http.Header { func (c *WebResourceInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.siteverificationwebresourceresource) if err != nil { return nil, err } @@ -756,12 +751,11 @@ func (c *WebResourceListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "webResource") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -852,8 +846,7 @@ func (c *WebResourcePatchCall) Header() http.Header { func (c *WebResourcePatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.siteverificationwebresourceresource) if err != nil { return nil, err } @@ -954,8 +947,7 @@ func (c *WebResourceUpdateCall) Header() http.Header { func (c *WebResourceUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.siteverificationwebresourceresource) if err != nil { return nil, err } diff --git a/slides/v1/slides-gen.go b/slides/v1/slides-gen.go index a7efddd6997..0d9f4ea8c5c 100644 --- a/slides/v1/slides-gen.go +++ b/slides/v1/slides-gen.go @@ -144,7 +144,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Presentations = NewPresentationsService(s) if err != nil { return nil, err } @@ -163,9 +164,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Presentations = NewPresentationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5967,8 +5966,7 @@ func (c *PresentationsBatchUpdateCall) Header() http.Header { func (c *PresentationsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatepresentationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatepresentationrequest) if err != nil { return nil, err } @@ -6069,8 +6067,7 @@ func (c *PresentationsCreateCall) Header() http.Header { func (c *PresentationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.presentation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.presentation) if err != nil { return nil, err } @@ -6177,12 +6174,11 @@ func (c *PresentationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/presentations/{+presentationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6287,12 +6283,11 @@ func (c *PresentationsPagesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/presentations/{presentationId}/pages/{pageObjectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6432,12 +6427,11 @@ func (c *PresentationsPagesGetThumbnailCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/smartdevicemanagement/v1/smartdevicemanagement-gen.go b/smartdevicemanagement/v1/smartdevicemanagement-gen.go index a18df53c270..708d2357a9a 100644 --- a/smartdevicemanagement/v1/smartdevicemanagement-gen.go +++ b/smartdevicemanagement/v1/smartdevicemanagement-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Enterprises = NewEnterprisesService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Enterprises = NewEnterprisesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -496,8 +495,7 @@ func (c *EnterprisesDevicesExecuteCommandCall) Header() http.Header { func (c *EnterprisesDevicesExecuteCommandCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlehomeenterprisesdmv1executedevicecommandrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlehomeenterprisesdmv1executedevicecommandrequest) if err != nil { return nil, err } @@ -609,12 +607,11 @@ func (c *EnterprisesDevicesGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -726,12 +723,11 @@ func (c *EnterprisesDevicesListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -835,12 +831,11 @@ func (c *EnterprisesStructuresGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -951,12 +946,11 @@ func (c *EnterprisesStructuresListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/structures") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1060,12 +1054,11 @@ func (c *EnterprisesStructuresRoomsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1169,12 +1162,11 @@ func (c *EnterprisesStructuresRoomsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rooms") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/solar/v1/solar-gen.go b/solar/v1/solar-gen.go index de20ebe0340..a5a64c3f987 100644 --- a/solar/v1/solar-gen.go +++ b/solar/v1/solar-gen.go @@ -115,7 +115,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BuildingInsights = NewBuildingInsightsService(s) + s.DataLayers = NewDataLayersService(s) + s.GeoTiff = NewGeoTiffService(s) if err != nil { return nil, err } @@ -134,11 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BuildingInsights = NewBuildingInsightsService(s) - s.DataLayers = NewDataLayersService(s) - s.GeoTiff = NewGeoTiffService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1306,12 +1305,11 @@ func (c *BuildingInsightsFindClosestCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/buildingInsights:findClosest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1523,12 +1521,11 @@ func (c *DataLayersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/dataLayers:get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1630,12 +1627,11 @@ func (c *GeoTiffGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/geoTiff:get") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/spanner/v1/spanner-gen.go b/spanner/v1/spanner-gen.go index 02d628c5731..182536c68a4 100644 --- a/spanner/v1/spanner-gen.go +++ b/spanner/v1/spanner-gen.go @@ -130,7 +130,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.Scans = NewScansService(s) if err != nil { return nil, err } @@ -149,10 +151,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.Scans = NewScansService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6792,12 +6791,11 @@ func (c *ProjectsInstanceConfigOperationsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instanceConfigOperations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6930,8 +6928,7 @@ func (c *ProjectsInstanceConfigsCreateCall) Header() http.Header { func (c *ProjectsInstanceConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createinstanceconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createinstanceconfigrequest) if err != nil { return nil, err } @@ -7054,12 +7051,11 @@ func (c *ProjectsInstanceConfigsDeleteCall) Header() http.Header { func (c *ProjectsInstanceConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7162,12 +7158,11 @@ func (c *ProjectsInstanceConfigsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7287,12 +7282,11 @@ func (c *ProjectsInstanceConfigsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7426,8 +7420,7 @@ func (c *ProjectsInstanceConfigsPatchCall) Header() http.Header { func (c *ProjectsInstanceConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateinstanceconfigrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateinstanceconfigrequest) if err != nil { return nil, err } @@ -7533,12 +7526,11 @@ func (c *ProjectsInstanceConfigsOperationsCancelCall) Header() http.Header { func (c *ProjectsInstanceConfigsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7631,12 +7623,11 @@ func (c *ProjectsInstanceConfigsOperationsDeleteCall) Header() http.Header { func (c *ProjectsInstanceConfigsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7740,12 +7731,11 @@ func (c *ProjectsInstanceConfigsOperationsGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7868,12 +7858,11 @@ func (c *ProjectsInstanceConfigsOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7993,12 +7982,11 @@ func (c *ProjectsInstanceConfigsSsdCachesOperationsCancelCall) Header() http.Hea func (c *ProjectsInstanceConfigsSsdCachesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8091,12 +8079,11 @@ func (c *ProjectsInstanceConfigsSsdCachesOperationsDeleteCall) Header() http.Hea func (c *ProjectsInstanceConfigsSsdCachesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8200,12 +8187,11 @@ func (c *ProjectsInstanceConfigsSsdCachesOperationsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8328,12 +8314,11 @@ func (c *ProjectsInstanceConfigsSsdCachesOperationsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8465,8 +8450,7 @@ func (c *ProjectsInstancesCreateCall) Header() http.Header { func (c *ProjectsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createinstancerequest) if err != nil { return nil, err } @@ -8568,12 +8552,11 @@ func (c *ProjectsInstancesDeleteCall) Header() http.Header { func (c *ProjectsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8684,12 +8667,11 @@ func (c *ProjectsInstancesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8785,8 +8767,7 @@ func (c *ProjectsInstancesGetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -8938,12 +8919,11 @@ func (c *ProjectsInstancesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9086,8 +9066,7 @@ func (c *ProjectsInstancesMoveCall) Header() http.Header { func (c *ProjectsInstancesMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.moveinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.moveinstancerequest) if err != nil { return nil, err } @@ -9210,8 +9189,7 @@ func (c *ProjectsInstancesPatchCall) Header() http.Header { func (c *ProjectsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateinstancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateinstancerequest) if err != nil { return nil, err } @@ -9315,8 +9293,7 @@ func (c *ProjectsInstancesSetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9422,8 +9399,7 @@ func (c *ProjectsInstancesTestIamPermissionsCall) Header() http.Header { func (c *ProjectsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9610,12 +9586,11 @@ func (c *ProjectsInstancesBackupOperationsListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupOperations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9737,8 +9712,7 @@ func (c *ProjectsInstancesBackupsCopyCall) Header() http.Header { func (c *ProjectsInstancesBackupsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copybackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.copybackuprequest) if err != nil { return nil, err } @@ -9908,8 +9882,7 @@ func (c *ProjectsInstancesBackupsCreateCall) Header() http.Header { func (c *ProjectsInstancesBackupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -10008,12 +9981,11 @@ func (c *ProjectsInstancesBackupsDeleteCall) Header() http.Header { func (c *ProjectsInstancesBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10116,12 +10088,11 @@ func (c *ProjectsInstancesBackupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10221,8 +10192,7 @@ func (c *ProjectsInstancesBackupsGetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesBackupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -10379,12 +10349,11 @@ func (c *ProjectsInstancesBackupsListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10516,8 +10485,7 @@ func (c *ProjectsInstancesBackupsPatchCall) Header() http.Header { func (c *ProjectsInstancesBackupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backup) if err != nil { return nil, err } @@ -10624,8 +10592,7 @@ func (c *ProjectsInstancesBackupsSetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -10736,8 +10703,7 @@ func (c *ProjectsInstancesBackupsTestIamPermissionsCall) Header() http.Header { func (c *ProjectsInstancesBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -10844,12 +10810,11 @@ func (c *ProjectsInstancesBackupsOperationsCancelCall) Header() http.Header { func (c *ProjectsInstancesBackupsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10942,12 +10907,11 @@ func (c *ProjectsInstancesBackupsOperationsDeleteCall) Header() http.Header { func (c *ProjectsInstancesBackupsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11051,12 +11015,11 @@ func (c *ProjectsInstancesBackupsOperationsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11179,12 +11142,11 @@ func (c *ProjectsInstancesBackupsOperationsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11363,12 +11325,11 @@ func (c *ProjectsInstancesDatabaseOperationsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databaseOperations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11490,8 +11451,7 @@ func (c *ProjectsInstancesDatabasesChangequorumCall) Header() http.Header { func (c *ProjectsInstancesDatabasesChangequorumCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.changequorumrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.changequorumrequest) if err != nil { return nil, err } @@ -11596,8 +11556,7 @@ func (c *ProjectsInstancesDatabasesCreateCall) Header() http.Header { func (c *ProjectsInstancesDatabasesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createdatabaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createdatabaserequest) if err != nil { return nil, err } @@ -11698,12 +11657,11 @@ func (c *ProjectsInstancesDatabasesDropDatabaseCall) Header() http.Header { func (c *ProjectsInstancesDatabasesDropDatabaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11806,12 +11764,11 @@ func (c *ProjectsInstancesDatabasesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11916,12 +11873,11 @@ func (c *ProjectsInstancesDatabasesGetDdlCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/ddl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12022,8 +11978,7 @@ func (c *ProjectsInstancesDatabasesGetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesDatabasesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -12173,12 +12128,11 @@ func (c *ProjectsInstancesDatabasesGetScansCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/scans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12297,12 +12251,11 @@ func (c *ProjectsInstancesDatabasesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12442,8 +12395,7 @@ func (c *ProjectsInstancesDatabasesPatchCall) Header() http.Header { func (c *ProjectsInstancesDatabasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database) if err != nil { return nil, err } @@ -12557,8 +12509,7 @@ func (c *ProjectsInstancesDatabasesRestoreCall) Header() http.Header { func (c *ProjectsInstancesDatabasesRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoredatabaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoredatabaserequest) if err != nil { return nil, err } @@ -12665,8 +12616,7 @@ func (c *ProjectsInstancesDatabasesSetIamPolicyCall) Header() http.Header { func (c *ProjectsInstancesDatabasesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -12777,8 +12727,7 @@ func (c *ProjectsInstancesDatabasesTestIamPermissionsCall) Header() http.Header func (c *ProjectsInstancesDatabasesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -12883,8 +12832,7 @@ func (c *ProjectsInstancesDatabasesUpdateDdlCall) Header() http.Header { func (c *ProjectsInstancesDatabasesUpdateDdlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedatabaseddlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatedatabaseddlrequest) if err != nil { return nil, err } @@ -12993,8 +12941,7 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesCreateCall) Header() http.Head func (c *ProjectsInstancesDatabasesBackupSchedulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupschedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupschedule) if err != nil { return nil, err } @@ -13093,12 +13040,11 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesDeleteCall) Header() http.Head func (c *ProjectsInstancesDatabasesBackupSchedulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13201,12 +13147,11 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13306,8 +13251,7 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesGetIamPolicyCall) Header() htt func (c *ProjectsInstancesDatabasesBackupSchedulesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getiampolicyrequest) if err != nil { return nil, err } @@ -13434,12 +13378,11 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupSchedules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13568,8 +13511,7 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesPatchCall) Header() http.Heade func (c *ProjectsInstancesDatabasesBackupSchedulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupschedule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backupschedule) if err != nil { return nil, err } @@ -13676,8 +13618,7 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesSetIamPolicyCall) Header() htt func (c *ProjectsInstancesDatabasesBackupSchedulesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -13788,8 +13729,7 @@ func (c *ProjectsInstancesDatabasesBackupSchedulesTestIamPermissionsCall) Header func (c *ProjectsInstancesDatabasesBackupSchedulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -13917,12 +13857,11 @@ func (c *ProjectsInstancesDatabasesDatabaseRolesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databaseRoles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14047,8 +13986,7 @@ func (c *ProjectsInstancesDatabasesDatabaseRolesTestIamPermissionsCall) Header() func (c *ProjectsInstancesDatabasesDatabaseRolesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -14155,12 +14093,11 @@ func (c *ProjectsInstancesDatabasesOperationsCancelCall) Header() http.Header { func (c *ProjectsInstancesDatabasesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14253,12 +14190,11 @@ func (c *ProjectsInstancesDatabasesOperationsDeleteCall) Header() http.Header { func (c *ProjectsInstancesDatabasesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14362,12 +14298,11 @@ func (c *ProjectsInstancesDatabasesOperationsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14490,12 +14425,11 @@ func (c *ProjectsInstancesDatabasesOperationsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14611,8 +14545,7 @@ func (c *ProjectsInstancesDatabasesSessionsBatchCreateCall) Header() http.Header func (c *ProjectsInstancesDatabasesSessionsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreatesessionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatesessionsrequest) if err != nil { return nil, err } @@ -14725,8 +14658,7 @@ func (c *ProjectsInstancesDatabasesSessionsBatchWriteCall) Header() http.Header func (c *ProjectsInstancesDatabasesSessionsBatchWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchwriterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchwriterequest) if err != nil { return nil, err } @@ -14828,8 +14760,7 @@ func (c *ProjectsInstancesDatabasesSessionsBeginTransactionCall) Header() http.H func (c *ProjectsInstancesDatabasesSessionsBeginTransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.begintransactionrequest) if err != nil { return nil, err } @@ -14938,8 +14869,7 @@ func (c *ProjectsInstancesDatabasesSessionsCommitCall) Header() http.Header { func (c *ProjectsInstancesDatabasesSessionsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commitrequest) if err != nil { return nil, err } @@ -15050,8 +14980,7 @@ func (c *ProjectsInstancesDatabasesSessionsCreateCall) Header() http.Header { func (c *ProjectsInstancesDatabasesSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createsessionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createsessionrequest) if err != nil { return nil, err } @@ -15151,12 +15080,11 @@ func (c *ProjectsInstancesDatabasesSessionsDeleteCall) Header() http.Header { func (c *ProjectsInstancesDatabasesSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15255,8 +15183,7 @@ func (c *ProjectsInstancesDatabasesSessionsExecuteBatchDmlCall) Header() http.He func (c *ProjectsInstancesDatabasesSessionsExecuteBatchDmlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executebatchdmlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executebatchdmlrequest) if err != nil { return nil, err } @@ -15364,8 +15291,7 @@ func (c *ProjectsInstancesDatabasesSessionsExecuteSqlCall) Header() http.Header func (c *ProjectsInstancesDatabasesSessionsExecuteSqlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executesqlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executesqlrequest) if err != nil { return nil, err } @@ -15468,8 +15394,7 @@ func (c *ProjectsInstancesDatabasesSessionsExecuteStreamingSqlCall) Header() htt func (c *ProjectsInstancesDatabasesSessionsExecuteStreamingSqlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.executesqlrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.executesqlrequest) if err != nil { return nil, err } @@ -15581,12 +15506,11 @@ func (c *ProjectsInstancesDatabasesSessionsGetCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15715,12 +15639,11 @@ func (c *ProjectsInstancesDatabasesSessionsListCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/sessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15843,8 +15766,7 @@ func (c *ProjectsInstancesDatabasesSessionsPartitionQueryCall) Header() http.Hea func (c *ProjectsInstancesDatabasesSessionsPartitionQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.partitionqueryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.partitionqueryrequest) if err != nil { return nil, err } @@ -15956,8 +15878,7 @@ func (c *ProjectsInstancesDatabasesSessionsPartitionReadCall) Header() http.Head func (c *ProjectsInstancesDatabasesSessionsPartitionReadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.partitionreadrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.partitionreadrequest) if err != nil { return nil, err } @@ -16065,8 +15986,7 @@ func (c *ProjectsInstancesDatabasesSessionsReadCall) Header() http.Header { func (c *ProjectsInstancesDatabasesSessionsReadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.readrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.readrequest) if err != nil { return nil, err } @@ -16171,8 +16091,7 @@ func (c *ProjectsInstancesDatabasesSessionsRollbackCall) Header() http.Header { func (c *ProjectsInstancesDatabasesSessionsRollbackCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackrequest) if err != nil { return nil, err } @@ -16275,8 +16194,7 @@ func (c *ProjectsInstancesDatabasesSessionsStreamingReadCall) Header() http.Head func (c *ProjectsInstancesDatabasesSessionsStreamingReadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.readrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.readrequest) if err != nil { return nil, err } @@ -16456,12 +16374,11 @@ func (c *ProjectsInstancesInstancePartitionOperationsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instancePartitionOperations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16594,8 +16511,7 @@ func (c *ProjectsInstancesInstancePartitionsCreateCall) Header() http.Header { func (c *ProjectsInstancesInstancePartitionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createinstancepartitionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createinstancepartitionrequest) if err != nil { return nil, err } @@ -16708,12 +16624,11 @@ func (c *ProjectsInstancesInstancePartitionsDeleteCall) Header() http.Header { func (c *ProjectsInstancesInstancePartitionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16817,12 +16732,11 @@ func (c *ProjectsInstancesInstancePartitionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16954,12 +16868,11 @@ func (c *ProjectsInstancesInstancePartitionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instancePartitions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17098,8 +17011,7 @@ func (c *ProjectsInstancesInstancePartitionsPatchCall) Header() http.Header { func (c *ProjectsInstancesInstancePartitionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateinstancepartitionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updateinstancepartitionrequest) if err != nil { return nil, err } @@ -17205,12 +17117,11 @@ func (c *ProjectsInstancesInstancePartitionsOperationsCancelCall) Header() http. func (c *ProjectsInstancesInstancePartitionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17303,12 +17214,11 @@ func (c *ProjectsInstancesInstancePartitionsOperationsDeleteCall) Header() http. func (c *ProjectsInstancesInstancePartitionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17412,12 +17322,11 @@ func (c *ProjectsInstancesInstancePartitionsOperationsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17540,12 +17449,11 @@ func (c *ProjectsInstancesInstancePartitionsOperationsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17665,12 +17573,11 @@ func (c *ProjectsInstancesOperationsCancelCall) Header() http.Header { func (c *ProjectsInstancesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -17763,12 +17670,11 @@ func (c *ProjectsInstancesOperationsDeleteCall) Header() http.Header { func (c *ProjectsInstancesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17872,12 +17778,11 @@ func (c *ProjectsInstancesOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18000,12 +17905,11 @@ func (c *ProjectsInstancesOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18172,12 +18076,11 @@ func (c *ScansListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/speech/v1/speech-gen.go b/speech/v1/speech-gen.go index eec0fbf8536..824f1bc2d76 100644 --- a/speech/v1/speech-gen.go +++ b/speech/v1/speech-gen.go @@ -117,7 +117,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.Speech = NewSpeechService(s) if err != nil { return nil, err } @@ -136,11 +139,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.Speech = NewSpeechService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1669,12 +1668,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1800,12 +1798,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1923,8 +1920,7 @@ func (c *ProjectsLocationsCustomClassesCreateCall) Header() http.Header { func (c *ProjectsLocationsCustomClassesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcustomclassrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcustomclassrequest) if err != nil { return nil, err } @@ -2029,12 +2025,11 @@ func (c *ProjectsLocationsCustomClassesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomClassesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2137,12 +2132,11 @@ func (c *ProjectsLocationsCustomClassesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2268,12 +2262,11 @@ func (c *ProjectsLocationsCustomClassesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customClasses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2394,8 +2387,7 @@ func (c *ProjectsLocationsCustomClassesPatchCall) Header() http.Header { func (c *ProjectsLocationsCustomClassesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customclass) if err != nil { return nil, err } @@ -2503,8 +2495,7 @@ func (c *ProjectsLocationsPhraseSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsPhraseSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createphrasesetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createphrasesetrequest) if err != nil { return nil, err } @@ -2603,12 +2594,11 @@ func (c *ProjectsLocationsPhraseSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPhraseSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2717,12 +2707,11 @@ func (c *ProjectsLocationsPhraseSetsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2848,12 +2837,11 @@ func (c *ProjectsLocationsPhraseSetsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/phraseSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2974,8 +2962,7 @@ func (c *ProjectsLocationsPhraseSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsPhraseSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.phraseset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.phraseset) if err != nil { return nil, err } @@ -3076,8 +3063,7 @@ func (c *SpeechLongrunningrecognizeCall) Header() http.Header { func (c *SpeechLongrunningrecognizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.longrunningrecognizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.longrunningrecognizerequest) if err != nil { return nil, err } @@ -3171,8 +3157,7 @@ func (c *SpeechRecognizeCall) Header() http.Header { func (c *SpeechRecognizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.recognizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.recognizerequest) if err != nil { return nil, err } diff --git a/speech/v1p1beta1/speech-gen.go b/speech/v1p1beta1/speech-gen.go index 964e5213ce6..32215f309ba 100644 --- a/speech/v1p1beta1/speech-gen.go +++ b/speech/v1p1beta1/speech-gen.go @@ -117,7 +117,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.Speech = NewSpeechService(s) if err != nil { return nil, err } @@ -136,11 +139,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.Speech = NewSpeechService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1685,12 +1684,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/operations/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1816,12 +1814,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1939,8 +1936,7 @@ func (c *ProjectsLocationsCustomClassesCreateCall) Header() http.Header { func (c *ProjectsLocationsCustomClassesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcustomclassrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcustomclassrequest) if err != nil { return nil, err } @@ -2045,12 +2041,11 @@ func (c *ProjectsLocationsCustomClassesDeleteCall) Header() http.Header { func (c *ProjectsLocationsCustomClassesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2153,12 +2148,11 @@ func (c *ProjectsLocationsCustomClassesGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2284,12 +2278,11 @@ func (c *ProjectsLocationsCustomClassesListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/customClasses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2410,8 +2403,7 @@ func (c *ProjectsLocationsCustomClassesPatchCall) Header() http.Header { func (c *ProjectsLocationsCustomClassesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customclass) if err != nil { return nil, err } @@ -2519,8 +2511,7 @@ func (c *ProjectsLocationsPhraseSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsPhraseSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createphrasesetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createphrasesetrequest) if err != nil { return nil, err } @@ -2619,12 +2610,11 @@ func (c *ProjectsLocationsPhraseSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPhraseSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2733,12 +2723,11 @@ func (c *ProjectsLocationsPhraseSetsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2864,12 +2853,11 @@ func (c *ProjectsLocationsPhraseSetsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/phraseSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2990,8 +2978,7 @@ func (c *ProjectsLocationsPhraseSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsPhraseSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.phraseset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.phraseset) if err != nil { return nil, err } @@ -3092,8 +3079,7 @@ func (c *SpeechLongrunningrecognizeCall) Header() http.Header { func (c *SpeechLongrunningrecognizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.longrunningrecognizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.longrunningrecognizerequest) if err != nil { return nil, err } @@ -3187,8 +3173,7 @@ func (c *SpeechRecognizeCall) Header() http.Header { func (c *SpeechRecognizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.recognizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.recognizerequest) if err != nil { return nil, err } diff --git a/sqladmin/v1/sqladmin-gen.go b/sqladmin/v1/sqladmin-gen.go index ca778b173ef..d5f1c96219a 100644 --- a/sqladmin/v1/sqladmin-gen.go +++ b/sqladmin/v1/sqladmin-gen.go @@ -124,7 +124,17 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BackupRuns = NewBackupRunsService(s) + s.Connect = NewConnectService(s) + s.Databases = NewDatabasesService(s) + s.Flags = NewFlagsService(s) + s.Instances = NewInstancesService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.SslCerts = NewSslCertsService(s) + s.Tiers = NewTiersService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -143,18 +153,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BackupRuns = NewBackupRunsService(s) - s.Connect = NewConnectService(s) - s.Databases = NewDatabasesService(s) - s.Flags = NewFlagsService(s) - s.Instances = NewInstancesService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.SslCerts = NewSslCertsService(s) - s.Tiers = NewTiersService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5104,12 +5103,11 @@ func (c *BackupRunsDeleteCall) Header() http.Header { func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5219,12 +5217,11 @@ func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5321,8 +5318,7 @@ func (c *BackupRunsInsertCall) Header() http.Header { func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backuprun) if err != nil { return nil, err } @@ -5453,12 +5449,11 @@ func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5579,8 +5574,7 @@ func (c *ConnectGenerateEphemeralCertCall) Header() http.Header { func (c *ConnectGenerateEphemeralCertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateephemeralcertrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateephemeralcertrequest) if err != nil { return nil, err } @@ -5702,12 +5696,11 @@ func (c *ConnectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/connectSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5805,12 +5798,11 @@ func (c *DatabasesDeleteCall) Header() http.Header { func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases/{database}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5921,12 +5913,11 @@ func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases/{database}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6025,8 +6016,7 @@ func (c *DatabasesInsertCall) Header() http.Header { func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database) if err != nil { return nil, err } @@ -6140,12 +6130,11 @@ func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6246,8 +6235,7 @@ func (c *DatabasesPatchCall) Header() http.Header { func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database2) if err != nil { return nil, err } @@ -6356,8 +6344,7 @@ func (c *DatabasesUpdateCall) Header() http.Header { func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database2) if err != nil { return nil, err } @@ -6473,12 +6460,11 @@ func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/flags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6586,12 +6572,11 @@ func (c *InstancesListServerCertificatesCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/listServerCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6691,8 +6676,7 @@ func (c *InstancesRotateServerCertificateCall) Header() http.Header { func (c *InstancesRotateServerCertificateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercertificaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesrotateservercertificaterequest) if err != nil { return nil, err } @@ -6801,8 +6785,7 @@ func (c *InstancesAcquireSsrsLeaseCall) Header() http.Header { func (c *InstancesAcquireSsrsLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesacquiressrsleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesacquiressrsleaserequest) if err != nil { return nil, err } @@ -6911,12 +6894,11 @@ func (c *InstancesAddServerCaCall) Header() http.Header { func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/addServerCa") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7016,12 +6998,11 @@ func (c *InstancesAddServerCertificateCall) Header() http.Header { func (c *InstancesAddServerCertificateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/addServerCertificate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7119,8 +7100,7 @@ func (c *InstancesCloneCall) Header() http.Header { func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesclonerequest) if err != nil { return nil, err } @@ -7223,12 +7203,11 @@ func (c *InstancesDeleteCall) Header() http.Header { func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7325,8 +7304,7 @@ func (c *InstancesDemoteCall) Header() http.Header { func (c *InstancesDemoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemoterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesdemoterequest) if err != nil { return nil, err } @@ -7431,8 +7409,7 @@ func (c *InstancesDemoteMasterCall) Header() http.Header { func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesdemotemasterrequest) if err != nil { return nil, err } @@ -7538,8 +7515,7 @@ func (c *InstancesExportCall) Header() http.Header { func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesexportrequest) if err != nil { return nil, err } @@ -7649,8 +7625,7 @@ func (c *InstancesFailoverCall) Header() http.Header { func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesfailoverrequest) if err != nil { return nil, err } @@ -7764,12 +7739,11 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7867,8 +7841,7 @@ func (c *InstancesImportCall) Header() http.Header { func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesimportrequest) if err != nil { return nil, err } @@ -7970,8 +7943,7 @@ func (c *InstancesInsertCall) Header() http.Header { func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -8110,12 +8082,11 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8246,12 +8217,11 @@ func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/listServerCas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8350,8 +8320,7 @@ func (c *InstancesPatchCall) Header() http.Header { func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -8466,12 +8435,11 @@ func (c *InstancesPromoteReplicaCall) Header() http.Header { func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/promoteReplica") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8567,8 +8535,7 @@ func (c *InstancesReencryptCall) Header() http.Header { func (c *InstancesReencryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesreencryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesreencryptrequest) if err != nil { return nil, err } @@ -8674,12 +8641,11 @@ func (c *InstancesReleaseSsrsLeaseCall) Header() http.Header { func (c *InstancesReleaseSsrsLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/releaseSsrsLease") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8775,12 +8741,11 @@ func (c *InstancesResetSslConfigCall) Header() http.Header { func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/resetSslConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8875,12 +8840,11 @@ func (c *InstancesRestartCall) Header() http.Header { func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/restart") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8977,8 +8941,7 @@ func (c *InstancesRestoreBackupCall) Header() http.Header { func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesrestorebackuprequest) if err != nil { return nil, err } @@ -9086,8 +9049,7 @@ func (c *InstancesRotateServerCaCall) Header() http.Header { func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesrotateservercarequest) if err != nil { return nil, err } @@ -9189,12 +9151,11 @@ func (c *InstancesStartReplicaCall) Header() http.Header { func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/startReplica") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9288,12 +9249,11 @@ func (c *InstancesStopReplicaCall) Header() http.Header { func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/stopReplica") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9397,12 +9357,11 @@ func (c *InstancesSwitchoverCall) Header() http.Header { func (c *InstancesSwitchoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/switchover") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9498,8 +9457,7 @@ func (c *InstancesTruncateLogCall) Header() http.Header { func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancestruncatelogrequest) if err != nil { return nil, err } @@ -9604,8 +9562,7 @@ func (c *InstancesUpdateCall) Header() http.Header { func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -9708,12 +9665,11 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/operations/{operation}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9819,12 +9775,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9949,12 +9904,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10081,12 +10035,11 @@ func (c *ProjectsInstancesGetDiskShrinkConfigCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/getDiskShrinkConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10193,12 +10146,11 @@ func (c *ProjectsInstancesGetLatestRecoveryTimeCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/getLatestRecoveryTime") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10295,8 +10247,7 @@ func (c *ProjectsInstancesPerformDiskShrinkCall) Header() http.Header { func (c *ProjectsInstancesPerformDiskShrinkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.performdiskshrinkcontext) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.performdiskshrinkcontext) if err != nil { return nil, err } @@ -10400,8 +10351,7 @@ func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header { func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesreschedulemaintenancerequestbody) if err != nil { return nil, err } @@ -10505,8 +10455,7 @@ func (c *ProjectsInstancesResetReplicaSizeCall) Header() http.Header { func (c *ProjectsInstancesResetReplicaSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesresetreplicasizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesresetreplicasizerequest) if err != nil { return nil, err } @@ -10610,8 +10559,7 @@ func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header { func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesstartexternalsyncrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesstartexternalsyncrequest) if err != nil { return nil, err } @@ -10716,8 +10664,7 @@ func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header { func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesverifyexternalsyncsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesverifyexternalsyncsettingsrequest) if err != nil { return nil, err } @@ -10825,8 +10772,7 @@ func (c *SslCertsCreateEphemeralCall) Header() http.Header { func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertscreateephemeralrequest) if err != nil { return nil, err } @@ -10932,12 +10878,11 @@ func (c *SslCertsDeleteCall) Header() http.Header { func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11049,12 +10994,11 @@ func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11153,8 +11097,7 @@ func (c *SslCertsInsertCall) Header() http.Header { func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertsinsertrequest) if err != nil { return nil, err } @@ -11269,12 +11212,11 @@ func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11380,12 +11322,11 @@ func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/tiers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11491,12 +11432,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11611,12 +11551,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11713,8 +11652,7 @@ func (c *UsersInsertCall) Header() http.Header { func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -11828,12 +11766,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11942,8 +11879,7 @@ func (c *UsersUpdateCall) Header() http.Header { func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } diff --git a/sqladmin/v1beta4/sqladmin-gen.go b/sqladmin/v1beta4/sqladmin-gen.go index f290e30e905..a3212af54e2 100644 --- a/sqladmin/v1beta4/sqladmin-gen.go +++ b/sqladmin/v1beta4/sqladmin-gen.go @@ -124,7 +124,17 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.BackupRuns = NewBackupRunsService(s) + s.Connect = NewConnectService(s) + s.Databases = NewDatabasesService(s) + s.Flags = NewFlagsService(s) + s.Instances = NewInstancesService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.SslCerts = NewSslCertsService(s) + s.Tiers = NewTiersService(s) + s.Users = NewUsersService(s) if err != nil { return nil, err } @@ -143,18 +153,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.BackupRuns = NewBackupRunsService(s) - s.Connect = NewConnectService(s) - s.Databases = NewDatabasesService(s) - s.Flags = NewFlagsService(s) - s.Instances = NewInstancesService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.SslCerts = NewSslCertsService(s) - s.Tiers = NewTiersService(s) - s.Users = NewUsersService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -5106,12 +5105,11 @@ func (c *BackupRunsDeleteCall) Header() http.Header { func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5221,12 +5219,11 @@ func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5323,8 +5320,7 @@ func (c *BackupRunsInsertCall) Header() http.Header { func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.backuprun) if err != nil { return nil, err } @@ -5455,12 +5451,11 @@ func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5581,8 +5576,7 @@ func (c *ConnectGenerateEphemeralCertCall) Header() http.Header { func (c *ConnectGenerateEphemeralCertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateephemeralcertrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateephemeralcertrequest) if err != nil { return nil, err } @@ -5704,12 +5698,11 @@ func (c *ConnectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5807,12 +5800,11 @@ func (c *DatabasesDeleteCall) Header() http.Header { func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5923,12 +5915,11 @@ func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6027,8 +6018,7 @@ func (c *DatabasesInsertCall) Header() http.Header { func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database) if err != nil { return nil, err } @@ -6142,12 +6132,11 @@ func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6248,8 +6237,7 @@ func (c *DatabasesPatchCall) Header() http.Header { func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database2) if err != nil { return nil, err } @@ -6358,8 +6346,7 @@ func (c *DatabasesUpdateCall) Header() http.Header { func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database2) if err != nil { return nil, err } @@ -6475,12 +6462,11 @@ func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/flags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6588,12 +6574,11 @@ func (c *InstancesListServerCertificatesCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCertificates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6693,8 +6678,7 @@ func (c *InstancesRotateServerCertificateCall) Header() http.Header { func (c *InstancesRotateServerCertificateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercertificaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesrotateservercertificaterequest) if err != nil { return nil, err } @@ -6803,8 +6787,7 @@ func (c *InstancesAcquireSsrsLeaseCall) Header() http.Header { func (c *InstancesAcquireSsrsLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesacquiressrsleaserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesacquiressrsleaserequest) if err != nil { return nil, err } @@ -6913,12 +6896,11 @@ func (c *InstancesAddServerCaCall) Header() http.Header { func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7018,12 +7000,11 @@ func (c *InstancesAddServerCertificateCall) Header() http.Header { func (c *InstancesAddServerCertificateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCertificate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7121,8 +7102,7 @@ func (c *InstancesCloneCall) Header() http.Header { func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesclonerequest) if err != nil { return nil, err } @@ -7225,12 +7205,11 @@ func (c *InstancesDeleteCall) Header() http.Header { func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7327,8 +7306,7 @@ func (c *InstancesDemoteCall) Header() http.Header { func (c *InstancesDemoteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemoterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesdemoterequest) if err != nil { return nil, err } @@ -7433,8 +7411,7 @@ func (c *InstancesDemoteMasterCall) Header() http.Header { func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesdemotemasterrequest) if err != nil { return nil, err } @@ -7540,8 +7517,7 @@ func (c *InstancesExportCall) Header() http.Header { func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesexportrequest) if err != nil { return nil, err } @@ -7651,8 +7627,7 @@ func (c *InstancesFailoverCall) Header() http.Header { func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesfailoverrequest) if err != nil { return nil, err } @@ -7766,12 +7741,11 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7869,8 +7843,7 @@ func (c *InstancesImportCall) Header() http.Header { func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesimportrequest) if err != nil { return nil, err } @@ -7972,8 +7945,7 @@ func (c *InstancesInsertCall) Header() http.Header { func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -8112,12 +8084,11 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8248,12 +8219,11 @@ func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8352,8 +8322,7 @@ func (c *InstancesPatchCall) Header() http.Header { func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -8468,12 +8437,11 @@ func (c *InstancesPromoteReplicaCall) Header() http.Header { func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8569,8 +8537,7 @@ func (c *InstancesReencryptCall) Header() http.Header { func (c *InstancesReencryptCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesreencryptrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesreencryptrequest) if err != nil { return nil, err } @@ -8677,12 +8644,11 @@ func (c *InstancesReleaseSsrsLeaseCall) Header() http.Header { func (c *InstancesReleaseSsrsLeaseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/releaseSsrsLease") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8778,12 +8744,11 @@ func (c *InstancesResetSslConfigCall) Header() http.Header { func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8878,12 +8843,11 @@ func (c *InstancesRestartCall) Header() http.Header { func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restart") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8980,8 +8944,7 @@ func (c *InstancesRestoreBackupCall) Header() http.Header { func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesrestorebackuprequest) if err != nil { return nil, err } @@ -9089,8 +9052,7 @@ func (c *InstancesRotateServerCaCall) Header() http.Header { func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancesrotateservercarequest) if err != nil { return nil, err } @@ -9192,12 +9154,11 @@ func (c *InstancesStartReplicaCall) Header() http.Header { func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startReplica") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9291,12 +9252,11 @@ func (c *InstancesStopReplicaCall) Header() http.Header { func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9400,12 +9360,11 @@ func (c *InstancesSwitchoverCall) Header() http.Header { func (c *InstancesSwitchoverCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/switchover") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9501,8 +9460,7 @@ func (c *InstancesTruncateLogCall) Header() http.Header { func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancestruncatelogrequest) if err != nil { return nil, err } @@ -9607,8 +9565,7 @@ func (c *InstancesUpdateCall) Header() http.Header { func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.databaseinstance) if err != nil { return nil, err } @@ -9711,12 +9668,11 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9822,12 +9778,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9952,12 +9907,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10084,12 +10038,11 @@ func (c *ProjectsInstancesGetDiskShrinkConfigCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10196,12 +10149,11 @@ func (c *ProjectsInstancesGetLatestRecoveryTimeCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10298,8 +10250,7 @@ func (c *ProjectsInstancesPerformDiskShrinkCall) Header() http.Header { func (c *ProjectsInstancesPerformDiskShrinkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.performdiskshrinkcontext) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.performdiskshrinkcontext) if err != nil { return nil, err } @@ -10403,8 +10354,7 @@ func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header { func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesreschedulemaintenancerequestbody) if err != nil { return nil, err } @@ -10508,8 +10458,7 @@ func (c *ProjectsInstancesResetReplicaSizeCall) Header() http.Header { func (c *ProjectsInstancesResetReplicaSizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesresetreplicasizerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesresetreplicasizerequest) if err != nil { return nil, err } @@ -10613,8 +10562,7 @@ func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header { func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesstartexternalsyncrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesstartexternalsyncrequest) if err != nil { return nil, err } @@ -10719,8 +10667,7 @@ func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header { func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesverifyexternalsyncsettingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sqlinstancesverifyexternalsyncsettingsrequest) if err != nil { return nil, err } @@ -10828,8 +10775,7 @@ func (c *SslCertsCreateEphemeralCall) Header() http.Header { func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertscreateephemeralrequest) if err != nil { return nil, err } @@ -10935,12 +10881,11 @@ func (c *SslCertsDeleteCall) Header() http.Header { func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11052,12 +10997,11 @@ func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11156,8 +11100,7 @@ func (c *SslCertsInsertCall) Header() http.Header { func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sslcertsinsertrequest) if err != nil { return nil, err } @@ -11272,12 +11215,11 @@ func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11382,12 +11324,11 @@ func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/tiers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11493,12 +11434,11 @@ func (c *UsersDeleteCall) Header() http.Header { func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11613,12 +11553,11 @@ func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users/{name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11715,8 +11654,7 @@ func (c *UsersInsertCall) Header() http.Header { func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } @@ -11830,12 +11768,11 @@ func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11944,8 +11881,7 @@ func (c *UsersUpdateCall) Header() http.Header { func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.user) if err != nil { return nil, err } diff --git a/storage/v1/storage-gen.go b/storage/v1/storage-gen.go index 159e60d5031..ee9b41ad040 100644 --- a/storage/v1/storage-gen.go +++ b/storage/v1/storage-gen.go @@ -139,7 +139,19 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.AnywhereCaches = NewAnywhereCachesService(s) + s.BucketAccessControls = NewBucketAccessControlsService(s) + s.Buckets = NewBucketsService(s) + s.Channels = NewChannelsService(s) + s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s) + s.Folders = NewFoldersService(s) + s.ManagedFolders = NewManagedFoldersService(s) + s.Notifications = NewNotificationsService(s) + s.ObjectAccessControls = NewObjectAccessControlsService(s) + s.Objects = NewObjectsService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -158,20 +170,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.AnywhereCaches = NewAnywhereCachesService(s) - s.BucketAccessControls = NewBucketAccessControlsService(s) - s.Buckets = NewBucketsService(s) - s.Channels = NewChannelsService(s) - s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s) - s.Folders = NewFoldersService(s) - s.ManagedFolders = NewManagedFoldersService(s) - s.Notifications = NewNotificationsService(s) - s.ObjectAccessControls = NewObjectAccessControlsService(s) - s.Objects = NewObjectsService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2892,12 +2891,11 @@ func (c *AnywhereCachesDisableCall) Header() http.Header { func (c *AnywhereCachesDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3003,12 +3001,11 @@ func (c *AnywhereCachesGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3101,8 +3098,7 @@ func (c *AnywhereCachesInsertCall) Header() http.Header { func (c *AnywhereCachesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.anywherecache) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.anywherecache) if err != nil { return nil, err } @@ -3228,12 +3224,11 @@ func (c *AnywhereCachesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3347,12 +3342,11 @@ func (c *AnywhereCachesPauseCall) Header() http.Header { func (c *AnywhereCachesPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3446,12 +3440,11 @@ func (c *AnywhereCachesResumeCall) Header() http.Header { func (c *AnywhereCachesResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3548,8 +3541,7 @@ func (c *AnywhereCachesUpdateCall) Header() http.Header { func (c *AnywhereCachesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.anywherecache) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.anywherecache) if err != nil { return nil, err } @@ -3662,12 +3654,11 @@ func (c *BucketAccessControlsDeleteCall) Header() http.Header { func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3759,12 +3750,11 @@ func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3865,8 +3855,7 @@ func (c *BucketAccessControlsInsertCall) Header() http.Header { func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bucketaccesscontrol) if err != nil { return nil, err } @@ -3984,12 +3973,11 @@ func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4094,8 +4082,7 @@ func (c *BucketAccessControlsPatchCall) Header() http.Header { func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bucketaccesscontrol) if err != nil { return nil, err } @@ -4209,8 +4196,7 @@ func (c *BucketAccessControlsUpdateCall) Header() http.Header { func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bucketaccesscontrol) if err != nil { return nil, err } @@ -4333,12 +4319,11 @@ func (c *BucketsDeleteCall) Header() http.Header { func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4469,12 +4454,11 @@ func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4592,12 +4576,11 @@ func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4708,12 +4691,11 @@ func (c *BucketsGetStorageLayoutCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/storageLayout") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4889,8 +4871,7 @@ func (c *BucketsInsertCall) Header() http.Header { func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bucket) if err != nil { return nil, err } @@ -5046,12 +5027,11 @@ func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5169,12 +5149,11 @@ func (c *BucketsLockRetentionPolicyCall) Header() http.Header { func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5360,8 +5339,7 @@ func (c *BucketsPatchCall) Header() http.Header { func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bucket2) if err != nil { return nil, err } @@ -5462,8 +5440,7 @@ func (c *BucketsRelocateCall) Header() http.Header { func (c *BucketsRelocateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.relocatebucketrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.relocatebucketrequest) if err != nil { return nil, err } @@ -5583,12 +5560,11 @@ func (c *BucketsRestoreCall) Header() http.Header { func (c *BucketsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -5687,8 +5663,7 @@ func (c *BucketsSetIamPolicyCall) Header() http.Header { func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -5808,12 +5783,11 @@ func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6000,8 +5974,7 @@ func (c *BucketsUpdateCall) Header() http.Header { func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bucket2) if err != nil { return nil, err } @@ -6097,8 +6070,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -6183,12 +6155,11 @@ func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6281,12 +6252,11 @@ func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6387,8 +6357,7 @@ func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header { func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.objectaccesscontrol) if err != nil { return nil, err } @@ -6522,12 +6491,11 @@ func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6632,8 +6600,7 @@ func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header { func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.objectaccesscontrol) if err != nil { return nil, err } @@ -6747,8 +6714,7 @@ func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header { func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.objectaccesscontrol) if err != nil { return nil, err } @@ -6867,12 +6833,11 @@ func (c *FoldersDeleteCall) Header() http.Header { func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{folder}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6973,12 +6938,11 @@ func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{folder}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7079,8 +7043,7 @@ func (c *FoldersInsertCall) Header() http.Header { func (c *FoldersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -7240,12 +7203,11 @@ func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7379,12 +7341,11 @@ func (c *FoldersRenameCall) Header() http.Header { func (c *FoldersRenameCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7505,12 +7466,11 @@ func (c *ManagedFoldersDeleteCall) Header() http.Header { func (c *ManagedFoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7610,12 +7570,11 @@ func (c *ManagedFoldersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7737,12 +7696,11 @@ func (c *ManagedFoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}/iam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7835,8 +7793,7 @@ func (c *ManagedFoldersInsertCall) Header() http.Header { func (c *ManagedFoldersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedfolder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managedfolder) if err != nil { return nil, err } @@ -7967,12 +7924,11 @@ func (c *ManagedFoldersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8095,8 +8051,7 @@ func (c *ManagedFoldersSetIamPolicyCall) Header() http.Header { func (c *ManagedFoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -8220,12 +8175,11 @@ func (c *ManagedFoldersTestIamPermissionsCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8327,12 +8281,11 @@ func (c *NotificationsDeleteCall) Header() http.Header { func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8422,12 +8375,11 @@ func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8527,8 +8479,7 @@ func (c *NotificationsInsertCall) Header() http.Header { func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.notification) if err != nil { return nil, err } @@ -8645,12 +8596,11 @@ func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8766,12 +8716,11 @@ func (c *ObjectAccessControlsDeleteCall) Header() http.Header { func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8877,12 +8826,11 @@ func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8997,8 +8945,7 @@ func (c *ObjectAccessControlsInsertCall) Header() http.Header { func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.objectaccesscontrol) if err != nil { return nil, err } @@ -9130,12 +9077,11 @@ func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9254,8 +9200,7 @@ func (c *ObjectAccessControlsPatchCall) Header() http.Header { func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.objectaccesscontrol) if err != nil { return nil, err } @@ -9383,8 +9328,7 @@ func (c *ObjectAccessControlsUpdateCall) Header() http.Header { func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.objectaccesscontrol) if err != nil { return nil, err } @@ -9488,8 +9432,7 @@ func (c *ObjectsBulkRestoreCall) Header() http.Header { func (c *ObjectsBulkRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkrestoreobjectsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.bulkrestoreobjectsrequest) if err != nil { return nil, err } @@ -9662,8 +9605,7 @@ func (c *ObjectsComposeCall) Header() http.Header { func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.composerequest) if err != nil { return nil, err } @@ -9918,8 +9860,7 @@ func (c *ObjectsCopyCall) Header() http.Header { func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.object) if err != nil { return nil, err } @@ -10077,12 +10018,11 @@ func (c *ObjectsDeleteCall) Header() http.Header { func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10249,12 +10189,11 @@ func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10393,12 +10332,11 @@ func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10675,8 +10613,7 @@ func (c *ObjectsInsertCall) Header() http.Header { func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.object) if err != nil { return nil, err } @@ -10687,14 +10624,10 @@ func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1/b/{bucket}/o") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -10931,12 +10864,11 @@ func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11149,12 +11081,11 @@ func (c *ObjectsMoveCall) Header() http.Header { func (c *ObjectsMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{sourceObject}/moveTo/o/{destinationObject}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11354,8 +11285,7 @@ func (c *ObjectsPatchCall) Header() http.Header { func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.object2) if err != nil { return nil, err } @@ -11533,12 +11463,11 @@ func (c *ObjectsRestoreCall) Header() http.Header { func (c *ObjectsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11807,8 +11736,7 @@ func (c *ObjectsRewriteCall) Header() http.Header { func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.object) if err != nil { return nil, err } @@ -11932,8 +11860,7 @@ func (c *ObjectsSetIamPolicyCall) Header() http.Header { func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.policy) if err != nil { return nil, err } @@ -12067,12 +11994,11 @@ func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12272,8 +12198,7 @@ func (c *ObjectsUpdateCall) Header() http.Header { func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.object2) if err != nil { return nil, err } @@ -12462,8 +12387,7 @@ func (c *ObjectsWatchAllCall) Header() http.Header { func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -12570,8 +12494,7 @@ func (c *OperationsAdvanceRelocateBucketCall) Header() http.Header { func (c *OperationsAdvanceRelocateBucketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.advancerelocatebucketoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.advancerelocatebucketoperationrequest) if err != nil { return nil, err } @@ -12652,12 +12575,11 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/operations/{operationId}/cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12740,12 +12662,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/operations/{operationId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12873,12 +12794,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12999,12 +12919,11 @@ func (c *ProjectsHmacKeysCreateCall) Header() http.Header { func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13104,12 +13023,11 @@ func (c *ProjectsHmacKeysDeleteCall) Header() http.Header { func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13199,12 +13117,11 @@ func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13347,12 +13264,11 @@ func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13479,8 +13395,7 @@ func (c *ProjectsHmacKeysUpdateCall) Header() http.Header { func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hmackeymetadata) if err != nil { return nil, err } @@ -13600,12 +13515,11 @@ func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/storagetransfer/v1/storagetransfer-gen.go b/storagetransfer/v1/storagetransfer-gen.go index 55fe560d06e..a775b0e00b2 100644 --- a/storagetransfer/v1/storagetransfer-gen.go +++ b/storagetransfer/v1/storagetransfer-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.GoogleServiceAccounts = NewGoogleServiceAccountsService(s) + s.Projects = NewProjectsService(s) + s.TransferJobs = NewTransferJobsService(s) + s.TransferOperations = NewTransferOperationsService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.GoogleServiceAccounts = NewGoogleServiceAccountsService(s) - s.Projects = NewProjectsService(s) - s.TransferJobs = NewTransferJobsService(s) - s.TransferOperations = NewTransferOperationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2030,12 +2029,11 @@ func (c *GoogleServiceAccountsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/googleServiceAccounts/{projectId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2141,8 +2139,7 @@ func (c *ProjectsAgentPoolsCreateCall) Header() http.Header { func (c *ProjectsAgentPoolsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.agentpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentpool) if err != nil { return nil, err } @@ -2240,12 +2237,11 @@ func (c *ProjectsAgentPoolsDeleteCall) Header() http.Header { func (c *ProjectsAgentPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2347,12 +2343,11 @@ func (c *ProjectsAgentPoolsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2478,12 +2473,11 @@ func (c *ProjectsAgentPoolsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{+projectId}/agentPools") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2607,8 +2601,7 @@ func (c *ProjectsAgentPoolsPatchCall) Header() http.Header { func (c *ProjectsAgentPoolsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.agentpool) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentpool) if err != nil { return nil, err } @@ -2704,8 +2697,7 @@ func (c *TransferJobsCreateCall) Header() http.Header { func (c *TransferJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferjob) if err != nil { return nil, err } @@ -2803,12 +2795,11 @@ func (c *TransferJobsDeleteCall) Header() http.Header { func (c *TransferJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2912,12 +2903,11 @@ func (c *TransferJobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3044,12 +3034,11 @@ func (c *TransferJobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3163,8 +3152,7 @@ func (c *TransferJobsPatchCall) Header() http.Header { func (c *TransferJobsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatetransferjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatetransferjobrequest) if err != nil { return nil, err } @@ -3266,8 +3254,7 @@ func (c *TransferJobsRunCall) Header() http.Header { func (c *TransferJobsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtransferjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtransferjobrequest) if err != nil { return nil, err } @@ -3383,8 +3370,7 @@ func (c *TransferOperationsCancelCall) Header() http.Header { func (c *TransferOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3496,12 +3482,11 @@ func (c *TransferOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3634,12 +3619,11 @@ func (c *TransferOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3753,8 +3737,7 @@ func (c *TransferOperationsPauseCall) Header() http.Header { func (c *TransferOperationsPauseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausetransferoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausetransferoperationrequest) if err != nil { return nil, err } @@ -3854,8 +3837,7 @@ func (c *TransferOperationsResumeCall) Header() http.Header { func (c *TransferOperationsResumeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumetransferoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumetransferoperationrequest) if err != nil { return nil, err } diff --git a/streetviewpublish/v1/streetviewpublish-gen.go b/streetviewpublish/v1/streetviewpublish-gen.go index 5d9b98d76af..c97fc766ef5 100644 --- a/streetviewpublish/v1/streetviewpublish-gen.go +++ b/streetviewpublish/v1/streetviewpublish-gen.go @@ -114,7 +114,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Photo = NewPhotoService(s) + s.PhotoSequence = NewPhotoSequenceService(s) + s.PhotoSequences = NewPhotoSequencesService(s) + s.Photos = NewPhotosService(s) if err != nil { return nil, err } @@ -133,12 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Photo = NewPhotoService(s) - s.PhotoSequence = NewPhotoSequenceService(s) - s.PhotoSequences = NewPhotoSequencesService(s) - s.Photos = NewPhotosService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1335,8 +1334,7 @@ func (c *PhotoCreateCall) Header() http.Header { func (c *PhotoCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.photo) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.photo) if err != nil { return nil, err } @@ -1434,12 +1432,11 @@ func (c *PhotoDeleteCall) Header() http.Header { func (c *PhotoDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{photoId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1572,12 +1569,11 @@ func (c *PhotoGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{photoId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1675,8 +1671,7 @@ func (c *PhotoStartUploadCall) Header() http.Header { func (c *PhotoStartUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.empty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.empty) if err != nil { return nil, err } @@ -1797,8 +1792,7 @@ func (c *PhotoUpdateCall) Header() http.Header { func (c *PhotoUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.photo) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.photo) if err != nil { return nil, err } @@ -1917,8 +1911,7 @@ func (c *PhotoSequenceCreateCall) Header() http.Header { func (c *PhotoSequenceCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.photosequence) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.photosequence) if err != nil { return nil, err } @@ -2018,12 +2011,11 @@ func (c *PhotoSequenceDeleteCall) Header() http.Header { func (c *PhotoSequenceDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence/{sequenceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2160,12 +2152,11 @@ func (c *PhotoSequenceGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence/{sequenceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2256,8 +2247,7 @@ func (c *PhotoSequenceStartUploadCall) Header() http.Header { func (c *PhotoSequenceStartUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.empty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.empty) if err != nil { return nil, err } @@ -2392,12 +2382,11 @@ func (c *PhotoSequencesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2509,8 +2498,7 @@ func (c *PhotosBatchDeleteCall) Header() http.Header { func (c *PhotosBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletephotosrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletephotosrequest) if err != nil { return nil, err } @@ -2654,12 +2642,11 @@ func (c *PhotosBatchGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2756,8 +2743,7 @@ func (c *PhotosBatchUpdateCall) Header() http.Header { func (c *PhotosBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatephotosrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatephotosrequest) if err != nil { return nil, err } @@ -2915,12 +2901,11 @@ func (c *PhotosListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/sts/v1/sts-gen.go b/sts/v1/sts-gen.go index 93773a6df46..5d362a27832 100644 --- a/sts/v1/sts-gen.go +++ b/sts/v1/sts-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.V1 = NewV1Service(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.V1 = NewV1Service(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -746,8 +745,7 @@ func (c *V1TokenCall) Header() http.Header { func (c *V1TokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleidentitystsv1exchangetokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleidentitystsv1exchangetokenrequest) if err != nil { return nil, err } diff --git a/sts/v1beta/sts-gen.go b/sts/v1beta/sts-gen.go index 31ce5e6ef4b..d8809682ed5 100644 --- a/sts/v1beta/sts-gen.go +++ b/sts/v1beta/sts-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.V1beta = NewV1betaService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.V1beta = NewV1betaService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -726,8 +725,7 @@ func (c *V1betaTokenCall) Header() http.Header { func (c *V1betaTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleidentitystsv1betaexchangetokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleidentitystsv1betaexchangetokenrequest) if err != nil { return nil, err } diff --git a/tagmanager/v1/tagmanager-gen.go b/tagmanager/v1/tagmanager-gen.go index 1b667ee7f3b..c0ae9ab69db 100644 --- a/tagmanager/v1/tagmanager-gen.go +++ b/tagmanager/v1/tagmanager-gen.go @@ -144,7 +144,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -163,9 +164,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1869,12 +1868,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1972,12 +1970,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2074,8 +2071,7 @@ func (c *AccountsUpdateCall) Header() http.Header { func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -2175,8 +2171,7 @@ func (c *AccountsContainersCreateCall) Header() http.Header { func (c *AccountsContainersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.container) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.container) if err != nil { return nil, err } @@ -2277,12 +2272,11 @@ func (c *AccountsContainersDeleteCall) Header() http.Header { func (c *AccountsContainersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2365,12 +2359,11 @@ func (c *AccountsContainersGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2473,12 +2466,11 @@ func (c *AccountsContainersListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2581,8 +2573,7 @@ func (c *AccountsContainersUpdateCall) Header() http.Header { func (c *AccountsContainersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.container) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.container) if err != nil { return nil, err } @@ -2686,8 +2677,7 @@ func (c *AccountsContainersEnvironmentsCreateCall) Header() http.Header { func (c *AccountsContainersEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -2792,12 +2782,11 @@ func (c *AccountsContainersEnvironmentsDeleteCall) Header() http.Header { func (c *AccountsContainersEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2884,12 +2873,11 @@ func (c *AccountsContainersEnvironmentsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2996,12 +2984,11 @@ func (c *AccountsContainersEnvironmentsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3108,8 +3095,7 @@ func (c *AccountsContainersEnvironmentsUpdateCall) Header() http.Header { func (c *AccountsContainersEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -3214,8 +3200,7 @@ func (c *AccountsContainersFoldersCreateCall) Header() http.Header { func (c *AccountsContainersFoldersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -3320,12 +3305,11 @@ func (c *AccountsContainersFoldersDeleteCall) Header() http.Header { func (c *AccountsContainersFoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3412,12 +3396,11 @@ func (c *AccountsContainersFoldersGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3524,12 +3507,11 @@ func (c *AccountsContainersFoldersListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3636,8 +3618,7 @@ func (c *AccountsContainersFoldersUpdateCall) Header() http.Header { func (c *AccountsContainersFoldersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -3755,12 +3736,11 @@ func (c *AccountsContainersFoldersEntitiesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3881,8 +3861,7 @@ func (c *AccountsContainersMoveFoldersUpdateCall) Header() http.Header { func (c *AccountsContainersMoveFoldersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -3967,8 +3946,7 @@ func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) Header() http.Head func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -4073,8 +4051,7 @@ func (c *AccountsContainersTagsCreateCall) Header() http.Header { func (c *AccountsContainersTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -4179,12 +4156,11 @@ func (c *AccountsContainersTagsDeleteCall) Header() http.Header { func (c *AccountsContainersTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4271,12 +4247,11 @@ func (c *AccountsContainersTagsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4383,12 +4358,11 @@ func (c *AccountsContainersTagsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4495,8 +4469,7 @@ func (c *AccountsContainersTagsUpdateCall) Header() http.Header { func (c *AccountsContainersTagsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -4601,8 +4574,7 @@ func (c *AccountsContainersTriggersCreateCall) Header() http.Header { func (c *AccountsContainersTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trigger) if err != nil { return nil, err } @@ -4707,12 +4679,11 @@ func (c *AccountsContainersTriggersDeleteCall) Header() http.Header { func (c *AccountsContainersTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4799,12 +4770,11 @@ func (c *AccountsContainersTriggersGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4911,12 +4881,11 @@ func (c *AccountsContainersTriggersListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5023,8 +4992,7 @@ func (c *AccountsContainersTriggersUpdateCall) Header() http.Header { func (c *AccountsContainersTriggersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trigger) if err != nil { return nil, err } @@ -5129,8 +5097,7 @@ func (c *AccountsContainersVariablesCreateCall) Header() http.Header { func (c *AccountsContainersVariablesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variable) if err != nil { return nil, err } @@ -5235,12 +5202,11 @@ func (c *AccountsContainersVariablesDeleteCall) Header() http.Header { func (c *AccountsContainersVariablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5327,12 +5293,11 @@ func (c *AccountsContainersVariablesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5439,12 +5404,11 @@ func (c *AccountsContainersVariablesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5551,8 +5515,7 @@ func (c *AccountsContainersVariablesUpdateCall) Header() http.Header { func (c *AccountsContainersVariablesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variable) if err != nil { return nil, err } @@ -5657,8 +5620,7 @@ func (c *AccountsContainersVersionsCreateCall) Header() http.Header { func (c *AccountsContainersVersionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontainerversionrequestversionoptions) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcontainerversionrequestversionoptions) if err != nil { return nil, err } @@ -5764,12 +5726,11 @@ func (c *AccountsContainersVersionsDeleteCall) Header() http.Header { func (c *AccountsContainersVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5857,12 +5818,11 @@ func (c *AccountsContainersVersionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5984,12 +5944,11 @@ func (c *AccountsContainersVersionsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6094,12 +6053,11 @@ func (c *AccountsContainersVersionsPublishCall) Header() http.Header { func (c *AccountsContainersVersionsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6201,12 +6159,11 @@ func (c *AccountsContainersVersionsRestoreCall) Header() http.Header { func (c *AccountsContainersVersionsRestoreCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6305,12 +6262,11 @@ func (c *AccountsContainersVersionsUndeleteCall) Header() http.Header { func (c *AccountsContainersVersionsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6418,8 +6374,7 @@ func (c *AccountsContainersVersionsUpdateCall) Header() http.Header { func (c *AccountsContainersVersionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.containerversion) if err != nil { return nil, err } @@ -6522,8 +6477,7 @@ func (c *AccountsPermissionsCreateCall) Header() http.Header { func (c *AccountsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.useraccess) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.useraccess) if err != nil { return nil, err } @@ -6625,12 +6579,11 @@ func (c *AccountsPermissionsDeleteCall) Header() http.Header { func (c *AccountsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6713,12 +6666,11 @@ func (c *AccountsPermissionsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/permissions/{permissionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6822,12 +6774,11 @@ func (c *AccountsPermissionsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v1/accounts/{accountId}/permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6923,8 +6874,7 @@ func (c *AccountsPermissionsUpdateCall) Header() http.Header { func (c *AccountsPermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.useraccess) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.useraccess) if err != nil { return nil, err } diff --git a/tagmanager/v2/tagmanager-gen.go b/tagmanager/v2/tagmanager-gen.go index 40b48de087a..a218a007eb5 100644 --- a/tagmanager/v2/tagmanager-gen.go +++ b/tagmanager/v2/tagmanager-gen.go @@ -144,7 +144,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) if err != nil { return nil, err } @@ -163,9 +164,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Accounts = NewAccountsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3322,12 +3321,11 @@ func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3439,12 +3437,11 @@ func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3562,8 +3559,7 @@ func (c *AccountsUpdateCall) Header() http.Header { func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.account) if err != nil { return nil, err } @@ -3691,12 +3687,11 @@ func (c *AccountsContainersCombineCall) Header() http.Header { func (c *AccountsContainersCombineCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:combine") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3788,8 +3783,7 @@ func (c *AccountsContainersCreateCall) Header() http.Header { func (c *AccountsContainersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.container) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.container) if err != nil { return nil, err } @@ -3888,12 +3882,11 @@ func (c *AccountsContainersDeleteCall) Header() http.Header { func (c *AccountsContainersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3973,12 +3966,11 @@ func (c *AccountsContainersGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4087,12 +4079,11 @@ func (c *AccountsContainersListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/containers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4229,12 +4220,11 @@ func (c *AccountsContainersLookupCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/accounts/containers:lookup") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4368,12 +4358,11 @@ func (c *AccountsContainersMoveTagIdCall) Header() http.Header { func (c *AccountsContainersMoveTagIdCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:move_tag_id") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4476,12 +4465,11 @@ func (c *AccountsContainersSnippetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:snippet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4582,8 +4570,7 @@ func (c *AccountsContainersUpdateCall) Header() http.Header { func (c *AccountsContainersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.container) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.container) if err != nil { return nil, err } @@ -4695,12 +4682,11 @@ func (c *AccountsContainersDestinationsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4808,12 +4794,11 @@ func (c *AccountsContainersDestinationsLinkCall) Header() http.Header { func (c *AccountsContainersDestinationsLinkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/destinations:link") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4916,12 +4901,11 @@ func (c *AccountsContainersDestinationsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/destinations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5015,8 +4999,7 @@ func (c *AccountsContainersEnvironmentsCreateCall) Header() http.Header { func (c *AccountsContainersEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -5116,12 +5099,11 @@ func (c *AccountsContainersEnvironmentsDeleteCall) Header() http.Header { func (c *AccountsContainersEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5202,12 +5184,11 @@ func (c *AccountsContainersEnvironmentsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5317,12 +5298,11 @@ func (c *AccountsContainersEnvironmentsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5438,8 +5418,7 @@ func (c *AccountsContainersEnvironmentsReauthorizeCall) Header() http.Header { func (c *AccountsContainersEnvironmentsReauthorizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -5548,8 +5527,7 @@ func (c *AccountsContainersEnvironmentsUpdateCall) Header() http.Header { func (c *AccountsContainersEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.environment) if err != nil { return nil, err } @@ -5660,12 +5638,11 @@ func (c *AccountsContainersVersionHeadersLatestCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/version_headers:latest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5783,12 +5760,11 @@ func (c *AccountsContainersVersionHeadersListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/version_headers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5901,12 +5877,11 @@ func (c *AccountsContainersVersionsDeleteCall) Header() http.Header { func (c *AccountsContainersVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5994,12 +5969,11 @@ func (c *AccountsContainersVersionsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6103,12 +6077,11 @@ func (c *AccountsContainersVersionsLiveCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/versions:live") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6207,12 +6180,11 @@ func (c *AccountsContainersVersionsPublishCall) Header() http.Header { func (c *AccountsContainersVersionsPublishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:publish") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6305,12 +6277,11 @@ func (c *AccountsContainersVersionsSetLatestCall) Header() http.Header { func (c *AccountsContainersVersionsSetLatestCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:set_latest") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6402,12 +6373,11 @@ func (c *AccountsContainersVersionsUndeleteCall) Header() http.Header { func (c *AccountsContainersVersionsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6508,8 +6478,7 @@ func (c *AccountsContainersVersionsUpdateCall) Header() http.Header { func (c *AccountsContainersVersionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerversion) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.containerversion) if err != nil { return nil, err } @@ -6611,8 +6580,7 @@ func (c *AccountsContainersWorkspacesCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workspace) if err != nil { return nil, err } @@ -6715,8 +6683,7 @@ func (c *AccountsContainersWorkspacesCreateVersionCall) Header() http.Header { func (c *AccountsContainersWorkspacesCreateVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontainerversionrequestversionoptions) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcontainerversionrequestversionoptions) if err != nil { return nil, err } @@ -6816,12 +6783,11 @@ func (c *AccountsContainersWorkspacesDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6901,12 +6867,11 @@ func (c *AccountsContainersWorkspacesGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7009,12 +6974,11 @@ func (c *AccountsContainersWorkspacesGetStatusCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}/status") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7125,12 +7089,11 @@ func (c *AccountsContainersWorkspacesListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/workspaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7244,12 +7207,11 @@ func (c *AccountsContainersWorkspacesQuickPreviewCall) Header() http.Header { func (c *AccountsContainersWorkspacesQuickPreviewCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:quick_preview") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7352,8 +7314,7 @@ func (c *AccountsContainersWorkspacesResolveConflictCall) Header() http.Header { func (c *AccountsContainersWorkspacesResolveConflictCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.entity) if err != nil { return nil, err } @@ -7431,12 +7392,11 @@ func (c *AccountsContainersWorkspacesSyncCall) Header() http.Header { func (c *AccountsContainersWorkspacesSyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:sync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7537,8 +7497,7 @@ func (c *AccountsContainersWorkspacesUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workspace) if err != nil { return nil, err } @@ -7761,12 +7720,11 @@ func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Header() http.H func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/built_in_variables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -7983,12 +7941,11 @@ func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Header() http.H func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8075,12 +8032,11 @@ func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/built_in_variables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8318,12 +8274,11 @@ func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Header() http.H func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}/built_in_variables:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8417,8 +8372,7 @@ func (c *AccountsContainersWorkspacesClientsCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesClientsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client) if err != nil { return nil, err } @@ -8518,12 +8472,11 @@ func (c *AccountsContainersWorkspacesClientsDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesClientsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8604,12 +8557,11 @@ func (c *AccountsContainersWorkspacesClientsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8719,12 +8671,11 @@ func (c *AccountsContainersWorkspacesClientsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/clients") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8845,12 +8796,11 @@ func (c *AccountsContainersWorkspacesClientsRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesClientsRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -8952,8 +8902,7 @@ func (c *AccountsContainersWorkspacesClientsUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesClientsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client) if err != nil { return nil, err } @@ -9054,8 +9003,7 @@ func (c *AccountsContainersWorkspacesFoldersCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesFoldersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -9155,12 +9103,11 @@ func (c *AccountsContainersWorkspacesFoldersDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesFoldersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9236,12 +9183,11 @@ func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Header() http.Header { func (c *AccountsContainersWorkspacesFoldersEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:entities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9366,12 +9312,11 @@ func (c *AccountsContainersWorkspacesFoldersGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9481,12 +9426,11 @@ func (c *AccountsContainersWorkspacesFoldersListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/folders") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9625,8 +9569,7 @@ func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Header() h func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -9710,12 +9653,11 @@ func (c *AccountsContainersWorkspacesFoldersRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesFoldersRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -9817,8 +9759,7 @@ func (c *AccountsContainersWorkspacesFoldersUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesFoldersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.folder) if err != nil { return nil, err } @@ -9919,8 +9860,7 @@ func (c *AccountsContainersWorkspacesGtagConfigCreateCall) Header() http.Header func (c *AccountsContainersWorkspacesGtagConfigCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gtagconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gtagconfig) if err != nil { return nil, err } @@ -10020,12 +9960,11 @@ func (c *AccountsContainersWorkspacesGtagConfigDeleteCall) Header() http.Header func (c *AccountsContainersWorkspacesGtagConfigDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10106,12 +10045,11 @@ func (c *AccountsContainersWorkspacesGtagConfigGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10221,12 +10159,11 @@ func (c *AccountsContainersWorkspacesGtagConfigListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/gtag_config") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10349,8 +10286,7 @@ func (c *AccountsContainersWorkspacesGtagConfigUpdateCall) Header() http.Header func (c *AccountsContainersWorkspacesGtagConfigUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.gtagconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gtagconfig) if err != nil { return nil, err } @@ -10451,8 +10387,7 @@ func (c *AccountsContainersWorkspacesTagsCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesTagsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -10552,12 +10487,11 @@ func (c *AccountsContainersWorkspacesTagsDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesTagsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10638,12 +10572,11 @@ func (c *AccountsContainersWorkspacesTagsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10753,12 +10686,11 @@ func (c *AccountsContainersWorkspacesTagsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/tags") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10879,12 +10811,11 @@ func (c *AccountsContainersWorkspacesTagsRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesTagsRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -10986,8 +10917,7 @@ func (c *AccountsContainersWorkspacesTagsUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesTagsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tag) if err != nil { return nil, err } @@ -11088,8 +11018,7 @@ func (c *AccountsContainersWorkspacesTemplatesCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customtemplate) if err != nil { return nil, err } @@ -11189,12 +11118,11 @@ func (c *AccountsContainersWorkspacesTemplatesDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11275,12 +11203,11 @@ func (c *AccountsContainersWorkspacesTemplatesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11390,12 +11317,11 @@ func (c *AccountsContainersWorkspacesTemplatesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/templates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11516,12 +11442,11 @@ func (c *AccountsContainersWorkspacesTemplatesRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesTemplatesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11623,8 +11548,7 @@ func (c *AccountsContainersWorkspacesTemplatesUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.customtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.customtemplate) if err != nil { return nil, err } @@ -11725,8 +11649,7 @@ func (c *AccountsContainersWorkspacesTransformationsCreateCall) Header() http.He func (c *AccountsContainersWorkspacesTransformationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transformation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transformation) if err != nil { return nil, err } @@ -11826,12 +11749,11 @@ func (c *AccountsContainersWorkspacesTransformationsDeleteCall) Header() http.He func (c *AccountsContainersWorkspacesTransformationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11912,12 +11834,11 @@ func (c *AccountsContainersWorkspacesTransformationsGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12027,12 +11948,11 @@ func (c *AccountsContainersWorkspacesTransformationsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/transformations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12153,12 +12073,11 @@ func (c *AccountsContainersWorkspacesTransformationsRevertCall) Header() http.He func (c *AccountsContainersWorkspacesTransformationsRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12260,8 +12179,7 @@ func (c *AccountsContainersWorkspacesTransformationsUpdateCall) Header() http.He func (c *AccountsContainersWorkspacesTransformationsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transformation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transformation) if err != nil { return nil, err } @@ -12362,8 +12280,7 @@ func (c *AccountsContainersWorkspacesTriggersCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesTriggersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trigger) if err != nil { return nil, err } @@ -12463,12 +12380,11 @@ func (c *AccountsContainersWorkspacesTriggersDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12549,12 +12465,11 @@ func (c *AccountsContainersWorkspacesTriggersGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12664,12 +12579,11 @@ func (c *AccountsContainersWorkspacesTriggersListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/triggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12790,12 +12704,11 @@ func (c *AccountsContainersWorkspacesTriggersRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesTriggersRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12897,8 +12810,7 @@ func (c *AccountsContainersWorkspacesTriggersUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesTriggersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.trigger) if err != nil { return nil, err } @@ -12999,8 +12911,7 @@ func (c *AccountsContainersWorkspacesVariablesCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesVariablesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variable) if err != nil { return nil, err } @@ -13100,12 +13011,11 @@ func (c *AccountsContainersWorkspacesVariablesDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesVariablesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13186,12 +13096,11 @@ func (c *AccountsContainersWorkspacesVariablesGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13301,12 +13210,11 @@ func (c *AccountsContainersWorkspacesVariablesListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/variables") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13427,12 +13335,11 @@ func (c *AccountsContainersWorkspacesVariablesRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesVariablesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13534,8 +13441,7 @@ func (c *AccountsContainersWorkspacesVariablesUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesVariablesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.variable) if err != nil { return nil, err } @@ -13636,8 +13542,7 @@ func (c *AccountsContainersWorkspacesZonesCreateCall) Header() http.Header { func (c *AccountsContainersWorkspacesZonesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zone) if err != nil { return nil, err } @@ -13737,12 +13642,11 @@ func (c *AccountsContainersWorkspacesZonesDeleteCall) Header() http.Header { func (c *AccountsContainersWorkspacesZonesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13823,12 +13727,11 @@ func (c *AccountsContainersWorkspacesZonesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13938,12 +13841,11 @@ func (c *AccountsContainersWorkspacesZonesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/zones") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14064,12 +13966,11 @@ func (c *AccountsContainersWorkspacesZonesRevertCall) Header() http.Header { func (c *AccountsContainersWorkspacesZonesRevertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}:revert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -14171,8 +14072,7 @@ func (c *AccountsContainersWorkspacesZonesUpdateCall) Header() http.Header { func (c *AccountsContainersWorkspacesZonesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zone) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.zone) if err != nil { return nil, err } @@ -14272,8 +14172,7 @@ func (c *AccountsUserPermissionsCreateCall) Header() http.Header { func (c *AccountsUserPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userpermission) if err != nil { return nil, err } @@ -14373,12 +14272,11 @@ func (c *AccountsUserPermissionsDeleteCall) Header() http.Header { func (c *AccountsUserPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14458,12 +14356,11 @@ func (c *AccountsUserPermissionsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+path}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14573,12 +14470,11 @@ func (c *AccountsUserPermissionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tagmanager/v2/{+parent}/user_permissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14693,8 +14589,7 @@ func (c *AccountsUserPermissionsUpdateCall) Header() http.Header { func (c *AccountsUserPermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.userpermission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.userpermission) if err != nil { return nil, err } diff --git a/tasks/v1/tasks-gen.go b/tasks/v1/tasks-gen.go index 77014c64cd6..93b190b4f8d 100644 --- a/tasks/v1/tasks-gen.go +++ b/tasks/v1/tasks-gen.go @@ -123,7 +123,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Tasklists = NewTasklistsService(s) + s.Tasks = NewTasksService(s) if err != nil { return nil, err } @@ -142,10 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Tasklists = NewTasklistsService(s) - s.Tasks = NewTasksService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -522,12 +521,11 @@ func (c *TasklistsDeleteCall) Header() http.Header { func (c *TasklistsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/users/@me/lists/{tasklist}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -606,12 +604,11 @@ func (c *TasklistsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/users/@me/lists/{tasklist}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -700,8 +697,7 @@ func (c *TasklistsInsertCall) Header() http.Header { func (c *TasklistsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tasklist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tasklist) if err != nil { return nil, err } @@ -819,12 +815,11 @@ func (c *TasklistsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/users/@me/lists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -935,8 +930,7 @@ func (c *TasklistsPatchCall) Header() http.Header { func (c *TasklistsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tasklist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tasklist) if err != nil { return nil, err } @@ -1036,8 +1030,7 @@ func (c *TasklistsUpdateCall) Header() http.Header { func (c *TasklistsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tasklist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tasklist) if err != nil { return nil, err } @@ -1137,12 +1130,11 @@ func (c *TasksClearCall) Header() http.Header { func (c *TasksClearCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/lists/{tasklist}/clear") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1215,12 +1207,11 @@ func (c *TasksDeleteCall) Header() http.Header { func (c *TasksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/lists/{tasklist}/tasks/{task}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1303,12 +1294,11 @@ func (c *TasksGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/lists/{tasklist}/tasks/{task}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1421,8 +1411,7 @@ func (c *TasksInsertCall) Header() http.Header { func (c *TasksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.task) if err != nil { return nil, err } @@ -1619,12 +1608,11 @@ func (c *TasksListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/lists/{tasklist}/tasks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1768,12 +1756,11 @@ func (c *TasksMoveCall) Header() http.Header { func (c *TasksMoveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/v1/lists/{tasklist}/tasks/{task}/move") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -1869,8 +1856,7 @@ func (c *TasksPatchCall) Header() http.Header { func (c *TasksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.task) if err != nil { return nil, err } @@ -1974,8 +1960,7 @@ func (c *TasksUpdateCall) Header() http.Header { func (c *TasksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.task) if err != nil { return nil, err } diff --git a/testing/v1/testing-gen.go b/testing/v1/testing-gen.go index 1392d5240df..9f66175fcda 100644 --- a/testing/v1/testing-gen.go +++ b/testing/v1/testing-gen.go @@ -125,7 +125,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, if err != nil { return nil, err } - s, err := New(client) + s := &APIService{client: client, BasePath: basePath} + s.ApplicationDetailService = NewApplicationDetailServiceService(s) + s.Projects = NewProjectsService(s) + s.TestEnvironmentCatalog = NewTestEnvironmentCatalogService(s) if err != nil { return nil, err } @@ -144,11 +147,7 @@ func New(client *http.Client) (*APIService, error) { if client == nil { return nil, errors.New("client is nil") } - s := &APIService{client: client, BasePath: basePath} - s.ApplicationDetailService = NewApplicationDetailServiceService(s) - s.Projects = NewProjectsService(s) - s.TestEnvironmentCatalog = NewTestEnvironmentCatalogService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type APIService struct { @@ -3218,8 +3217,7 @@ func (c *ApplicationDetailServiceGetApkDetailsCall) Header() http.Header { func (c *ApplicationDetailServiceGetApkDetailsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.filereference) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.filereference) if err != nil { return nil, err } @@ -3322,8 +3320,7 @@ func (c *ProjectsDeviceSessionsCancelCall) Header() http.Header { func (c *ProjectsDeviceSessionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceldevicesessionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceldevicesessionrequest) if err != nil { return nil, err } @@ -3424,8 +3421,7 @@ func (c *ProjectsDeviceSessionsCreateCall) Header() http.Header { func (c *ProjectsDeviceSessionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicesession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.devicesession) if err != nil { return nil, err } @@ -3539,12 +3535,11 @@ func (c *ProjectsDeviceSessionsGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3668,12 +3663,11 @@ func (c *ProjectsDeviceSessionsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deviceSessions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3798,8 +3792,7 @@ func (c *ProjectsDeviceSessionsPatchCall) Header() http.Header { func (c *ProjectsDeviceSessionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicesession) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.devicesession) if err != nil { return nil, err } @@ -3905,12 +3898,11 @@ func (c *ProjectsTestMatricesCancelCall) Header() http.Header { func (c *ProjectsTestMatricesCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -4021,8 +4013,7 @@ func (c *ProjectsTestMatricesCreateCall) Header() http.Header { func (c *ProjectsTestMatricesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testmatrix) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testmatrix) if err != nil { return nil, err } @@ -4142,12 +4133,11 @@ func (c *ProjectsTestMatricesGetCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/testMatrices/{testMatrixId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4260,12 +4250,11 @@ func (c *TestEnvironmentCatalogGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/testEnvironmentCatalog/{environmentType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/texttospeech/v1/texttospeech-gen.go b/texttospeech/v1/texttospeech-gen.go index 8f0c1059eb2..cbf935272d4 100644 --- a/texttospeech/v1/texttospeech-gen.go +++ b/texttospeech/v1/texttospeech-gen.go @@ -117,7 +117,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.Text = NewTextService(s) + s.Voices = NewVoicesService(s) if err != nil { return nil, err } @@ -136,12 +140,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.Text = NewTextService(s) - s.Voices = NewVoicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1015,8 +1014,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -1117,12 +1115,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1215,8 +1212,7 @@ func (c *ProjectsLocationsSynthesizeLongAudioCall) Header() http.Header { func (c *ProjectsLocationsSynthesizeLongAudioCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.synthesizelongaudiorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.synthesizelongaudiorequest) if err != nil { return nil, err } @@ -1328,12 +1324,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1456,12 +1451,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1572,8 +1566,7 @@ func (c *TextSynthesizeCall) Header() http.Header { func (c *TextSynthesizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.synthesizespeechrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.synthesizespeechrequest) if err != nil { return nil, err } @@ -1689,12 +1682,11 @@ func (c *VoicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/voices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/texttospeech/v1beta1/texttospeech-gen.go b/texttospeech/v1beta1/texttospeech-gen.go index a6e7dfab30a..5c6e8994c6f 100644 --- a/texttospeech/v1beta1/texttospeech-gen.go +++ b/texttospeech/v1beta1/texttospeech-gen.go @@ -117,7 +117,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.Text = NewTextService(s) + s.Voices = NewVoicesService(s) if err != nil { return nil, err } @@ -136,11 +139,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - s.Text = NewTextService(s) - s.Voices = NewVoicesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1038,8 +1037,7 @@ func (c *ProjectsLocationsSynthesizeLongAudioCall) Header() http.Header { func (c *ProjectsLocationsSynthesizeLongAudioCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.synthesizelongaudiorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.synthesizelongaudiorequest) if err != nil { return nil, err } @@ -1151,12 +1149,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1279,12 +1276,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1395,8 +1391,7 @@ func (c *TextSynthesizeCall) Header() http.Header { func (c *TextSynthesizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.synthesizespeechrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.synthesizespeechrequest) if err != nil { return nil, err } @@ -1512,12 +1507,11 @@ func (c *VoicesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/voices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/toolresults/v1beta3/toolresults-gen.go b/toolresults/v1beta3/toolresults-gen.go index 525ff353df2..194d804854b 100644 --- a/toolresults/v1beta3/toolresults-gen.go +++ b/toolresults/v1beta3/toolresults-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3703,12 +3702,11 @@ func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3817,12 +3815,11 @@ func (c *ProjectsInitializeSettingsCall) Header() http.Header { func (c *ProjectsInitializeSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}:initializeSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3926,8 +3923,7 @@ func (c *ProjectsHistoriesCreateCall) Header() http.Header { func (c *ProjectsHistoriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.history) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.history) if err != nil { return nil, err } @@ -4043,12 +4039,11 @@ func (c *ProjectsHistoriesGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4179,12 +4174,11 @@ func (c *ProjectsHistoriesListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4313,8 +4307,7 @@ func (c *ProjectsHistoriesExecutionsCreateCall) Header() http.Header { func (c *ProjectsHistoriesExecutionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.execution) if err != nil { return nil, err } @@ -4434,12 +4427,11 @@ func (c *ProjectsHistoriesExecutionsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4566,12 +4558,11 @@ func (c *ProjectsHistoriesExecutionsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4704,8 +4695,7 @@ func (c *ProjectsHistoriesExecutionsPatchCall) Header() http.Header { func (c *ProjectsHistoriesExecutionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.execution) if err != nil { return nil, err } @@ -4826,12 +4816,11 @@ func (c *ProjectsHistoriesExecutionsClustersGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4948,12 +4937,11 @@ func (c *ProjectsHistoriesExecutionsClustersListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5070,12 +5058,11 @@ func (c *ProjectsHistoriesExecutionsEnvironmentsGetCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/environments/{environmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5205,12 +5192,11 @@ func (c *ProjectsHistoriesExecutionsEnvironmentsListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/environments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5353,12 +5339,11 @@ func (c *ProjectsHistoriesExecutionsStepsAccessibilityClustersCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/{+name}:accessibilityClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5469,8 +5454,7 @@ func (c *ProjectsHistoriesExecutionsStepsCreateCall) Header() http.Header { func (c *ProjectsHistoriesExecutionsStepsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.step) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.step) if err != nil { return nil, err } @@ -5594,12 +5578,11 @@ func (c *ProjectsHistoriesExecutionsStepsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5715,12 +5698,11 @@ func (c *ProjectsHistoriesExecutionsStepsGetPerfMetricsSummaryCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5854,12 +5836,11 @@ func (c *ProjectsHistoriesExecutionsStepsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5998,8 +5979,7 @@ func (c *ProjectsHistoriesExecutionsStepsPatchCall) Header() http.Header { func (c *ProjectsHistoriesExecutionsStepsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.step) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.step) if err != nil { return nil, err } @@ -6116,8 +6096,7 @@ func (c *ProjectsHistoriesExecutionsStepsPublishXunitXmlFilesCall) Header() http func (c *ProjectsHistoriesExecutionsStepsPublishXunitXmlFilesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishxunitxmlfilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.publishxunitxmlfilesrequest) if err != nil { return nil, err } @@ -6231,8 +6210,7 @@ func (c *ProjectsHistoriesExecutionsStepsPerfMetricsSummaryCreateCall) Header() func (c *ProjectsHistoriesExecutionsStepsPerfMetricsSummaryCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.perfmetricssummary) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.perfmetricssummary) if err != nil { return nil, err } @@ -6347,8 +6325,7 @@ func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesCreateCall) Header() ht func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.perfsampleseries) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.perfsampleseries) if err != nil { return nil, err } @@ -6475,12 +6452,11 @@ func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesGetCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6615,12 +6591,11 @@ func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6735,8 +6710,7 @@ func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamplesBatchCreateCall) func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamplesBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateperfsamplesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreateperfsamplesrequest) if err != nil { return nil, err } @@ -6886,12 +6860,11 @@ func (c *ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamplesListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7035,12 +7008,11 @@ func (c *ProjectsHistoriesExecutionsStepsTestCasesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/testCases/{testCaseId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7174,12 +7146,11 @@ func (c *ProjectsHistoriesExecutionsStepsTestCasesListCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/testCases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7334,12 +7305,11 @@ func (c *ProjectsHistoriesExecutionsStepsThumbnailsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/thumbnails") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/tpu/v1/tpu-gen.go b/tpu/v1/tpu-gen.go index 17b4895f56e..d0a26ae3951 100644 --- a/tpu/v1/tpu-gen.go +++ b/tpu/v1/tpu-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -875,12 +874,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1006,12 +1004,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1135,12 +1132,11 @@ func (c *ProjectsLocationsAcceleratorTypesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1269,12 +1265,11 @@ func (c *ProjectsLocationsAcceleratorTypesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1394,8 +1389,7 @@ func (c *ProjectsLocationsNodesCreateCall) Header() http.Header { func (c *ProjectsLocationsNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.node) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.node) if err != nil { return nil, err } @@ -1493,12 +1487,11 @@ func (c *ProjectsLocationsNodesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1600,12 +1593,11 @@ func (c *ProjectsLocationsNodesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1721,12 +1713,11 @@ func (c *ProjectsLocationsNodesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1840,8 +1831,7 @@ func (c *ProjectsLocationsNodesReimageCall) Header() http.Header { func (c *ProjectsLocationsNodesReimageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reimagenoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reimagenoderequest) if err != nil { return nil, err } @@ -1941,8 +1931,7 @@ func (c *ProjectsLocationsNodesStartCall) Header() http.Header { func (c *ProjectsLocationsNodesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startnoderequest) if err != nil { return nil, err } @@ -2042,8 +2031,7 @@ func (c *ProjectsLocationsNodesStopCall) Header() http.Header { func (c *ProjectsLocationsNodesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopnoderequest) if err != nil { return nil, err } @@ -2149,12 +2137,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2247,12 +2234,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2356,12 +2342,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2484,12 +2469,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2613,12 +2597,11 @@ func (c *ProjectsLocationsTensorflowVersionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2747,12 +2730,11 @@ func (c *ProjectsLocationsTensorflowVersionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tensorflowVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/tpu/v1alpha1/tpu-gen.go b/tpu/v1alpha1/tpu-gen.go index be8da7026da..475ab177254 100644 --- a/tpu/v1alpha1/tpu-gen.go +++ b/tpu/v1alpha1/tpu-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -875,12 +874,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1006,12 +1004,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1135,12 +1132,11 @@ func (c *ProjectsLocationsAcceleratorTypesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1269,12 +1265,11 @@ func (c *ProjectsLocationsAcceleratorTypesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1400,8 +1395,7 @@ func (c *ProjectsLocationsNodesCreateCall) Header() http.Header { func (c *ProjectsLocationsNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.node) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.node) if err != nil { return nil, err } @@ -1505,12 +1499,11 @@ func (c *ProjectsLocationsNodesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1612,12 +1605,11 @@ func (c *ProjectsLocationsNodesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1733,12 +1725,11 @@ func (c *ProjectsLocationsNodesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1852,8 +1843,7 @@ func (c *ProjectsLocationsNodesReimageCall) Header() http.Header { func (c *ProjectsLocationsNodesReimageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reimagenoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reimagenoderequest) if err != nil { return nil, err } @@ -1953,8 +1943,7 @@ func (c *ProjectsLocationsNodesStartCall) Header() http.Header { func (c *ProjectsLocationsNodesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startnoderequest) if err != nil { return nil, err } @@ -2054,8 +2043,7 @@ func (c *ProjectsLocationsNodesStopCall) Header() http.Header { func (c *ProjectsLocationsNodesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopnoderequest) if err != nil { return nil, err } @@ -2161,12 +2149,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -2259,12 +2246,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2368,12 +2354,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2496,12 +2481,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2625,12 +2609,11 @@ func (c *ProjectsLocationsTensorflowVersionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2759,12 +2742,11 @@ func (c *ProjectsLocationsTensorflowVersionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/tensorflowVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/tpu/v2/tpu-gen.go b/tpu/v2/tpu-gen.go index 54a7d717e25..e6ca0782125 100644 --- a/tpu/v2/tpu-gen.go +++ b/tpu/v2/tpu-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1604,8 +1603,7 @@ func (c *ProjectsLocationsGenerateServiceIdentityCall) Header() http.Header { func (c *ProjectsLocationsGenerateServiceIdentityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateserviceidentityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateserviceidentityrequest) if err != nil { return nil, err } @@ -1716,12 +1714,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1847,12 +1844,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1976,12 +1972,11 @@ func (c *ProjectsLocationsAcceleratorTypesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2110,12 +2105,11 @@ func (c *ProjectsLocationsAcceleratorTypesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2235,8 +2229,7 @@ func (c *ProjectsLocationsNodesCreateCall) Header() http.Header { func (c *ProjectsLocationsNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.node) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.node) if err != nil { return nil, err } @@ -2334,12 +2327,11 @@ func (c *ProjectsLocationsNodesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2441,12 +2433,11 @@ func (c *ProjectsLocationsNodesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2538,8 +2529,7 @@ func (c *ProjectsLocationsNodesGetGuestAttributesCall) Header() http.Header { func (c *ProjectsLocationsNodesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getguestattributesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getguestattributesrequest) if err != nil { return nil, err } @@ -2664,12 +2654,11 @@ func (c *ProjectsLocationsNodesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2791,8 +2780,7 @@ func (c *ProjectsLocationsNodesPatchCall) Header() http.Header { func (c *ProjectsLocationsNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.node) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.node) if err != nil { return nil, err } @@ -2892,8 +2880,7 @@ func (c *ProjectsLocationsNodesStartCall) Header() http.Header { func (c *ProjectsLocationsNodesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startnoderequest) if err != nil { return nil, err } @@ -2993,8 +2980,7 @@ func (c *ProjectsLocationsNodesStopCall) Header() http.Header { func (c *ProjectsLocationsNodesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopnoderequest) if err != nil { return nil, err } @@ -3100,12 +3086,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3198,12 +3183,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3307,12 +3291,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3435,12 +3418,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3568,8 +3550,7 @@ func (c *ProjectsLocationsQueuedResourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuedResourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queuedresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queuedresource) if err != nil { return nil, err } @@ -3683,12 +3664,11 @@ func (c *ProjectsLocationsQueuedResourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuedResourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3790,12 +3770,11 @@ func (c *ProjectsLocationsQueuedResourcesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3911,12 +3890,11 @@ func (c *ProjectsLocationsQueuedResourcesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/queuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4030,8 +4008,7 @@ func (c *ProjectsLocationsQueuedResourcesResetCall) Header() http.Header { func (c *ProjectsLocationsQueuedResourcesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetqueuedresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetqueuedresourcerequest) if err != nil { return nil, err } @@ -4141,12 +4118,11 @@ func (c *ProjectsLocationsRuntimeVersionsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4274,12 +4250,11 @@ func (c *ProjectsLocationsRuntimeVersionsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/runtimeVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/tpu/v2alpha1/tpu-gen.go b/tpu/v2alpha1/tpu-gen.go index 6b3e2964df3..bc8bb030156 100644 --- a/tpu/v2alpha1/tpu-gen.go +++ b/tpu/v2alpha1/tpu-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1910,8 +1909,7 @@ func (c *ProjectsLocationsGenerateServiceIdentityCall) Header() http.Header { func (c *ProjectsLocationsGenerateServiceIdentityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateserviceidentityrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateserviceidentityrequest) if err != nil { return nil, err } @@ -2022,12 +2020,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2153,12 +2150,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2282,12 +2278,11 @@ func (c *ProjectsLocationsAcceleratorTypesGetCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2416,12 +2411,11 @@ func (c *ProjectsLocationsAcceleratorTypesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/acceleratorTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2547,8 +2541,7 @@ func (c *ProjectsLocationsNodesCreateCall) Header() http.Header { func (c *ProjectsLocationsNodesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.node) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.node) if err != nil { return nil, err } @@ -2652,12 +2645,11 @@ func (c *ProjectsLocationsNodesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNodesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2759,12 +2751,11 @@ func (c *ProjectsLocationsNodesGetCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2856,8 +2847,7 @@ func (c *ProjectsLocationsNodesGetGuestAttributesCall) Header() http.Header { func (c *ProjectsLocationsNodesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getguestattributesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.getguestattributesrequest) if err != nil { return nil, err } @@ -2982,12 +2972,11 @@ func (c *ProjectsLocationsNodesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3109,8 +3098,7 @@ func (c *ProjectsLocationsNodesPatchCall) Header() http.Header { func (c *ProjectsLocationsNodesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.node) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.node) if err != nil { return nil, err } @@ -3210,8 +3198,7 @@ func (c *ProjectsLocationsNodesPerformMaintenanceCall) Header() http.Header { func (c *ProjectsLocationsNodesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.performmaintenancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.performmaintenancerequest) if err != nil { return nil, err } @@ -3311,8 +3298,7 @@ func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) Header() http.Heade func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatemaintenanceeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.simulatemaintenanceeventrequest) if err != nil { return nil, err } @@ -3412,8 +3398,7 @@ func (c *ProjectsLocationsNodesStartCall) Header() http.Header { func (c *ProjectsLocationsNodesStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startnoderequest) if err != nil { return nil, err } @@ -3513,8 +3498,7 @@ func (c *ProjectsLocationsNodesStopCall) Header() http.Header { func (c *ProjectsLocationsNodesStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopnoderequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopnoderequest) if err != nil { return nil, err } @@ -3620,12 +3604,11 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -3718,12 +3701,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3827,12 +3809,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3955,12 +3936,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4088,8 +4068,7 @@ func (c *ProjectsLocationsQueuedResourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsQueuedResourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.queuedresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.queuedresource) if err != nil { return nil, err } @@ -4203,12 +4182,11 @@ func (c *ProjectsLocationsQueuedResourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsQueuedResourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4310,12 +4288,11 @@ func (c *ProjectsLocationsQueuedResourcesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4431,12 +4408,11 @@ func (c *ProjectsLocationsQueuedResourcesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/queuedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4552,8 +4528,7 @@ func (c *ProjectsLocationsQueuedResourcesPerformMaintenanceQueuedResourceCall) H func (c *ProjectsLocationsQueuedResourcesPerformMaintenanceQueuedResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.performmaintenancequeuedresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.performmaintenancequeuedresourcerequest) if err != nil { return nil, err } @@ -4653,8 +4628,7 @@ func (c *ProjectsLocationsQueuedResourcesResetCall) Header() http.Header { func (c *ProjectsLocationsQueuedResourcesResetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetqueuedresourcerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetqueuedresourcerequest) if err != nil { return nil, err } @@ -4779,12 +4753,11 @@ func (c *ProjectsLocationsReservationsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/reservations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4908,12 +4881,11 @@ func (c *ProjectsLocationsRuntimeVersionsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5041,12 +5013,11 @@ func (c *ProjectsLocationsRuntimeVersionsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/runtimeVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/trafficdirector/v2/trafficdirector-gen.go b/trafficdirector/v2/trafficdirector-gen.go index ccc2a0ee4c4..18e17f54063 100644 --- a/trafficdirector/v2/trafficdirector-gen.go +++ b/trafficdirector/v2/trafficdirector-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Discovery = NewDiscoveryService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Discovery = NewDiscoveryService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1351,8 +1350,7 @@ func (c *DiscoveryClientStatusCall) Header() http.Header { func (c *DiscoveryClientStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientstatusrequest) if err != nil { return nil, err } diff --git a/trafficdirector/v3/trafficdirector-gen.go b/trafficdirector/v3/trafficdirector-gen.go index 7a7f1ff518e..4da147aa4ad 100644 --- a/trafficdirector/v3/trafficdirector-gen.go +++ b/trafficdirector/v3/trafficdirector-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Discovery = NewDiscoveryService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Discovery = NewDiscoveryService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1776,8 +1775,7 @@ func (c *DiscoveryClientStatusCall) Header() http.Header { func (c *DiscoveryClientStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientstatusrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientstatusrequest) if err != nil { return nil, err } diff --git a/transcoder/v1/transcoder-gen.go b/transcoder/v1/transcoder-gen.go index b69b4a14e19..9b4b7e2a5b8 100644 --- a/transcoder/v1/transcoder-gen.go +++ b/transcoder/v1/transcoder-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2283,8 +2282,7 @@ func (c *ProjectsLocationsJobTemplatesCreateCall) Header() http.Header { func (c *ProjectsLocationsJobTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.jobtemplate) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.jobtemplate) if err != nil { return nil, err } @@ -2391,12 +2389,11 @@ func (c *ProjectsLocationsJobTemplatesDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2499,12 +2496,11 @@ func (c *ProjectsLocationsJobTemplatesGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2635,12 +2631,11 @@ func (c *ProjectsLocationsJobTemplatesListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2755,8 +2750,7 @@ func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -2863,12 +2857,11 @@ func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2971,12 +2964,11 @@ func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3106,12 +3098,11 @@ func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, e if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/translate/v2/translate-gen.go b/translate/v2/translate-gen.go index f1ff75a4d81..f914a3c6837 100644 --- a/translate/v2/translate-gen.go +++ b/translate/v2/translate-gen.go @@ -123,7 +123,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Detections = NewDetectionsService(s) + s.Languages = NewLanguagesService(s) + s.Translations = NewTranslationsService(s) if err != nil { return nil, err } @@ -142,11 +145,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Detections = NewDetectionsService(s) - s.Languages = NewLanguagesService(s) - s.Translations = NewTranslationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -505,8 +504,7 @@ func (c *DetectionsDetectCall) Header() http.Header { func (c *DetectionsDetectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithDataWrapper.JSONReader(c.detectlanguagerequest) + body, err := googleapi.WithDataWrapper.JSONBuffer(c.detectlanguagerequest) if err != nil { return nil, err } @@ -618,12 +616,11 @@ func (c *DetectionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/detect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -736,12 +733,11 @@ func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/languages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -889,12 +885,11 @@ func (c *TranslationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -982,8 +977,7 @@ func (c *TranslationsTranslateCall) Header() http.Header { func (c *TranslationsTranslateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithDataWrapper.JSONReader(c.translatetextrequest) + body, err := googleapi.WithDataWrapper.JSONBuffer(c.translatetextrequest) if err != nil { return nil, err } diff --git a/translate/v3/translate-gen.go b/translate/v3/translate-gen.go index 304e754888e..cf0f801bf51 100644 --- a/translate/v3/translate-gen.go +++ b/translate/v3/translate-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2737,8 +2736,7 @@ func (c *ProjectsDetectLanguageCall) Header() http.Header { func (c *ProjectsDetectLanguageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detectlanguagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detectlanguagerequest) if err != nil { return nil, err } @@ -2878,12 +2876,11 @@ func (c *ProjectsGetSupportedLanguagesCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/supportedLanguages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2981,8 +2978,7 @@ func (c *ProjectsRomanizeTextCall) Header() http.Header { func (c *ProjectsRomanizeTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.romanizetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.romanizetextrequest) if err != nil { return nil, err } @@ -3090,8 +3086,7 @@ func (c *ProjectsTranslateTextCall) Header() http.Header { func (c *ProjectsTranslateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.translatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.translatetextrequest) if err != nil { return nil, err } @@ -3193,8 +3188,7 @@ func (c *ProjectsLocationsAdaptiveMtTranslateCall) Header() http.Header { func (c *ProjectsLocationsAdaptiveMtTranslateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adaptivemttranslaterequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adaptivemttranslaterequest) if err != nil { return nil, err } @@ -3304,8 +3298,7 @@ func (c *ProjectsLocationsBatchTranslateDocumentCall) Header() http.Header { func (c *ProjectsLocationsBatchTranslateDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchtranslatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchtranslatedocumentrequest) if err != nil { return nil, err } @@ -3414,8 +3407,7 @@ func (c *ProjectsLocationsBatchTranslateTextCall) Header() http.Header { func (c *ProjectsLocationsBatchTranslateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchtranslatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchtranslatetextrequest) if err != nil { return nil, err } @@ -3521,8 +3513,7 @@ func (c *ProjectsLocationsDetectLanguageCall) Header() http.Header { func (c *ProjectsLocationsDetectLanguageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detectlanguagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detectlanguagerequest) if err != nil { return nil, err } @@ -3633,12 +3624,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3769,12 +3759,11 @@ func (c *ProjectsLocationsGetSupportedLanguagesCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/supportedLanguages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3901,12 +3890,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4025,8 +4013,7 @@ func (c *ProjectsLocationsRomanizeTextCall) Header() http.Header { func (c *ProjectsLocationsRomanizeTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.romanizetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.romanizetextrequest) if err != nil { return nil, err } @@ -4133,8 +4120,7 @@ func (c *ProjectsLocationsTranslateDocumentCall) Header() http.Header { func (c *ProjectsLocationsTranslateDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.translatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.translatedocumentrequest) if err != nil { return nil, err } @@ -4242,8 +4228,7 @@ func (c *ProjectsLocationsTranslateTextCall) Header() http.Header { func (c *ProjectsLocationsTranslateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.translatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.translatetextrequest) if err != nil { return nil, err } @@ -4345,8 +4330,7 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsAdaptiveMtDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.adaptivemtdataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.adaptivemtdataset) if err != nil { return nil, err } @@ -4448,12 +4432,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsAdaptiveMtDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4557,12 +4540,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4658,8 +4640,7 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsImportAdaptiveMtFileCall) Header() h func (c *ProjectsLocationsAdaptiveMtDatasetsImportAdaptiveMtFileCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importadaptivemtfilerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importadaptivemtfilerequest) if err != nil { return nil, err } @@ -4797,12 +4778,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/adaptiveMtDatasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4916,12 +4896,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesDeleteCall) Header() func (c *ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5025,12 +5004,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesGetCall) doRequest(al if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5150,12 +5128,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesListCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/adaptiveMtFiles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5300,12 +5277,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentencesLi if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/adaptiveMtSentences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5450,12 +5426,11 @@ func (c *ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentencesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/adaptiveMtSentences") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5569,8 +5544,7 @@ func (c *ProjectsLocationsDatasetsCreateCall) Header() http.Header { func (c *ProjectsLocationsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dataset) if err != nil { return nil, err } @@ -5668,12 +5642,11 @@ func (c *ProjectsLocationsDatasetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5767,8 +5740,7 @@ func (c *ProjectsLocationsDatasetsExportDataCall) Header() http.Header { func (c *ProjectsLocationsDatasetsExportDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportdatarequest) if err != nil { return nil, err } @@ -5878,12 +5850,11 @@ func (c *ProjectsLocationsDatasetsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5977,8 +5948,7 @@ func (c *ProjectsLocationsDatasetsImportDataCall) Header() http.Header { func (c *ProjectsLocationsDatasetsImportDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdatarequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importdatarequest) if err != nil { return nil, err } @@ -6104,12 +6074,11 @@ func (c *ProjectsLocationsDatasetsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6257,12 +6226,11 @@ func (c *ProjectsLocationsDatasetsExamplesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/examples") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6377,8 +6345,7 @@ func (c *ProjectsLocationsGlossariesCreateCall) Header() http.Header { func (c *ProjectsLocationsGlossariesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.glossary) if err != nil { return nil, err } @@ -6477,12 +6444,11 @@ func (c *ProjectsLocationsGlossariesDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlossariesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6584,12 +6550,11 @@ func (c *ProjectsLocationsGlossariesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6730,12 +6695,11 @@ func (c *ProjectsLocationsGlossariesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6859,8 +6823,7 @@ func (c *ProjectsLocationsGlossariesPatchCall) Header() http.Header { func (c *ProjectsLocationsGlossariesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.glossary) if err != nil { return nil, err } @@ -6960,8 +6923,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Header() http.Hea func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossaryentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.glossaryentry) if err != nil { return nil, err } @@ -7059,12 +7021,11 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Header() http.Hea func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7166,12 +7127,11 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7291,12 +7251,11 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaryEntries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7411,8 +7370,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Header() http.Head func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossaryentry) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.glossaryentry) if err != nil { return nil, err } @@ -7513,8 +7471,7 @@ func (c *ProjectsLocationsModelsCreateCall) Header() http.Header { func (c *ProjectsLocationsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.model) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.model) if err != nil { return nil, err } @@ -7612,12 +7569,11 @@ func (c *ProjectsLocationsModelsDeleteCall) Header() http.Header { func (c *ProjectsLocationsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7719,12 +7675,11 @@ func (c *ProjectsLocationsModelsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7849,12 +7804,11 @@ func (c *ProjectsLocationsModelsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/models") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7976,8 +7930,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -8078,12 +8031,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8187,12 +8139,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8315,12 +8266,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8442,8 +8392,7 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.waitoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.waitoperationrequest) if err != nil { return nil, err } diff --git a/translate/v3beta1/translate-gen.go b/translate/v3beta1/translate-gen.go index 9d0d9b20dc1..46e89e23b54 100644 --- a/translate/v3beta1/translate-gen.go +++ b/translate/v3beta1/translate-gen.go @@ -126,7 +126,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,9 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1543,8 +1542,7 @@ func (c *ProjectsDetectLanguageCall) Header() http.Header { func (c *ProjectsDetectLanguageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detectlanguagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detectlanguagerequest) if err != nil { return nil, err } @@ -1684,12 +1682,11 @@ func (c *ProjectsGetSupportedLanguagesCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/supportedLanguages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1789,8 +1786,7 @@ func (c *ProjectsTranslateTextCall) Header() http.Header { func (c *ProjectsTranslateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.translatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.translatetextrequest) if err != nil { return nil, err } @@ -1900,8 +1896,7 @@ func (c *ProjectsLocationsBatchTranslateDocumentCall) Header() http.Header { func (c *ProjectsLocationsBatchTranslateDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchtranslatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchtranslatedocumentrequest) if err != nil { return nil, err } @@ -2010,8 +2005,7 @@ func (c *ProjectsLocationsBatchTranslateTextCall) Header() http.Header { func (c *ProjectsLocationsBatchTranslateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchtranslatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchtranslatetextrequest) if err != nil { return nil, err } @@ -2117,8 +2111,7 @@ func (c *ProjectsLocationsDetectLanguageCall) Header() http.Header { func (c *ProjectsLocationsDetectLanguageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.detectlanguagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.detectlanguagerequest) if err != nil { return nil, err } @@ -2229,12 +2222,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2365,12 +2357,11 @@ func (c *ProjectsLocationsGetSupportedLanguagesCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/supportedLanguages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2497,12 +2488,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2621,8 +2611,7 @@ func (c *ProjectsLocationsTranslateDocumentCall) Header() http.Header { func (c *ProjectsLocationsTranslateDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.translatedocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.translatedocumentrequest) if err != nil { return nil, err } @@ -2730,8 +2719,7 @@ func (c *ProjectsLocationsTranslateTextCall) Header() http.Header { func (c *ProjectsLocationsTranslateTextCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.translatetextrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.translatetextrequest) if err != nil { return nil, err } @@ -2833,8 +2821,7 @@ func (c *ProjectsLocationsGlossariesCreateCall) Header() http.Header { func (c *ProjectsLocationsGlossariesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.glossary) if err != nil { return nil, err } @@ -2933,12 +2920,11 @@ func (c *ProjectsLocationsGlossariesDeleteCall) Header() http.Header { func (c *ProjectsLocationsGlossariesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3040,12 +3026,11 @@ func (c *ProjectsLocationsGlossariesGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3186,12 +3171,11 @@ func (c *ProjectsLocationsGlossariesListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+parent}/glossaries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3313,8 +3297,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3415,12 +3398,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3524,12 +3506,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3652,12 +3633,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v3beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3779,8 +3759,7 @@ func (c *ProjectsLocationsOperationsWaitCall) Header() http.Header { func (c *ProjectsLocationsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.waitoperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.waitoperationrequest) if err != nil { return nil, err } diff --git a/travelimpactmodel/v1/travelimpactmodel-gen.go b/travelimpactmodel/v1/travelimpactmodel-gen.go index 22b87768e3e..5ed492933ce 100644 --- a/travelimpactmodel/v1/travelimpactmodel-gen.go +++ b/travelimpactmodel/v1/travelimpactmodel-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Flights = NewFlightsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Flights = NewFlightsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -426,8 +425,7 @@ func (c *FlightsComputeFlightEmissionsCall) Header() http.Header { func (c *FlightsComputeFlightEmissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.computeflightemissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.computeflightemissionsrequest) if err != nil { return nil, err } diff --git a/vault/v1/vault-gen.go b/vault/v1/vault-gen.go index 36c7a76d046..4536d24f2a5 100644 --- a/vault/v1/vault-gen.go +++ b/vault/v1/vault-gen.go @@ -123,7 +123,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Matters = NewMattersService(s) + s.Operations = NewOperationsService(s) if err != nil { return nil, err } @@ -142,10 +144,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Matters = NewMattersService(s) - s.Operations = NewOperationsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2267,8 +2266,7 @@ func (c *MattersAddPermissionsCall) Header() http.Header { func (c *MattersAddPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmatterpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmatterpermissionsrequest) if err != nil { return nil, err } @@ -2369,8 +2367,7 @@ func (c *MattersCloseCall) Header() http.Header { func (c *MattersCloseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.closematterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.closematterrequest) if err != nil { return nil, err } @@ -2471,8 +2468,7 @@ func (c *MattersCountCall) Header() http.Header { func (c *MattersCountCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.countartifactsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.countartifactsrequest) if err != nil { return nil, err } @@ -2570,8 +2566,7 @@ func (c *MattersCreateCall) Header() http.Header { func (c *MattersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.matter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.matter) if err != nil { return nil, err } @@ -2666,12 +2661,11 @@ func (c *MattersDeleteCall) Header() http.Header { func (c *MattersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2796,12 +2790,11 @@ func (c *MattersGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2950,12 +2943,11 @@ func (c *MattersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3066,8 +3058,7 @@ func (c *MattersRemovePermissionsCall) Header() http.Header { func (c *MattersRemovePermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removematterpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removematterpermissionsrequest) if err != nil { return nil, err } @@ -3167,8 +3158,7 @@ func (c *MattersReopenCall) Header() http.Header { func (c *MattersReopenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reopenmatterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reopenmatterrequest) if err != nil { return nil, err } @@ -3270,8 +3260,7 @@ func (c *MattersUndeleteCall) Header() http.Header { func (c *MattersUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletematterrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeletematterrequest) if err != nil { return nil, err } @@ -3373,8 +3362,7 @@ func (c *MattersUpdateCall) Header() http.Header { func (c *MattersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.matter) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.matter) if err != nil { return nil, err } @@ -3474,8 +3462,7 @@ func (c *MattersExportsCreateCall) Header() http.Header { func (c *MattersExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.export) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.export) if err != nil { return nil, err } @@ -3576,12 +3563,11 @@ func (c *MattersExportsDeleteCall) Header() http.Header { func (c *MattersExportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports/{exportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3687,12 +3673,11 @@ func (c *MattersExportsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports/{exportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3809,12 +3794,11 @@ func (c *MattersExportsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3933,8 +3917,7 @@ func (c *MattersHoldsAddHeldAccountsCall) Header() http.Header { func (c *MattersHoldsAddHeldAccountsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addheldaccountsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addheldaccountsrequest) if err != nil { return nil, err } @@ -4036,8 +4019,7 @@ func (c *MattersHoldsCreateCall) Header() http.Header { func (c *MattersHoldsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hold) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hold) if err != nil { return nil, err } @@ -4140,12 +4122,11 @@ func (c *MattersHoldsDeleteCall) Header() http.Header { func (c *MattersHoldsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4266,12 +4247,11 @@ func (c *MattersHoldsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4404,12 +4384,11 @@ func (c *MattersHoldsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4527,8 +4506,7 @@ func (c *MattersHoldsRemoveHeldAccountsCall) Header() http.Header { func (c *MattersHoldsRemoveHeldAccountsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeheldaccountsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeheldaccountsrequest) if err != nil { return nil, err } @@ -4636,8 +4614,7 @@ func (c *MattersHoldsUpdateCall) Header() http.Header { func (c *MattersHoldsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hold) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hold) if err != nil { return nil, err } @@ -4743,8 +4720,7 @@ func (c *MattersHoldsAccountsCreateCall) Header() http.Header { func (c *MattersHoldsAccountsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.heldaccount) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.heldaccount) if err != nil { return nil, err } @@ -4849,12 +4825,11 @@ func (c *MattersHoldsAccountsDeleteCall) Header() http.Header { func (c *MattersHoldsAccountsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4965,12 +4940,11 @@ func (c *MattersHoldsAccountsListCall) doRequest(alt string) (*http.Response, er if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5064,8 +5038,7 @@ func (c *MattersSavedQueriesCreateCall) Header() http.Header { func (c *MattersSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.savedquery) if err != nil { return nil, err } @@ -5166,12 +5139,11 @@ func (c *MattersSavedQueriesDeleteCall) Header() http.Header { func (c *MattersSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries/{savedQueryId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5277,12 +5249,11 @@ func (c *MattersSavedQueriesGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries/{savedQueryId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5400,12 +5371,11 @@ func (c *MattersSavedQueriesListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5527,8 +5497,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -5629,12 +5598,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5738,12 +5706,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5866,12 +5833,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/verifiedaccess/v1/verifiedaccess-gen.go b/verifiedaccess/v1/verifiedaccess-gen.go index a2ca2921bde..ef6e0134c7d 100644 --- a/verifiedaccess/v1/verifiedaccess-gen.go +++ b/verifiedaccess/v1/verifiedaccess-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Challenge = NewChallengeService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Challenge = NewChallengeService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -333,8 +332,7 @@ func (c *ChallengeCreateCall) Header() http.Header { func (c *ChallengeCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.empty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.empty) if err != nil { return nil, err } @@ -427,8 +425,7 @@ func (c *ChallengeVerifyCall) Header() http.Header { func (c *ChallengeVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifychallengeresponserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifychallengeresponserequest) if err != nil { return nil, err } diff --git a/verifiedaccess/v2/verifiedaccess-gen.go b/verifiedaccess/v2/verifiedaccess-gen.go index 2ff314ae8c8..1888c2d51f7 100644 --- a/verifiedaccess/v2/verifiedaccess-gen.go +++ b/verifiedaccess/v2/verifiedaccess-gen.go @@ -114,7 +114,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Challenge = NewChallengeService(s) if err != nil { return nil, err } @@ -133,9 +134,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Challenge = NewChallengeService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -562,8 +561,7 @@ func (c *ChallengeGenerateCall) Header() http.Header { func (c *ChallengeGenerateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.empty) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.empty) if err != nil { return nil, err } @@ -656,8 +654,7 @@ func (c *ChallengeVerifyCall) Header() http.Header { func (c *ChallengeVerifyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifychallengeresponserequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.verifychallengeresponserequest) if err != nil { return nil, err } diff --git a/versionhistory/v1/versionhistory-gen.go b/versionhistory/v1/versionhistory-gen.go index 12bf0be28ce..b6d6ab2d5ab 100644 --- a/versionhistory/v1/versionhistory-gen.go +++ b/versionhistory/v1/versionhistory-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Platforms = NewPlatformsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Platforms = NewPlatformsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -571,12 +570,11 @@ func (c *PlatformsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/platforms") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -717,12 +715,11 @@ func (c *PlatformsChannelsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -894,12 +891,11 @@ func (c *PlatformsChannelsVersionsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1076,12 +1072,11 @@ func (c *PlatformsChannelsVersionsReleasesListCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/videointelligence/v1/videointelligence-gen.go b/videointelligence/v1/videointelligence-gen.go index 8c52940208b..fdc9837898d 100644 --- a/videointelligence/v1/videointelligence-gen.go +++ b/videointelligence/v1/videointelligence-gen.go @@ -117,7 +117,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.Videos = NewVideosService(s) if err != nil { return nil, err } @@ -136,11 +139,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - s.Videos = NewVideosService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6862,12 +6861,11 @@ func (c *OperationsProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *OperationsProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -6961,12 +6959,11 @@ func (c *OperationsProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *OperationsProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7071,12 +7068,11 @@ func (c *OperationsProjectsLocationsOperationsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7177,8 +7173,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningCanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningCanceloperationrequest) if err != nil { return nil, err } @@ -7280,12 +7275,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7390,12 +7384,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7519,12 +7512,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7637,8 +7629,7 @@ func (c *VideosAnnotateCall) Header() http.Header { func (c *VideosAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvideointelligencev1Annotatevideorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvideointelligencev1Annotatevideorequest) if err != nil { return nil, err } diff --git a/videointelligence/v1beta2/videointelligence-gen.go b/videointelligence/v1beta2/videointelligence-gen.go index bd8eac9d400..b09de3ba478 100644 --- a/videointelligence/v1beta2/videointelligence-gen.go +++ b/videointelligence/v1beta2/videointelligence-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Videos = NewVideosService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Videos = NewVideosService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6727,8 +6726,7 @@ func (c *VideosAnnotateCall) Header() http.Header { func (c *VideosAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvideointelligencev1beta2Annotatevideorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvideointelligencev1beta2Annotatevideorequest) if err != nil { return nil, err } diff --git a/videointelligence/v1p1beta1/videointelligence-gen.go b/videointelligence/v1p1beta1/videointelligence-gen.go index 4780641d9a3..1a4f5ab60c2 100644 --- a/videointelligence/v1p1beta1/videointelligence-gen.go +++ b/videointelligence/v1p1beta1/videointelligence-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Videos = NewVideosService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Videos = NewVideosService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6727,8 +6726,7 @@ func (c *VideosAnnotateCall) Header() http.Header { func (c *VideosAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvideointelligencev1p1beta1Annotatevideorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvideointelligencev1p1beta1Annotatevideorequest) if err != nil { return nil, err } diff --git a/videointelligence/v1p2beta1/videointelligence-gen.go b/videointelligence/v1p2beta1/videointelligence-gen.go index f8551549af1..0cab0b4b0f5 100644 --- a/videointelligence/v1p2beta1/videointelligence-gen.go +++ b/videointelligence/v1p2beta1/videointelligence-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Videos = NewVideosService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Videos = NewVideosService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6727,8 +6726,7 @@ func (c *VideosAnnotateCall) Header() http.Header { func (c *VideosAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvideointelligencev1p2beta1Annotatevideorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvideointelligencev1p2beta1Annotatevideorequest) if err != nil { return nil, err } diff --git a/videointelligence/v1p3beta1/videointelligence-gen.go b/videointelligence/v1p3beta1/videointelligence-gen.go index 5b69665ce95..7a44f2979b7 100644 --- a/videointelligence/v1p3beta1/videointelligence-gen.go +++ b/videointelligence/v1p3beta1/videointelligence-gen.go @@ -117,7 +117,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Videos = NewVideosService(s) if err != nil { return nil, err } @@ -136,9 +137,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Videos = NewVideosService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -6728,8 +6727,7 @@ func (c *VideosAnnotateCall) Header() http.Header { func (c *VideosAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvideointelligencev1p3beta1Annotatevideorequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvideointelligencev1p3beta1Annotatevideorequest) if err != nil { return nil, err } diff --git a/vision/v1/vision-gen.go b/vision/v1/vision-gen.go index 60a9528bbaa..3082cec2e87 100644 --- a/vision/v1/vision-gen.go +++ b/vision/v1/vision-gen.go @@ -126,7 +126,12 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Files = NewFilesService(s) + s.Images = NewImagesService(s) + s.Locations = NewLocationsService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,13 +150,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Files = NewFilesService(s) - s.Images = NewImagesService(s) - s.Locations = NewLocationsService(s) - s.Operations = NewOperationsService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -11508,8 +11507,7 @@ func (c *FilesAnnotateCall) Header() http.Header { func (c *FilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchannotatefilesrequest) if err != nil { return nil, err } @@ -11608,8 +11606,7 @@ func (c *FilesAsyncBatchAnnotateCall) Header() http.Header { func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -11702,8 +11699,7 @@ func (c *ImagesAnnotateCall) Header() http.Header { func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchannotateimagesrequest) if err != nil { return nil, err } @@ -11803,8 +11799,7 @@ func (c *ImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -11913,12 +11908,11 @@ func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12018,8 +12012,7 @@ func (c *OperationsCancelCall) Header() http.Header { func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -12120,12 +12113,11 @@ func (c *OperationsDeleteCall) Header() http.Header { func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12229,12 +12221,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12357,12 +12348,11 @@ func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12485,8 +12475,7 @@ func (c *ProjectsFilesAnnotateCall) Header() http.Header { func (c *ProjectsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchannotatefilesrequest) if err != nil { return nil, err } @@ -12596,8 +12585,7 @@ func (c *ProjectsFilesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -12701,8 +12689,7 @@ func (c *ProjectsImagesAnnotateCall) Header() http.Header { func (c *ProjectsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchannotateimagesrequest) if err != nil { return nil, err } @@ -12813,8 +12800,7 @@ func (c *ProjectsImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -12923,8 +12909,7 @@ func (c *ProjectsLocationsFilesAnnotateCall) Header() http.Header { func (c *ProjectsLocationsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchannotatefilesrequest) if err != nil { return nil, err } @@ -13034,8 +13019,7 @@ func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -13139,8 +13123,7 @@ func (c *ProjectsLocationsImagesAnnotateCall) Header() http.Header { func (c *ProjectsLocationsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchannotateimagesrequest) if err != nil { return nil, err } @@ -13251,8 +13234,7 @@ func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -13364,12 +13346,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13465,8 +13446,7 @@ func (c *ProjectsLocationsProductSetsAddProductCall) Header() http.Header { func (c *ProjectsLocationsProductSetsAddProductCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addproducttoproductsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addproducttoproductsetrequest) if err != nil { return nil, err } @@ -13579,8 +13559,7 @@ func (c *ProjectsLocationsProductSetsCreateCall) Header() http.Header { func (c *ProjectsLocationsProductSetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productset) if err != nil { return nil, err } @@ -13681,12 +13660,11 @@ func (c *ProjectsLocationsProductSetsDeleteCall) Header() http.Header { func (c *ProjectsLocationsProductSetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13790,12 +13768,11 @@ func (c *ProjectsLocationsProductSetsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13895,8 +13872,7 @@ func (c *ProjectsLocationsProductSetsImportCall) Header() http.Header { func (c *ProjectsLocationsProductSetsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.importproductsetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importproductsetsrequest) if err != nil { return nil, err } @@ -14022,12 +13998,11 @@ func (c *ProjectsLocationsProductSetsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14154,8 +14129,7 @@ func (c *ProjectsLocationsProductSetsPatchCall) Header() http.Header { func (c *ProjectsLocationsProductSetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.productset) if err != nil { return nil, err } @@ -14256,8 +14230,7 @@ func (c *ProjectsLocationsProductSetsRemoveProductCall) Header() http.Header { func (c *ProjectsLocationsProductSetsRemoveProductCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeproductfromproductsetrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removeproductfromproductsetrequest) if err != nil { return nil, err } @@ -14385,12 +14358,11 @@ func (c *ProjectsLocationsProductSetsProductsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14519,8 +14491,7 @@ func (c *ProjectsLocationsProductsCreateCall) Header() http.Header { func (c *ProjectsLocationsProductsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.product) if err != nil { return nil, err } @@ -14622,12 +14593,11 @@ func (c *ProjectsLocationsProductsDeleteCall) Header() http.Header { func (c *ProjectsLocationsProductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14731,12 +14701,11 @@ func (c *ProjectsLocationsProductsGetCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14854,12 +14823,11 @@ func (c *ProjectsLocationsProductsListCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14992,8 +14960,7 @@ func (c *ProjectsLocationsProductsPatchCall) Header() http.Header { func (c *ProjectsLocationsProductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.product) if err != nil { return nil, err } @@ -15110,8 +15077,7 @@ func (c *ProjectsLocationsProductsPurgeCall) Header() http.Header { func (c *ProjectsLocationsProductsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgeproductsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.purgeproductsrequest) if err != nil { return nil, err } @@ -15234,8 +15200,7 @@ func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Header() http.Heade func (c *ProjectsLocationsProductsReferenceImagesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.referenceimage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.referenceimage) if err != nil { return nil, err } @@ -15338,12 +15303,11 @@ func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Header() http.Heade func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15448,12 +15412,11 @@ func (c *ProjectsLocationsProductsReferenceImagesGetCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15574,12 +15537,11 @@ func (c *ProjectsLocationsProductsReferenceImagesListCall) doRequest(alt string) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15705,12 +15667,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/vision/v1p1beta1/vision-gen.go b/vision/v1p1beta1/vision-gen.go index b5aaa0a6567..ae1b570ed07 100644 --- a/vision/v1p1beta1/vision-gen.go +++ b/vision/v1p1beta1/vision-gen.go @@ -126,7 +126,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Files = NewFilesService(s) + s.Images = NewImagesService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,11 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Files = NewFilesService(s) - s.Images = NewImagesService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -11023,8 +11022,7 @@ func (c *FilesAnnotateCall) Header() http.Header { func (c *FilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) if err != nil { return nil, err } @@ -11123,8 +11121,7 @@ func (c *FilesAsyncBatchAnnotateCall) Header() http.Header { func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -11217,8 +11214,7 @@ func (c *ImagesAnnotateCall) Header() http.Header { func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) if err != nil { return nil, err } @@ -11318,8 +11314,7 @@ func (c *ImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -11425,8 +11420,7 @@ func (c *ProjectsFilesAnnotateCall) Header() http.Header { func (c *ProjectsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) if err != nil { return nil, err } @@ -11536,8 +11530,7 @@ func (c *ProjectsFilesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -11641,8 +11634,7 @@ func (c *ProjectsImagesAnnotateCall) Header() http.Header { func (c *ProjectsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) if err != nil { return nil, err } @@ -11753,8 +11745,7 @@ func (c *ProjectsImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -11863,8 +11854,7 @@ func (c *ProjectsLocationsFilesAnnotateCall) Header() http.Header { func (c *ProjectsLocationsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) if err != nil { return nil, err } @@ -11974,8 +11964,7 @@ func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -12079,8 +12068,7 @@ func (c *ProjectsLocationsImagesAnnotateCall) Header() http.Header { func (c *ProjectsLocationsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) if err != nil { return nil, err } @@ -12191,8 +12179,7 @@ func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) if err != nil { return nil, err } diff --git a/vision/v1p2beta1/vision-gen.go b/vision/v1p2beta1/vision-gen.go index f6cd774549c..d5501016471 100644 --- a/vision/v1p2beta1/vision-gen.go +++ b/vision/v1p2beta1/vision-gen.go @@ -126,7 +126,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Files = NewFilesService(s) + s.Images = NewImagesService(s) + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -145,11 +148,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Files = NewFilesService(s) - s.Images = NewImagesService(s) - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -11023,8 +11022,7 @@ func (c *FilesAnnotateCall) Header() http.Header { func (c *FilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1batchannotatefilesrequest) if err != nil { return nil, err } @@ -11123,8 +11121,7 @@ func (c *FilesAsyncBatchAnnotateCall) Header() http.Header { func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -11217,8 +11214,7 @@ func (c *ImagesAnnotateCall) Header() http.Header { func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1batchannotateimagesrequest) if err != nil { return nil, err } @@ -11318,8 +11314,7 @@ func (c *ImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -11425,8 +11420,7 @@ func (c *ProjectsFilesAnnotateCall) Header() http.Header { func (c *ProjectsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1batchannotatefilesrequest) if err != nil { return nil, err } @@ -11536,8 +11530,7 @@ func (c *ProjectsFilesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -11641,8 +11634,7 @@ func (c *ProjectsImagesAnnotateCall) Header() http.Header { func (c *ProjectsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1batchannotateimagesrequest) if err != nil { return nil, err } @@ -11753,8 +11745,7 @@ func (c *ProjectsImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1asyncbatchannotateimagesrequest) if err != nil { return nil, err } @@ -11863,8 +11854,7 @@ func (c *ProjectsLocationsFilesAnnotateCall) Header() http.Header { func (c *ProjectsLocationsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1batchannotatefilesrequest) if err != nil { return nil, err } @@ -11974,8 +11964,7 @@ func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest) if err != nil { return nil, err } @@ -12079,8 +12068,7 @@ func (c *ProjectsLocationsImagesAnnotateCall) Header() http.Header { func (c *ProjectsLocationsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1batchannotateimagesrequest) if err != nil { return nil, err } @@ -12191,8 +12179,7 @@ func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Header() http.Header { func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotateimagesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudvisionv1p2beta1asyncbatchannotateimagesrequest) if err != nil { return nil, err } diff --git a/vmmigration/v1/vmmigration-gen.go b/vmmigration/v1/vmmigration-gen.go index cbe19a0d56d..ac0a0c32a4d 100644 --- a/vmmigration/v1/vmmigration-gen.go +++ b/vmmigration/v1/vmmigration-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4140,12 +4139,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4271,12 +4269,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4390,8 +4387,7 @@ func (c *ProjectsLocationsGroupsAddGroupMigrationCall) Header() http.Header { func (c *ProjectsLocationsGroupsAddGroupMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addgroupmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addgroupmigrationrequest) if err != nil { return nil, err } @@ -4514,8 +4510,7 @@ func (c *ProjectsLocationsGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -4629,12 +4624,11 @@ func (c *ProjectsLocationsGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4736,12 +4730,11 @@ func (c *ProjectsLocationsGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4874,12 +4867,11 @@ func (c *ProjectsLocationsGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5019,8 +5011,7 @@ func (c *ProjectsLocationsGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -5120,8 +5111,7 @@ func (c *ProjectsLocationsGroupsRemoveGroupMigrationCall) Header() http.Header { func (c *ProjectsLocationsGroupsRemoveGroupMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removegroupmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removegroupmigrationrequest) if err != nil { return nil, err } @@ -5246,8 +5236,7 @@ func (c *ProjectsLocationsImageImportsCreateCall) Header() http.Header { func (c *ProjectsLocationsImageImportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.imageimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.imageimport) if err != nil { return nil, err } @@ -5361,12 +5350,11 @@ func (c *ProjectsLocationsImageImportsDeleteCall) Header() http.Header { func (c *ProjectsLocationsImageImportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5468,12 +5456,11 @@ func (c *ProjectsLocationsImageImportsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5608,12 +5595,11 @@ func (c *ProjectsLocationsImageImportsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/imageImports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5727,8 +5713,7 @@ func (c *ProjectsLocationsImageImportsImageImportJobsCancelCall) Header() http.H func (c *ProjectsLocationsImageImportsImageImportJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelimageimportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelimageimportjobrequest) if err != nil { return nil, err } @@ -5838,12 +5823,11 @@ func (c *ProjectsLocationsImageImportsImageImportJobsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5978,12 +5962,11 @@ func (c *ProjectsLocationsImageImportsImageImportJobsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/imageImportJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6105,8 +6088,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6207,12 +6189,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6316,12 +6297,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6444,12 +6424,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6586,8 +6565,7 @@ func (c *ProjectsLocationsSourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -6701,12 +6679,11 @@ func (c *ProjectsLocationsSourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6839,12 +6816,11 @@ func (c *ProjectsLocationsSourcesFetchInventoryCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+source}:fetchInventory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6968,12 +6944,11 @@ func (c *ProjectsLocationsSourcesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7106,12 +7081,11 @@ func (c *ProjectsLocationsSourcesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7251,8 +7225,7 @@ func (c *ProjectsLocationsSourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -7377,8 +7350,7 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsCreateCall) Header() http.H func (c *ProjectsLocationsSourcesDatacenterConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datacenterconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datacenterconnector) if err != nil { return nil, err } @@ -7492,12 +7464,11 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsDeleteCall) Header() http.H func (c *ProjectsLocationsSourcesDatacenterConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7599,12 +7570,11 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7739,12 +7709,11 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/datacenterConnectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7859,8 +7828,7 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsUpgradeApplianceCall) Heade func (c *ProjectsLocationsSourcesDatacenterConnectorsUpgradeApplianceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeappliancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeappliancerequest) if err != nil { return nil, err } @@ -7983,8 +7951,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCreateCall) Header() http.Header { func (c *ProjectsLocationsSourcesMigratingVmsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratingvm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migratingvm) if err != nil { return nil, err } @@ -8082,12 +8049,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSourcesMigratingVmsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8181,8 +8147,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsFinalizeMigrationCall) Header() htt func (c *ProjectsLocationsSourcesMigratingVmsFinalizeMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finalizemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finalizemigrationrequest) if err != nil { return nil, err } @@ -8311,12 +8276,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8468,12 +8432,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/migratingVms") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8614,8 +8577,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsPatchCall) Header() http.Header { func (c *ProjectsLocationsSourcesMigratingVmsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratingvm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migratingvm) if err != nil { return nil, err } @@ -8717,8 +8679,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsPauseMigrationCall) Header() http.H func (c *ProjectsLocationsSourcesMigratingVmsPauseMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausemigrationrequest) if err != nil { return nil, err } @@ -8821,8 +8782,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsResumeMigrationCall) Header() http. func (c *ProjectsLocationsSourcesMigratingVmsResumeMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumemigrationrequest) if err != nil { return nil, err } @@ -8923,8 +8883,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsStartMigrationCall) Header() http.H func (c *ProjectsLocationsSourcesMigratingVmsStartMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationrequest) if err != nil { return nil, err } @@ -9024,8 +8983,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCancelCall) Header() http. func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelclonejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelclonejobrequest) if err != nil { return nil, err } @@ -9148,8 +9106,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCreateCall) Header() http. func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clonejob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clonejob) if err != nil { return nil, err } @@ -9259,12 +9216,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9398,12 +9354,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cloneJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9517,8 +9472,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCancelCall) Header() htt func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelcutoverjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelcutoverjobrequest) if err != nil { return nil, err } @@ -9642,8 +9596,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCreateCall) Header() htt func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cutoverjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cutoverjob) if err != nil { return nil, err } @@ -9753,12 +9706,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9892,12 +9844,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cutoverJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10021,12 +9972,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsReplicationCyclesGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10160,12 +10110,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsReplicationCyclesListCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/replicationCycles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10305,8 +10254,7 @@ func (c *ProjectsLocationsSourcesUtilizationReportsCreateCall) Header() http.Hea func (c *ProjectsLocationsSourcesUtilizationReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.utilizationreport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.utilizationreport) if err != nil { return nil, err } @@ -10420,12 +10368,11 @@ func (c *ProjectsLocationsSourcesUtilizationReportsDeleteCall) Header() http.Hea func (c *ProjectsLocationsSourcesUtilizationReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10547,12 +10494,11 @@ func (c *ProjectsLocationsSourcesUtilizationReportsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10707,12 +10653,11 @@ func (c *ProjectsLocationsSourcesUtilizationReportsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/utilizationReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10851,8 +10796,7 @@ func (c *ProjectsLocationsTargetProjectsCreateCall) Header() http.Header { func (c *ProjectsLocationsTargetProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetproject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetproject) if err != nil { return nil, err } @@ -10967,12 +10911,11 @@ func (c *ProjectsLocationsTargetProjectsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTargetProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11075,12 +11018,11 @@ func (c *ProjectsLocationsTargetProjectsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11214,12 +11156,11 @@ func (c *ProjectsLocationsTargetProjectsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/targetProjects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11362,8 +11303,7 @@ func (c *ProjectsLocationsTargetProjectsPatchCall) Header() http.Header { func (c *ProjectsLocationsTargetProjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetproject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetproject) if err != nil { return nil, err } diff --git a/vmmigration/v1alpha1/vmmigration-gen.go b/vmmigration/v1alpha1/vmmigration-gen.go index d98e50deb81..9be405e343a 100644 --- a/vmmigration/v1alpha1/vmmigration-gen.go +++ b/vmmigration/v1alpha1/vmmigration-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -4277,12 +4276,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4408,12 +4406,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4527,8 +4524,7 @@ func (c *ProjectsLocationsGroupsAddGroupMigrationCall) Header() http.Header { func (c *ProjectsLocationsGroupsAddGroupMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addgroupmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addgroupmigrationrequest) if err != nil { return nil, err } @@ -4651,8 +4647,7 @@ func (c *ProjectsLocationsGroupsCreateCall) Header() http.Header { func (c *ProjectsLocationsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -4766,12 +4761,11 @@ func (c *ProjectsLocationsGroupsDeleteCall) Header() http.Header { func (c *ProjectsLocationsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4873,12 +4867,11 @@ func (c *ProjectsLocationsGroupsGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5011,12 +5004,11 @@ func (c *ProjectsLocationsGroupsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5156,8 +5148,7 @@ func (c *ProjectsLocationsGroupsPatchCall) Header() http.Header { func (c *ProjectsLocationsGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -5257,8 +5248,7 @@ func (c *ProjectsLocationsGroupsRemoveGroupMigrationCall) Header() http.Header { func (c *ProjectsLocationsGroupsRemoveGroupMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.removegroupmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.removegroupmigrationrequest) if err != nil { return nil, err } @@ -5383,8 +5373,7 @@ func (c *ProjectsLocationsImageImportsCreateCall) Header() http.Header { func (c *ProjectsLocationsImageImportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.imageimport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.imageimport) if err != nil { return nil, err } @@ -5498,12 +5487,11 @@ func (c *ProjectsLocationsImageImportsDeleteCall) Header() http.Header { func (c *ProjectsLocationsImageImportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5605,12 +5593,11 @@ func (c *ProjectsLocationsImageImportsGetCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5745,12 +5732,11 @@ func (c *ProjectsLocationsImageImportsListCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/imageImports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5864,8 +5850,7 @@ func (c *ProjectsLocationsImageImportsImageImportJobsCancelCall) Header() http.H func (c *ProjectsLocationsImageImportsImageImportJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelimageimportjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelimageimportjobrequest) if err != nil { return nil, err } @@ -5975,12 +5960,11 @@ func (c *ProjectsLocationsImageImportsImageImportJobsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6115,12 +6099,11 @@ func (c *ProjectsLocationsImageImportsImageImportJobsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/imageImportJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6242,8 +6225,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -6344,12 +6326,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6453,12 +6434,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6581,12 +6561,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6723,8 +6702,7 @@ func (c *ProjectsLocationsSourcesCreateCall) Header() http.Header { func (c *ProjectsLocationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -6838,12 +6816,11 @@ func (c *ProjectsLocationsSourcesDeleteCall) Header() http.Header { func (c *ProjectsLocationsSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6976,12 +6953,11 @@ func (c *ProjectsLocationsSourcesFetchInventoryCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+source}:fetchInventory") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7105,12 +7081,11 @@ func (c *ProjectsLocationsSourcesGetCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7243,12 +7218,11 @@ func (c *ProjectsLocationsSourcesListCall) doRequest(alt string) (*http.Response if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7388,8 +7362,7 @@ func (c *ProjectsLocationsSourcesPatchCall) Header() http.Header { func (c *ProjectsLocationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.source) if err != nil { return nil, err } @@ -7514,8 +7487,7 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsCreateCall) Header() http.H func (c *ProjectsLocationsSourcesDatacenterConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.datacenterconnector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datacenterconnector) if err != nil { return nil, err } @@ -7629,12 +7601,11 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsDeleteCall) Header() http.H func (c *ProjectsLocationsSourcesDatacenterConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7736,12 +7707,11 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7876,12 +7846,11 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/datacenterConnectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7996,8 +7965,7 @@ func (c *ProjectsLocationsSourcesDatacenterConnectorsUpgradeApplianceCall) Heade func (c *ProjectsLocationsSourcesDatacenterConnectorsUpgradeApplianceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeappliancerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.upgradeappliancerequest) if err != nil { return nil, err } @@ -8120,8 +8088,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCreateCall) Header() http.Header { func (c *ProjectsLocationsSourcesMigratingVmsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratingvm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migratingvm) if err != nil { return nil, err } @@ -8219,12 +8186,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsDeleteCall) Header() http.Header { func (c *ProjectsLocationsSourcesMigratingVmsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -8318,8 +8284,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsFinalizeMigrationCall) Header() htt func (c *ProjectsLocationsSourcesMigratingVmsFinalizeMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finalizemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.finalizemigrationrequest) if err != nil { return nil, err } @@ -8448,12 +8413,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8605,12 +8569,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/migratingVms") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8751,8 +8714,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsPatchCall) Header() http.Header { func (c *ProjectsLocationsSourcesMigratingVmsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratingvm) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.migratingvm) if err != nil { return nil, err } @@ -8854,8 +8816,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsPauseMigrationCall) Header() http.H func (c *ProjectsLocationsSourcesMigratingVmsPauseMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausemigrationrequest) if err != nil { return nil, err } @@ -8958,8 +8919,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsResumeMigrationCall) Header() http. func (c *ProjectsLocationsSourcesMigratingVmsResumeMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumemigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumemigrationrequest) if err != nil { return nil, err } @@ -9060,8 +9020,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsStartMigrationCall) Header() http.H func (c *ProjectsLocationsSourcesMigratingVmsStartMigrationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startmigrationrequest) if err != nil { return nil, err } @@ -9161,8 +9120,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCancelCall) Header() http. func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelclonejobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelclonejobrequest) if err != nil { return nil, err } @@ -9285,8 +9243,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCreateCall) Header() http. func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.clonejob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clonejob) if err != nil { return nil, err } @@ -9396,12 +9353,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsGetCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9535,12 +9491,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCloneJobsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/cloneJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9654,8 +9609,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCancelCall) Header() htt func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelcutoverjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelcutoverjobrequest) if err != nil { return nil, err } @@ -9779,8 +9733,7 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCreateCall) Header() htt func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cutoverjob) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cutoverjob) if err != nil { return nil, err } @@ -9890,12 +9843,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10029,12 +9981,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsCutoverJobsListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/cutoverJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10158,12 +10109,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsReplicationCyclesGetCall) doRequest if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10297,12 +10247,11 @@ func (c *ProjectsLocationsSourcesMigratingVmsReplicationCyclesListCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/replicationCycles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10442,8 +10391,7 @@ func (c *ProjectsLocationsSourcesUtilizationReportsCreateCall) Header() http.Hea func (c *ProjectsLocationsSourcesUtilizationReportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.utilizationreport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.utilizationreport) if err != nil { return nil, err } @@ -10557,12 +10505,11 @@ func (c *ProjectsLocationsSourcesUtilizationReportsDeleteCall) Header() http.Hea func (c *ProjectsLocationsSourcesUtilizationReportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10684,12 +10631,11 @@ func (c *ProjectsLocationsSourcesUtilizationReportsGetCall) doRequest(alt string if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10844,12 +10790,11 @@ func (c *ProjectsLocationsSourcesUtilizationReportsListCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/utilizationReports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10988,8 +10933,7 @@ func (c *ProjectsLocationsTargetProjectsCreateCall) Header() http.Header { func (c *ProjectsLocationsTargetProjectsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetproject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetproject) if err != nil { return nil, err } @@ -11104,12 +11048,11 @@ func (c *ProjectsLocationsTargetProjectsDeleteCall) Header() http.Header { func (c *ProjectsLocationsTargetProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11212,12 +11155,11 @@ func (c *ProjectsLocationsTargetProjectsGetCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11351,12 +11293,11 @@ func (c *ProjectsLocationsTargetProjectsListCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/targetProjects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11499,8 +11440,7 @@ func (c *ProjectsLocationsTargetProjectsPatchCall) Header() http.Header { func (c *ProjectsLocationsTargetProjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetproject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.targetproject) if err != nil { return nil, err } diff --git a/vmwareengine/v1/vmwareengine-gen.go b/vmwareengine/v1/vmwareengine-gen.go index f6ab7290746..8ad3410054c 100644 --- a/vmwareengine/v1/vmwareengine-gen.go +++ b/vmwareengine/v1/vmwareengine-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -3485,12 +3484,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3599,12 +3597,11 @@ func (c *ProjectsLocationsGetDnsBindPermissionCall) doRequest(alt string) (*http if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3731,12 +3728,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3858,8 +3854,7 @@ func (c *ProjectsLocationsDnsBindPermissionGrantCall) Header() http.Header { func (c *ProjectsLocationsDnsBindPermissionGrantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grantdnsbindpermissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grantdnsbindpermissionrequest) if err != nil { return nil, err } @@ -3967,8 +3962,7 @@ func (c *ProjectsLocationsDnsBindPermissionRevokeCall) Header() http.Header { func (c *ProjectsLocationsDnsBindPermissionRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokednsbindpermissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.revokednsbindpermissionrequest) if err != nil { return nil, err } @@ -4104,8 +4098,7 @@ func (c *ProjectsLocationsNetworkPeeringsCreateCall) Header() http.Header { func (c *ProjectsLocationsNetworkPeeringsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkpeering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkpeering) if err != nil { return nil, err } @@ -4226,12 +4219,11 @@ func (c *ProjectsLocationsNetworkPeeringsDeleteCall) Header() http.Header { func (c *ProjectsLocationsNetworkPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4339,12 +4331,11 @@ func (c *ProjectsLocationsNetworkPeeringsGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4495,12 +4486,11 @@ func (c *ProjectsLocationsNetworkPeeringsListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/networkPeerings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4648,8 +4638,7 @@ func (c *ProjectsLocationsNetworkPeeringsPatchCall) Header() http.Header { func (c *ProjectsLocationsNetworkPeeringsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkpeering) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkpeering) if err != nil { return nil, err } @@ -4792,12 +4781,11 @@ func (c *ProjectsLocationsNetworkPeeringsPeeringRoutesListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/peeringRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4947,8 +4935,7 @@ func (c *ProjectsLocationsNetworkPoliciesCreateCall) Header() http.Header { func (c *ProjectsLocationsNetworkPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkpolicy) if err != nil { return nil, err } @@ -5069,12 +5056,11 @@ func (c *ProjectsLocationsNetworkPoliciesDeleteCall) Header() http.Header { func (c *ProjectsLocationsNetworkPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -5200,12 +5186,11 @@ func (c *ProjectsLocationsNetworkPoliciesFetchExternalAddressesCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+networkPolicy}:fetchExternalAddresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5333,12 +5318,11 @@ func (c *ProjectsLocationsNetworkPoliciesGetCall) doRequest(alt string) (*http.R if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5489,12 +5473,11 @@ func (c *ProjectsLocationsNetworkPoliciesListCall) doRequest(alt string) (*http. if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/networkPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5649,8 +5632,7 @@ func (c *ProjectsLocationsNetworkPoliciesPatchCall) Header() http.Header { func (c *ProjectsLocationsNetworkPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkpolicy) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.networkpolicy) if err != nil { return nil, err } @@ -5784,8 +5766,7 @@ func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesCreateCall) Header() func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccessrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalaccessrule) if err != nil { return nil, err } @@ -5904,12 +5885,11 @@ func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesDeleteCall) Header() func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6015,12 +5995,11 @@ func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesGetCall) doRequest(a if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6174,12 +6153,11 @@ func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesListCall) doRequest( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/externalAccessRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6326,8 +6304,7 @@ func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesPatchCall) Header() func (c *ProjectsLocationsNetworkPoliciesExternalAccessRulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccessrule) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externalaccessrule) if err != nil { return nil, err } @@ -6440,12 +6417,11 @@ func (c *ProjectsLocationsNodeTypesGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6585,12 +6561,11 @@ func (c *ProjectsLocationsNodeTypesListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6705,12 +6680,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -6814,12 +6788,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -6942,12 +6915,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7097,8 +7069,7 @@ func (c *ProjectsLocationsPrivateCloudsCreateCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privatecloud) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privatecloud) if err != nil { return nil, err } @@ -7243,12 +7214,11 @@ func (c *ProjectsLocationsPrivateCloudsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -7353,12 +7323,11 @@ func (c *ProjectsLocationsPrivateCloudsGetCall) doRequest(alt string) (*http.Res if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7464,12 +7433,11 @@ func (c *ProjectsLocationsPrivateCloudsGetDnsForwardingCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7591,12 +7559,11 @@ func (c *ProjectsLocationsPrivateCloudsGetIamPolicyCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7749,12 +7716,11 @@ func (c *ProjectsLocationsPrivateCloudsListCall) doRequest(alt string) (*http.Re if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/privateClouds") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -7895,8 +7861,7 @@ func (c *ProjectsLocationsPrivateCloudsPatchCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privatecloud) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privatecloud) if err != nil { return nil, err } @@ -7999,8 +7964,7 @@ func (c *ProjectsLocationsPrivateCloudsResetNsxCredentialsCall) Header() http.He func (c *ProjectsLocationsPrivateCloudsResetNsxCredentialsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetnsxcredentialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetnsxcredentialsrequest) if err != nil { return nil, err } @@ -8103,8 +8067,7 @@ func (c *ProjectsLocationsPrivateCloudsResetVcenterCredentialsCall) Header() htt func (c *ProjectsLocationsPrivateCloudsResetVcenterCredentialsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetvcentercredentialsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resetvcentercredentialsrequest) if err != nil { return nil, err } @@ -8208,8 +8171,7 @@ func (c *ProjectsLocationsPrivateCloudsSetIamPolicyCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -8323,12 +8285,11 @@ func (c *ProjectsLocationsPrivateCloudsShowNsxCredentialsCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+privateCloud}:showNsxCredentials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8446,12 +8407,11 @@ func (c *ProjectsLocationsPrivateCloudsShowVcenterCredentialsCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+privateCloud}:showVcenterCredentials") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8550,8 +8510,7 @@ func (c *ProjectsLocationsPrivateCloudsTestIamPermissionsCall) Header() http.Hea func (c *ProjectsLocationsPrivateCloudsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -8659,8 +8618,7 @@ func (c *ProjectsLocationsPrivateCloudsUndeleteCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprivatecloudrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.undeleteprivatecloudrequest) if err != nil { return nil, err } @@ -8793,8 +8751,7 @@ func (c *ProjectsLocationsPrivateCloudsUpdateDnsForwardingCall) Header() http.He func (c *ProjectsLocationsPrivateCloudsUpdateDnsForwardingCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.dnsforwarding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dnsforwarding) if err != nil { return nil, err } @@ -8928,8 +8885,7 @@ func (c *ProjectsLocationsPrivateCloudsClustersCreateCall) Header() http.Header func (c *ProjectsLocationsPrivateCloudsClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -9042,12 +8998,11 @@ func (c *ProjectsLocationsPrivateCloudsClustersDeleteCall) Header() http.Header func (c *ProjectsLocationsPrivateCloudsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9153,12 +9108,11 @@ func (c *ProjectsLocationsPrivateCloudsClustersGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9280,12 +9234,11 @@ func (c *ProjectsLocationsPrivateCloudsClustersGetIamPolicyCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9430,12 +9383,11 @@ func (c *ProjectsLocationsPrivateCloudsClustersListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9583,8 +9535,7 @@ func (c *ProjectsLocationsPrivateCloudsClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cluster) if err != nil { return nil, err } @@ -9688,8 +9639,7 @@ func (c *ProjectsLocationsPrivateCloudsClustersSetIamPolicyCall) Header() http.H func (c *ProjectsLocationsPrivateCloudsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -9796,8 +9746,7 @@ func (c *ProjectsLocationsPrivateCloudsClustersTestIamPermissionsCall) Header() func (c *ProjectsLocationsPrivateCloudsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -9910,12 +9859,11 @@ func (c *ProjectsLocationsPrivateCloudsClustersNodesGetCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10038,12 +9986,11 @@ func (c *ProjectsLocationsPrivateCloudsClustersNodesListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10192,8 +10139,7 @@ func (c *ProjectsLocationsPrivateCloudsExternalAddressesCreateCall) Header() htt func (c *ProjectsLocationsPrivateCloudsExternalAddressesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externaladdress) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externaladdress) if err != nil { return nil, err } @@ -10314,12 +10260,11 @@ func (c *ProjectsLocationsPrivateCloudsExternalAddressesDeleteCall) Header() htt func (c *ProjectsLocationsPrivateCloudsExternalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10425,12 +10370,11 @@ func (c *ProjectsLocationsPrivateCloudsExternalAddressesGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10584,12 +10528,11 @@ func (c *ProjectsLocationsPrivateCloudsExternalAddressesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/externalAddresses") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10739,8 +10682,7 @@ func (c *ProjectsLocationsPrivateCloudsExternalAddressesPatchCall) Header() http func (c *ProjectsLocationsPrivateCloudsExternalAddressesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externaladdress) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.externaladdress) if err != nil { return nil, err } @@ -10873,8 +10815,7 @@ func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysCreateCall) Header() htt func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hcxactivationkey) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.hcxactivationkey) if err != nil { return nil, err } @@ -10988,12 +10929,11 @@ func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11116,12 +11056,11 @@ func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysGetIamPolicyCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11245,12 +11184,11 @@ func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/hcxActivationKeys") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11368,8 +11306,7 @@ func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysSetIamPolicyCall) Header func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -11476,8 +11413,7 @@ func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysTestIamPermissionsCall) func (c *ProjectsLocationsPrivateCloudsHcxActivationKeysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -11611,8 +11547,7 @@ func (c *ProjectsLocationsPrivateCloudsLoggingServersCreateCall) Header() http.H func (c *ProjectsLocationsPrivateCloudsLoggingServersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loggingserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loggingserver) if err != nil { return nil, err } @@ -11731,12 +11666,11 @@ func (c *ProjectsLocationsPrivateCloudsLoggingServersDeleteCall) Header() http.H func (c *ProjectsLocationsPrivateCloudsLoggingServersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11842,12 +11776,11 @@ func (c *ProjectsLocationsPrivateCloudsLoggingServersGetCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11999,12 +11932,11 @@ func (c *ProjectsLocationsPrivateCloudsLoggingServersListCall) doRequest(alt str if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/loggingServers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12151,8 +12083,7 @@ func (c *ProjectsLocationsPrivateCloudsLoggingServersPatchCall) Header() http.He func (c *ProjectsLocationsPrivateCloudsLoggingServersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loggingserver) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loggingserver) if err != nil { return nil, err } @@ -12293,8 +12224,7 @@ func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsCreateCall) Head func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managementdnszonebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managementdnszonebinding) if err != nil { return nil, err } @@ -12415,12 +12345,11 @@ func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsDeleteCall) Head func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12526,12 +12455,11 @@ func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsGetCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12688,12 +12616,11 @@ func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsListCall) doRequ if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/managementDnsZoneBindings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12840,8 +12767,7 @@ func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsPatchCall) Heade func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.managementdnszonebinding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.managementdnszonebinding) if err != nil { return nil, err } @@ -12946,8 +12872,7 @@ func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsRepairCall) Head func (c *ProjectsLocationsPrivateCloudsManagementDnsZoneBindingsRepairCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairmanagementdnszonebindingrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.repairmanagementdnszonebindingrequest) if err != nil { return nil, err } @@ -13061,12 +12986,11 @@ func (c *ProjectsLocationsPrivateCloudsSubnetsGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13189,12 +13113,11 @@ func (c *ProjectsLocationsPrivateCloudsSubnetsListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subnets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13326,8 +13249,7 @@ func (c *ProjectsLocationsPrivateCloudsSubnetsPatchCall) Header() http.Header { func (c *ProjectsLocationsPrivateCloudsSubnetsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnet) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subnet) if err != nil { return nil, err } @@ -13462,8 +13384,7 @@ func (c *ProjectsLocationsPrivateConnectionsCreateCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privateconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privateconnection) if err != nil { return nil, err } @@ -13584,12 +13505,11 @@ func (c *ProjectsLocationsPrivateConnectionsDeleteCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13697,12 +13617,11 @@ func (c *ProjectsLocationsPrivateConnectionsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13853,12 +13772,11 @@ func (c *ProjectsLocationsPrivateConnectionsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/privateConnections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14006,8 +13924,7 @@ func (c *ProjectsLocationsPrivateConnectionsPatchCall) Header() http.Header { func (c *ProjectsLocationsPrivateConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.privateconnection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.privateconnection) if err != nil { return nil, err } @@ -14141,12 +14058,11 @@ func (c *ProjectsLocationsPrivateConnectionsPeeringRoutesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/peeringRoutes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14299,8 +14215,7 @@ func (c *ProjectsLocationsVmwareEngineNetworksCreateCall) Header() http.Header { func (c *ProjectsLocationsVmwareEngineNetworksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwareenginenetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwareenginenetwork) if err != nil { return nil, err } @@ -14431,12 +14346,11 @@ func (c *ProjectsLocationsVmwareEngineNetworksDeleteCall) Header() http.Header { func (c *ProjectsLocationsVmwareEngineNetworksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14544,12 +14458,11 @@ func (c *ProjectsLocationsVmwareEngineNetworksGetCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14700,12 +14613,11 @@ func (c *ProjectsLocationsVmwareEngineNetworksListCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vmwareEngineNetworks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14853,8 +14765,7 @@ func (c *ProjectsLocationsVmwareEngineNetworksPatchCall) Header() http.Header { func (c *ProjectsLocationsVmwareEngineNetworksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.vmwareenginenetwork) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.vmwareenginenetwork) if err != nil { return nil, err } diff --git a/vpcaccess/v1/vpcaccess-gen.go b/vpcaccess/v1/vpcaccess-gen.go index e6f5aa0237a..80142a89212 100644 --- a/vpcaccess/v1/vpcaccess-gen.go +++ b/vpcaccess/v1/vpcaccess-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -663,12 +662,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -790,8 +788,7 @@ func (c *ProjectsLocationsConnectorsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connector) if err != nil { return nil, err } @@ -890,12 +887,11 @@ func (c *ProjectsLocationsConnectorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -998,12 +994,11 @@ func (c *ProjectsLocationsConnectorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1118,12 +1113,11 @@ func (c *ProjectsLocationsConnectorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1245,8 +1239,7 @@ func (c *ProjectsLocationsConnectorsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connector) if err != nil { return nil, err } @@ -1358,12 +1351,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1486,12 +1478,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/vpcaccess/v1beta1/vpcaccess-gen.go b/vpcaccess/v1beta1/vpcaccess-gen.go index fc9f7373cd0..b5ed2811510 100644 --- a/vpcaccess/v1beta1/vpcaccess-gen.go +++ b/vpcaccess/v1beta1/vpcaccess-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -667,12 +666,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -794,8 +792,7 @@ func (c *ProjectsLocationsConnectorsCreateCall) Header() http.Header { func (c *ProjectsLocationsConnectorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connector) if err != nil { return nil, err } @@ -894,12 +891,11 @@ func (c *ProjectsLocationsConnectorsDeleteCall) Header() http.Header { func (c *ProjectsLocationsConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1002,12 +998,11 @@ func (c *ProjectsLocationsConnectorsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1122,12 +1117,11 @@ func (c *ProjectsLocationsConnectorsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1249,8 +1243,7 @@ func (c *ProjectsLocationsConnectorsPatchCall) Header() http.Header { func (c *ProjectsLocationsConnectorsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.connector) if err != nil { return nil, err } @@ -1362,12 +1355,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1490,12 +1482,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/walletobjects/v1/walletobjects-gen.go b/walletobjects/v1/walletobjects-gen.go index 39f5267af2d..6de4bf31d4b 100644 --- a/walletobjects/v1/walletobjects-gen.go +++ b/walletobjects/v1/walletobjects-gen.go @@ -114,25 +114,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.Eventticketclass = NewEventticketclassService(s) s.Eventticketobject = NewEventticketobjectService(s) @@ -153,9 +134,27 @@ func New(client *http.Client) (*Service, error) { s.Smarttap = NewSmarttapService(s) s.Transitclass = NewTransitclassService(s) s.Transitobject = NewTransitobjectService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL @@ -7859,8 +7858,7 @@ func (c *EventticketclassAddmessageCall) Header() http.Header { func (c *EventticketclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -7975,12 +7973,11 @@ func (c *EventticketclassGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/eventTicketClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8069,8 +8066,7 @@ func (c *EventticketclassInsertCall) Header() http.Header { func (c *EventticketclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventticketclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventticketclass) if err != nil { return nil, err } @@ -8200,12 +8196,11 @@ func (c *EventticketclassListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/eventTicketClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8300,8 +8295,7 @@ func (c *EventticketclassPatchCall) Header() http.Header { func (c *EventticketclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventticketclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventticketclass) if err != nil { return nil, err } @@ -8406,8 +8400,7 @@ func (c *EventticketclassUpdateCall) Header() http.Header { func (c *EventticketclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventticketclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventticketclass) if err != nil { return nil, err } @@ -8513,8 +8506,7 @@ func (c *EventticketobjectAddmessageCall) Header() http.Header { func (c *EventticketobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -8629,12 +8621,11 @@ func (c *EventticketobjectGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/eventTicketObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8723,8 +8714,7 @@ func (c *EventticketobjectInsertCall) Header() http.Header { func (c *EventticketobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventticketobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventticketobject) if err != nil { return nil, err } @@ -8854,12 +8844,11 @@ func (c *EventticketobjectListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/eventTicketObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8954,8 +8943,7 @@ func (c *EventticketobjectModifylinkedofferobjectsCall) Header() http.Header { func (c *EventticketobjectModifylinkedofferobjectsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylinkedofferobjectsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifylinkedofferobjectsrequest) if err != nil { return nil, err } @@ -9061,8 +9049,7 @@ func (c *EventticketobjectPatchCall) Header() http.Header { func (c *EventticketobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventticketobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventticketobject) if err != nil { return nil, err } @@ -9167,8 +9154,7 @@ func (c *EventticketobjectUpdateCall) Header() http.Header { func (c *EventticketobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventticketobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.eventticketobject) if err != nil { return nil, err } @@ -9274,8 +9260,7 @@ func (c *FlightclassAddmessageCall) Header() http.Header { func (c *FlightclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -9390,12 +9375,11 @@ func (c *FlightclassGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/flightClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9483,8 +9467,7 @@ func (c *FlightclassInsertCall) Header() http.Header { func (c *FlightclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.flightclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flightclass) if err != nil { return nil, err } @@ -9613,12 +9596,11 @@ func (c *FlightclassListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/flightClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9713,8 +9695,7 @@ func (c *FlightclassPatchCall) Header() http.Header { func (c *FlightclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.flightclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flightclass) if err != nil { return nil, err } @@ -9818,8 +9799,7 @@ func (c *FlightclassUpdateCall) Header() http.Header { func (c *FlightclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.flightclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flightclass) if err != nil { return nil, err } @@ -9924,8 +9904,7 @@ func (c *FlightobjectAddmessageCall) Header() http.Header { func (c *FlightobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -10040,12 +10019,11 @@ func (c *FlightobjectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/flightObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10133,8 +10111,7 @@ func (c *FlightobjectInsertCall) Header() http.Header { func (c *FlightobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.flightobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flightobject) if err != nil { return nil, err } @@ -10263,12 +10240,11 @@ func (c *FlightobjectListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/flightObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10363,8 +10339,7 @@ func (c *FlightobjectPatchCall) Header() http.Header { func (c *FlightobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.flightobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flightobject) if err != nil { return nil, err } @@ -10468,8 +10443,7 @@ func (c *FlightobjectUpdateCall) Header() http.Header { func (c *FlightobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.flightobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flightobject) if err != nil { return nil, err } @@ -10574,8 +10548,7 @@ func (c *GenericclassAddmessageCall) Header() http.Header { func (c *GenericclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -10690,12 +10663,11 @@ func (c *GenericclassGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/genericClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10783,8 +10755,7 @@ func (c *GenericclassInsertCall) Header() http.Header { func (c *GenericclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.genericclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.genericclass) if err != nil { return nil, err } @@ -10913,12 +10884,11 @@ func (c *GenericclassListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/genericClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11013,8 +10983,7 @@ func (c *GenericclassPatchCall) Header() http.Header { func (c *GenericclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.genericclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.genericclass) if err != nil { return nil, err } @@ -11118,8 +11087,7 @@ func (c *GenericclassUpdateCall) Header() http.Header { func (c *GenericclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.genericclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.genericclass) if err != nil { return nil, err } @@ -11224,8 +11192,7 @@ func (c *GenericobjectAddmessageCall) Header() http.Header { func (c *GenericobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -11340,12 +11307,11 @@ func (c *GenericobjectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/genericObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11433,8 +11399,7 @@ func (c *GenericobjectInsertCall) Header() http.Header { func (c *GenericobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.genericobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.genericobject) if err != nil { return nil, err } @@ -11563,12 +11528,11 @@ func (c *GenericobjectListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/genericObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11663,8 +11627,7 @@ func (c *GenericobjectPatchCall) Header() http.Header { func (c *GenericobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.genericobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.genericobject) if err != nil { return nil, err } @@ -11768,8 +11731,7 @@ func (c *GenericobjectUpdateCall) Header() http.Header { func (c *GenericobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.genericobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.genericobject) if err != nil { return nil, err } @@ -11874,8 +11836,7 @@ func (c *GiftcardclassAddmessageCall) Header() http.Header { func (c *GiftcardclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -11990,12 +11951,11 @@ func (c *GiftcardclassGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/giftCardClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12083,8 +12043,7 @@ func (c *GiftcardclassInsertCall) Header() http.Header { func (c *GiftcardclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.giftcardclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.giftcardclass) if err != nil { return nil, err } @@ -12213,12 +12172,11 @@ func (c *GiftcardclassListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/giftCardClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12313,8 +12271,7 @@ func (c *GiftcardclassPatchCall) Header() http.Header { func (c *GiftcardclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.giftcardclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.giftcardclass) if err != nil { return nil, err } @@ -12418,8 +12375,7 @@ func (c *GiftcardclassUpdateCall) Header() http.Header { func (c *GiftcardclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.giftcardclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.giftcardclass) if err != nil { return nil, err } @@ -12524,8 +12480,7 @@ func (c *GiftcardobjectAddmessageCall) Header() http.Header { func (c *GiftcardobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -12640,12 +12595,11 @@ func (c *GiftcardobjectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/giftCardObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12733,8 +12687,7 @@ func (c *GiftcardobjectInsertCall) Header() http.Header { func (c *GiftcardobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.giftcardobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.giftcardobject) if err != nil { return nil, err } @@ -12863,12 +12816,11 @@ func (c *GiftcardobjectListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/giftCardObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12963,8 +12915,7 @@ func (c *GiftcardobjectPatchCall) Header() http.Header { func (c *GiftcardobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.giftcardobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.giftcardobject) if err != nil { return nil, err } @@ -13068,8 +13019,7 @@ func (c *GiftcardobjectUpdateCall) Header() http.Header { func (c *GiftcardobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.giftcardobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.giftcardobject) if err != nil { return nil, err } @@ -13179,12 +13129,11 @@ func (c *IssuerGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/issuer/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13272,8 +13221,7 @@ func (c *IssuerInsertCall) Header() http.Header { func (c *IssuerInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.issuer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.issuer) if err != nil { return nil, err } @@ -13376,12 +13324,11 @@ func (c *IssuerListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/issuer") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13472,8 +13419,7 @@ func (c *IssuerPatchCall) Header() http.Header { func (c *IssuerPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.issuer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.issuer) if err != nil { return nil, err } @@ -13573,8 +13519,7 @@ func (c *IssuerUpdateCall) Header() http.Header { func (c *IssuerUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.issuer) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.issuer) if err != nil { return nil, err } @@ -13670,8 +13615,7 @@ func (c *JwtInsertCall) Header() http.Header { func (c *JwtInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.jwtresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.jwtresource) if err != nil { return nil, err } @@ -13774,8 +13718,7 @@ func (c *LoyaltyclassAddmessageCall) Header() http.Header { func (c *LoyaltyclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -13890,12 +13833,11 @@ func (c *LoyaltyclassGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/loyaltyClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13983,8 +13925,7 @@ func (c *LoyaltyclassInsertCall) Header() http.Header { func (c *LoyaltyclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loyaltyclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loyaltyclass) if err != nil { return nil, err } @@ -14113,12 +14054,11 @@ func (c *LoyaltyclassListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/loyaltyClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14213,8 +14153,7 @@ func (c *LoyaltyclassPatchCall) Header() http.Header { func (c *LoyaltyclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loyaltyclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loyaltyclass) if err != nil { return nil, err } @@ -14318,8 +14257,7 @@ func (c *LoyaltyclassUpdateCall) Header() http.Header { func (c *LoyaltyclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loyaltyclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loyaltyclass) if err != nil { return nil, err } @@ -14424,8 +14362,7 @@ func (c *LoyaltyobjectAddmessageCall) Header() http.Header { func (c *LoyaltyobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -14540,12 +14477,11 @@ func (c *LoyaltyobjectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/loyaltyObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14633,8 +14569,7 @@ func (c *LoyaltyobjectInsertCall) Header() http.Header { func (c *LoyaltyobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loyaltyobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loyaltyobject) if err != nil { return nil, err } @@ -14763,12 +14698,11 @@ func (c *LoyaltyobjectListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/loyaltyObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14863,8 +14797,7 @@ func (c *LoyaltyobjectModifylinkedofferobjectsCall) Header() http.Header { func (c *LoyaltyobjectModifylinkedofferobjectsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylinkedofferobjectsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifylinkedofferobjectsrequest) if err != nil { return nil, err } @@ -14969,8 +14902,7 @@ func (c *LoyaltyobjectPatchCall) Header() http.Header { func (c *LoyaltyobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loyaltyobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loyaltyobject) if err != nil { return nil, err } @@ -15074,8 +15006,7 @@ func (c *LoyaltyobjectUpdateCall) Header() http.Header { func (c *LoyaltyobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.loyaltyobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.loyaltyobject) if err != nil { return nil, err } @@ -15190,12 +15121,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/transitObject/{resourceId}/downloadRotatingBarcodeValues") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15349,8 +15279,7 @@ func (c *MediaUploadCall) Header() http.Header { func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitobjectuploadrotatingbarcodevaluesrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitobjectuploadrotatingbarcodevaluesrequest) if err != nil { return nil, err } @@ -15361,14 +15290,10 @@ func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/walletobjects/v1/transitObject/{resourceId}/uploadRotatingBarcodeValues") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -15484,8 +15409,7 @@ func (c *OfferclassAddmessageCall) Header() http.Header { func (c *OfferclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -15600,12 +15524,11 @@ func (c *OfferclassGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/offerClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15693,8 +15616,7 @@ func (c *OfferclassInsertCall) Header() http.Header { func (c *OfferclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.offerclass) if err != nil { return nil, err } @@ -15823,12 +15745,11 @@ func (c *OfferclassListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/offerClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15923,8 +15844,7 @@ func (c *OfferclassPatchCall) Header() http.Header { func (c *OfferclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.offerclass) if err != nil { return nil, err } @@ -16028,8 +15948,7 @@ func (c *OfferclassUpdateCall) Header() http.Header { func (c *OfferclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.offerclass) if err != nil { return nil, err } @@ -16134,8 +16053,7 @@ func (c *OfferobjectAddmessageCall) Header() http.Header { func (c *OfferobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -16250,12 +16168,11 @@ func (c *OfferobjectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/offerObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16343,8 +16260,7 @@ func (c *OfferobjectInsertCall) Header() http.Header { func (c *OfferobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.offerobject) if err != nil { return nil, err } @@ -16473,12 +16389,11 @@ func (c *OfferobjectListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/offerObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16573,8 +16488,7 @@ func (c *OfferobjectPatchCall) Header() http.Header { func (c *OfferobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.offerobject) if err != nil { return nil, err } @@ -16678,8 +16592,7 @@ func (c *OfferobjectUpdateCall) Header() http.Header { func (c *OfferobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.offerobject) if err != nil { return nil, err } @@ -16790,12 +16703,11 @@ func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/permissions/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16888,8 +16800,7 @@ func (c *PermissionsUpdateCall) Header() http.Header { func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissions) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.permissions) if err != nil { return nil, err } @@ -16985,8 +16896,7 @@ func (c *SmarttapInsertCall) Header() http.Header { func (c *SmarttapInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.smarttap) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.smarttap) if err != nil { return nil, err } @@ -17088,8 +16998,7 @@ func (c *TransitclassAddmessageCall) Header() http.Header { func (c *TransitclassAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -17204,12 +17113,11 @@ func (c *TransitclassGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/transitClass/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17297,8 +17205,7 @@ func (c *TransitclassInsertCall) Header() http.Header { func (c *TransitclassInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitclass) if err != nil { return nil, err } @@ -17427,12 +17334,11 @@ func (c *TransitclassListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/transitClass") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17527,8 +17433,7 @@ func (c *TransitclassPatchCall) Header() http.Header { func (c *TransitclassPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitclass) if err != nil { return nil, err } @@ -17632,8 +17537,7 @@ func (c *TransitclassUpdateCall) Header() http.Header { func (c *TransitclassUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitclass) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitclass) if err != nil { return nil, err } @@ -17738,8 +17642,7 @@ func (c *TransitobjectAddmessageCall) Header() http.Header { func (c *TransitobjectAddmessageCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmessagerequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addmessagerequest) if err != nil { return nil, err } @@ -17854,12 +17757,11 @@ func (c *TransitobjectGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/transitObject/{resourceId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17947,8 +17849,7 @@ func (c *TransitobjectInsertCall) Header() http.Header { func (c *TransitobjectInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitobject) if err != nil { return nil, err } @@ -18077,12 +17978,11 @@ func (c *TransitobjectListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "walletobjects/v1/transitObject") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18177,8 +18077,7 @@ func (c *TransitobjectPatchCall) Header() http.Header { func (c *TransitobjectPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitobject) if err != nil { return nil, err } @@ -18282,8 +18181,7 @@ func (c *TransitobjectUpdateCall) Header() http.Header { func (c *TransitobjectUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.transitobject) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transitobject) if err != nil { return nil, err } diff --git a/webfonts/v1/webfonts-gen.go b/webfonts/v1/webfonts-gen.go index 6db370da191..03d7d3301b4 100644 --- a/webfonts/v1/webfonts-gen.go +++ b/webfonts/v1/webfonts-gen.go @@ -103,7 +103,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Webfonts = NewWebfontsService(s) if err != nil { return nil, err } @@ -122,9 +123,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Webfonts = NewWebfontsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -362,12 +361,11 @@ func (c *WebfontsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/webfonts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/webrisk/v1/webrisk-gen.go b/webrisk/v1/webrisk-gen.go index 0dcb1094cdc..638bb151237 100644 --- a/webrisk/v1/webrisk-gen.go +++ b/webrisk/v1/webrisk-gen.go @@ -115,7 +115,11 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Hashes = NewHashesService(s) + s.Projects = NewProjectsService(s) + s.ThreatLists = NewThreatListsService(s) + s.Uris = NewUrisService(s) if err != nil { return nil, err } @@ -134,12 +138,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Hashes = NewHashesService(s) - s.Projects = NewProjectsService(s) - s.ThreatLists = NewThreatListsService(s) - s.Uris = NewUrisService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -805,12 +804,11 @@ func (c *HashesSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/hashes:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -908,8 +906,7 @@ func (c *ProjectsOperationsCancelCall) Header() http.Header { func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlelongrunningcanceloperationrequest) if err != nil { return nil, err } @@ -1011,12 +1008,11 @@ func (c *ProjectsOperationsDeleteCall) Header() http.Header { func (c *ProjectsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1121,12 +1117,11 @@ func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1250,12 +1245,11 @@ func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1376,8 +1370,7 @@ func (c *ProjectsSubmissionsCreateCall) Header() http.Header { func (c *ProjectsSubmissionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudwebriskv1submission) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudwebriskv1submission) if err != nil { return nil, err } @@ -1553,12 +1546,11 @@ func (c *ThreatListsComputeDiffCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/threatLists:computeDiff") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1684,12 +1676,11 @@ func (c *UrisSearchCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/uris:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/websecurityscanner/v1/websecurityscanner-gen.go b/websecurityscanner/v1/websecurityscanner-gen.go index 92faa3e0a8c..ca416607bdb 100644 --- a/websecurityscanner/v1/websecurityscanner-gen.go +++ b/websecurityscanner/v1/websecurityscanner-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1315,8 +1314,7 @@ func (c *ProjectsScanConfigsCreateCall) Header() http.Header { func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -1415,12 +1413,11 @@ func (c *ProjectsScanConfigsDeleteCall) Header() http.Header { func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1523,12 +1520,11 @@ func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1648,12 +1644,11 @@ func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scanConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1778,8 +1773,7 @@ func (c *ProjectsScanConfigsPatchCall) Header() http.Header { func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -1880,8 +1874,7 @@ func (c *ProjectsScanConfigsStartCall) Header() http.Header { func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startscanrunrequest) if err != nil { return nil, err } @@ -1993,12 +1986,11 @@ func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2119,12 +2111,11 @@ func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scanRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2240,8 +2231,7 @@ func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header { func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopscanrunrequest) if err != nil { return nil, err } @@ -2370,12 +2360,11 @@ func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/crawledUrls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2501,12 +2490,11 @@ func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findingTypeStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2612,12 +2600,11 @@ func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2746,12 +2733,11 @@ func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/websecurityscanner/v1alpha/websecurityscanner-gen.go b/websecurityscanner/v1alpha/websecurityscanner-gen.go index 9e2c4705c37..97acba4572b 100644 --- a/websecurityscanner/v1alpha/websecurityscanner-gen.go +++ b/websecurityscanner/v1alpha/websecurityscanner-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1033,8 +1032,7 @@ func (c *ProjectsScanConfigsCreateCall) Header() http.Header { func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -1133,12 +1131,11 @@ func (c *ProjectsScanConfigsDeleteCall) Header() http.Header { func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1241,12 +1238,11 @@ func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1366,12 +1362,11 @@ func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1496,8 +1491,7 @@ func (c *ProjectsScanConfigsPatchCall) Header() http.Header { func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -1598,8 +1592,7 @@ func (c *ProjectsScanConfigsStartCall) Header() http.Header { func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startscanrunrequest) if err != nil { return nil, err } @@ -1711,12 +1704,11 @@ func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1837,12 +1829,11 @@ func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1958,8 +1949,7 @@ func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header { func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopscanrunrequest) if err != nil { return nil, err } @@ -2088,12 +2078,11 @@ func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/crawledUrls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2219,12 +2208,11 @@ func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/findingTypeStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2330,12 +2318,11 @@ func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2464,12 +2451,11 @@ func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/websecurityscanner/v1beta/websecurityscanner-gen.go b/websecurityscanner/v1beta/websecurityscanner-gen.go index 6e670c9003c..36d1f20e3a0 100644 --- a/websecurityscanner/v1beta/websecurityscanner-gen.go +++ b/websecurityscanner/v1beta/websecurityscanner-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1289,8 +1288,7 @@ func (c *ProjectsScanConfigsCreateCall) Header() http.Header { func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -1389,12 +1387,11 @@ func (c *ProjectsScanConfigsDeleteCall) Header() http.Header { func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1497,12 +1494,11 @@ func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1622,12 +1618,11 @@ func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, err if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scanConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1752,8 +1747,7 @@ func (c *ProjectsScanConfigsPatchCall) Header() http.Header { func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.scanconfig) if err != nil { return nil, err } @@ -1854,8 +1848,7 @@ func (c *ProjectsScanConfigsStartCall) Header() http.Header { func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startscanrunrequest) if err != nil { return nil, err } @@ -1967,12 +1960,11 @@ func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2093,12 +2085,11 @@ func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scanRuns") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2214,8 +2205,7 @@ func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header { func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopscanrunrequest) if err != nil { return nil, err } @@ -2344,12 +2334,11 @@ func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/crawledUrls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2475,12 +2464,11 @@ func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt stri if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/findingTypeStats") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2586,12 +2574,11 @@ func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*htt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2720,12 +2707,11 @@ func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/workflowexecutions/v1/workflowexecutions-gen.go b/workflowexecutions/v1/workflowexecutions-gen.go index b713a9181e8..b787856d162 100644 --- a/workflowexecutions/v1/workflowexecutions-gen.go +++ b/workflowexecutions/v1/workflowexecutions-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1026,8 +1025,7 @@ func (c *ProjectsLocationsWorkflowsTriggerPubsubExecutionCall) Header() http.Hea func (c *ProjectsLocationsWorkflowsTriggerPubsubExecutionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.triggerpubsubexecutionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.triggerpubsubexecutionrequest) if err != nil { return nil, err } @@ -1129,8 +1127,7 @@ func (c *ProjectsLocationsWorkflowsExecutionsCancelCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsExecutionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelexecutionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelexecutionrequest) if err != nil { return nil, err } @@ -1233,8 +1230,7 @@ func (c *ProjectsLocationsWorkflowsExecutionsCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsExecutionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.execution) if err != nil { return nil, err } @@ -1337,8 +1333,7 @@ func (c *ProjectsLocationsWorkflowsExecutionsDeleteExecutionHistoryCall) Header( func (c *ProjectsLocationsWorkflowsExecutionsDeleteExecutionHistoryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deleteexecutionhistoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deleteexecutionhistoryrequest) if err != nil { return nil, err } @@ -1451,12 +1446,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsExportDataCall) doRequest(alt strin if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:exportData") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1578,12 +1572,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1751,12 +1744,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1901,12 +1893,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsCallbacksListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/callbacks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2047,12 +2038,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsStepEntriesGetCall) doRequest(alt s if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2219,12 +2209,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsStepEntriesListCall) doRequest(alt if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/stepEntries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/workflowexecutions/v1beta/workflowexecutions-gen.go b/workflowexecutions/v1beta/workflowexecutions-gen.go index b41e973ec57..32d645a02ac 100644 --- a/workflowexecutions/v1beta/workflowexecutions-gen.go +++ b/workflowexecutions/v1beta/workflowexecutions-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -506,8 +505,7 @@ func (c *ProjectsLocationsWorkflowsExecutionsCancelCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsExecutionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelexecutionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelexecutionrequest) if err != nil { return nil, err } @@ -610,8 +608,7 @@ func (c *ProjectsLocationsWorkflowsExecutionsCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsExecutionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.execution) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.execution) if err != nil { return nil, err } @@ -740,12 +737,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -887,12 +883,11 @@ func (c *ProjectsLocationsWorkflowsExecutionsListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/workflows/v1/workflows-gen.go b/workflows/v1/workflows-gen.go index 66e0a78d1cf..d5038c40ab8 100644 --- a/workflows/v1/workflows-gen.go +++ b/workflows/v1/workflows-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -676,12 +675,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -807,12 +805,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -927,12 +924,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1036,12 +1032,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1164,12 +1159,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1296,8 +1290,7 @@ func (c *ProjectsLocationsWorkflowsCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflow) if err != nil { return nil, err } @@ -1397,12 +1390,11 @@ func (c *ProjectsLocationsWorkflowsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1515,12 +1507,11 @@ func (c *ProjectsLocationsWorkflowsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1661,12 +1652,11 @@ func (c *ProjectsLocationsWorkflowsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflows") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1808,12 +1798,11 @@ func (c *ProjectsLocationsWorkflowsListRevisionsCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1939,8 +1928,7 @@ func (c *ProjectsLocationsWorkflowsPatchCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflow) if err != nil { return nil, err } diff --git a/workflows/v1beta/workflows-gen.go b/workflows/v1beta/workflows-gen.go index 429ab62671a..202e6e70ea7 100644 --- a/workflows/v1beta/workflows-gen.go +++ b/workflows/v1beta/workflows-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -563,12 +562,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -694,12 +692,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -814,12 +811,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -923,12 +919,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1051,12 +1046,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1183,8 +1177,7 @@ func (c *ProjectsLocationsWorkflowsCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflow) if err != nil { return nil, err } @@ -1284,12 +1277,11 @@ func (c *ProjectsLocationsWorkflowsDeleteCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1392,12 +1384,11 @@ func (c *ProjectsLocationsWorkflowsGetCall) doRequest(alt string) (*http.Respons if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1537,12 +1528,11 @@ func (c *ProjectsLocationsWorkflowsListCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workflows") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1667,8 +1657,7 @@ func (c *ProjectsLocationsWorkflowsPatchCall) Header() http.Header { func (c *ProjectsLocationsWorkflowsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workflow) if err != nil { return nil, err } diff --git a/workloadmanager/v1/workloadmanager-gen.go b/workloadmanager/v1/workloadmanager-gen.go index 80f298b2daf..9d494df8d97 100644 --- a/workloadmanager/v1/workloadmanager-gen.go +++ b/workloadmanager/v1/workloadmanager-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -1942,12 +1941,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2073,12 +2071,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2216,8 +2213,7 @@ func (c *ProjectsLocationsEvaluationsCreateCall) Header() http.Header { func (c *ProjectsLocationsEvaluationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.evaluation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.evaluation) if err != nil { return nil, err } @@ -2338,12 +2334,11 @@ func (c *ProjectsLocationsEvaluationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsEvaluationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2445,12 +2440,11 @@ func (c *ProjectsLocationsEvaluationsGetCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2581,12 +2575,11 @@ func (c *ProjectsLocationsEvaluationsListCall) doRequest(alt string) (*http.Resp if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2714,12 +2707,11 @@ func (c *ProjectsLocationsEvaluationsExecutionsDeleteCall) Header() http.Header func (c *ProjectsLocationsEvaluationsExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2821,12 +2813,11 @@ func (c *ProjectsLocationsEvaluationsExecutionsGetCall) doRequest(alt string) (* if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2957,12 +2948,11 @@ func (c *ProjectsLocationsEvaluationsExecutionsListCall) doRequest(alt string) ( if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/executions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3078,8 +3068,7 @@ func (c *ProjectsLocationsEvaluationsExecutionsRunCall) Header() http.Header { func (c *ProjectsLocationsEvaluationsExecutionsRunCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runevaluationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runevaluationrequest) if err != nil { return nil, err } @@ -3211,12 +3200,11 @@ func (c *ProjectsLocationsEvaluationsExecutionsResultsListCall) doRequest(alt st if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3374,12 +3362,11 @@ func (c *ProjectsLocationsEvaluationsExecutionsScannedResourcesListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scannedResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3494,8 +3481,7 @@ func (c *ProjectsLocationsInsightsWriteInsightCall) Header() http.Header { func (c *ProjectsLocationsInsightsWriteInsightCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writeinsightrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.writeinsightrequest) if err != nil { return nil, err } @@ -3604,8 +3590,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -3706,12 +3691,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3815,12 +3799,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3943,12 +3926,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4103,12 +4085,11 @@ func (c *ProjectsLocationsRulesListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/workspaceevents/v1/workspaceevents-gen.go b/workspaceevents/v1/workspaceevents-gen.go index 560dac98edb..f728d30b828 100644 --- a/workspaceevents/v1/workspaceevents-gen.go +++ b/workspaceevents/v1/workspaceevents-gen.go @@ -185,7 +185,9 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Operations = NewOperationsService(s) + s.Subscriptions = NewSubscriptionsService(s) if err != nil { return nil, err } @@ -204,10 +206,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Operations = NewOperationsService(s) - s.Subscriptions = NewSubscriptionsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -598,12 +597,11 @@ func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -701,8 +699,7 @@ func (c *SubscriptionsCreateCall) Header() http.Header { func (c *SubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -824,12 +821,11 @@ func (c *SubscriptionsDeleteCall) Header() http.Header { func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -935,12 +931,11 @@ func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1081,12 +1076,11 @@ func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1220,8 +1214,7 @@ func (c *SubscriptionsPatchCall) Header() http.Header { func (c *SubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -1329,8 +1322,7 @@ func (c *SubscriptionsReactivateCall) Header() http.Header { func (c *SubscriptionsReactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reactivatesubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.reactivatesubscriptionrequest) if err != nil { return nil, err } diff --git a/workstations/v1/workstations-gen.go b/workstations/v1/workstations-gen.go index 085e85ce64e..bc8c78901f7 100644 --- a/workstations/v1/workstations-gen.go +++ b/workstations/v1/workstations-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2091,12 +2090,11 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2222,12 +2220,11 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2349,8 +2346,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -2452,12 +2448,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2562,12 +2557,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2690,12 +2684,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2823,8 +2816,7 @@ func (c *ProjectsLocationsWorkstationClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkstationClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationcluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationcluster) if err != nil { return nil, err } @@ -2946,12 +2938,11 @@ func (c *ProjectsLocationsWorkstationClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsWorkstationClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3053,12 +3044,11 @@ func (c *ProjectsLocationsWorkstationClustersGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3175,12 +3165,11 @@ func (c *ProjectsLocationsWorkstationClustersListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workstationClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3316,8 +3305,7 @@ func (c *ProjectsLocationsWorkstationClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsWorkstationClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationcluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationcluster) if err != nil { return nil, err } @@ -3431,8 +3419,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsCreateCall) Heade func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationconfig) if err != nil { return nil, err } @@ -3553,12 +3540,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsDeleteCall) Heade func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3660,12 +3646,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3788,12 +3773,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsGetIamPolicyCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3909,12 +3893,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workstationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4053,12 +4036,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsListUsableCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workstationConfigs:listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4194,8 +4176,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsPatchCall) Header func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationconfig) if err != nil { return nil, err } @@ -4299,8 +4280,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsSetIamPolicyCall) func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4407,8 +4387,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsTestIamPermission func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4523,8 +4502,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsCreat func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstation) if err != nil { return nil, err } @@ -4637,12 +4615,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsDelet func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4737,8 +4714,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGener func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateaccesstokenrequest) if err != nil { return nil, err } @@ -4849,12 +4825,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGetCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4976,12 +4951,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGetIa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5098,12 +5072,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsListC if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workstations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5243,12 +5216,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsListU if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workstations:listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5384,8 +5356,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsPatch func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstation) if err != nil { return nil, err } @@ -5489,8 +5460,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsSetIa func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5590,8 +5560,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStart func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startworkstationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startworkstationrequest) if err != nil { return nil, err } @@ -5691,8 +5660,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStopC func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopworkstationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopworkstationrequest) if err != nil { return nil, err } @@ -5799,8 +5767,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsTestI func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/workstations/v1beta/workstations-gen.go b/workstations/v1beta/workstations-gen.go index 617ff1df01e..fb1f6ac3bcc 100644 --- a/workstations/v1beta/workstations-gen.go +++ b/workstations/v1beta/workstations-gen.go @@ -115,7 +115,8 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) if err != nil { return nil, err } @@ -134,9 +135,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -2101,8 +2100,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) if err != nil { return nil, err } @@ -2204,12 +2202,11 @@ func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2314,12 +2311,11 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2442,12 +2438,11 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2575,8 +2570,7 @@ func (c *ProjectsLocationsWorkstationClustersCreateCall) Header() http.Header { func (c *ProjectsLocationsWorkstationClustersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationcluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationcluster) if err != nil { return nil, err } @@ -2698,12 +2692,11 @@ func (c *ProjectsLocationsWorkstationClustersDeleteCall) Header() http.Header { func (c *ProjectsLocationsWorkstationClustersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -2805,12 +2798,11 @@ func (c *ProjectsLocationsWorkstationClustersGetCall) doRequest(alt string) (*ht if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -2927,12 +2919,11 @@ func (c *ProjectsLocationsWorkstationClustersListCall) doRequest(alt string) (*h if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workstationClusters") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3068,8 +3059,7 @@ func (c *ProjectsLocationsWorkstationClustersPatchCall) Header() http.Header { func (c *ProjectsLocationsWorkstationClustersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationcluster) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationcluster) if err != nil { return nil, err } @@ -3183,8 +3173,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsCreateCall) Heade func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationconfig) if err != nil { return nil, err } @@ -3305,12 +3294,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsDeleteCall) Heade func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -3412,12 +3400,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsGetCall) doReques if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3540,12 +3527,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsGetIamPolicyCall) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3661,12 +3647,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsListCall) doReque if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workstationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3805,12 +3790,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsListUsableCall) d if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workstationConfigs:listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -3946,8 +3930,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsPatchCall) Header func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstationconfig) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstationconfig) if err != nil { return nil, err } @@ -4051,8 +4034,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsSetIamPolicyCall) func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -4159,8 +4141,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsTestIamPermission func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } @@ -4275,8 +4256,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsCreat func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstation) if err != nil { return nil, err } @@ -4389,12 +4369,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsDelet func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -4489,8 +4468,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGener func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateaccesstokenrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.generateaccesstokenrequest) if err != nil { return nil, err } @@ -4601,12 +4579,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGetCa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4728,12 +4705,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsGetIa if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4850,12 +4826,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsListC if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workstations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -4995,12 +4970,11 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsListU if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workstations:listUsable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -5136,8 +5110,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsPatch func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.workstation) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.workstation) if err != nil { return nil, err } @@ -5241,8 +5214,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsSetIa func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest) if err != nil { return nil, err } @@ -5342,8 +5314,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStart func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStartCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.startworkstationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.startworkstationrequest) if err != nil { return nil, err } @@ -5443,8 +5414,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStopC func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopworkstationrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.stopworkstationrequest) if err != nil { return nil, err } @@ -5551,8 +5521,7 @@ func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsTestI func (c *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest) if err != nil { return nil, err } diff --git a/youtube/v3/youtube-gen.go b/youtube/v3/youtube-gen.go index 725dafb36ac..2f389743eb2 100644 --- a/youtube/v3/youtube-gen.go +++ b/youtube/v3/youtube-gen.go @@ -146,25 +146,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } s := &Service{client: client, BasePath: basePath} s.AbuseReports = NewAbuseReportsService(s) s.Activities = NewActivitiesService(s) @@ -197,9 +178,27 @@ func New(client *http.Client) (*Service, error) { s.Videos = NewVideosService(s) s.Watermarks = NewWatermarksService(s) s.Youtube = NewYoutubeService(s) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } return s, nil } +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + return NewService(context.Background(), option.WithHTTPClient(client)) +} + type Service struct { client *http.Client BasePath string // API endpoint base URL @@ -8663,8 +8662,7 @@ func (c *AbuseReportsInsertCall) Header() http.Header { func (c *AbuseReportsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.abusereport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abusereport) if err != nil { return nil, err } @@ -8830,12 +8828,11 @@ func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/activities") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -8966,12 +8963,11 @@ func (c *CaptionsDeleteCall) Header() http.Header { func (c *CaptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -9084,12 +9080,11 @@ func (c *CaptionsDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions/{id}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9243,8 +9238,7 @@ func (c *CaptionsInsertCall) Header() http.Header { func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.caption) if err != nil { return nil, err } @@ -9255,14 +9249,10 @@ func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/captions") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -9412,12 +9402,11 @@ func (c *CaptionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -9577,8 +9566,7 @@ func (c *CaptionsUpdateCall) Header() http.Header { func (c *CaptionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.caption) if err != nil { return nil, err } @@ -9589,14 +9577,10 @@ func (c *CaptionsUpdateCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/captions") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, newBody) if err != nil { return nil, err } @@ -9783,8 +9767,7 @@ func (c *ChannelBannersInsertCall) Header() http.Header { func (c *ChannelBannersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelbannerresource) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelbannerresource) if err != nil { return nil, err } @@ -9795,14 +9778,10 @@ func (c *ChannelBannersInsertCall) doRequest(alt string) (*http.Response, error) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/channelBanners/insert") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -9923,12 +9902,11 @@ func (c *ChannelSectionsDeleteCall) Header() http.Header { func (c *ChannelSectionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelSections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -10034,8 +10012,7 @@ func (c *ChannelSectionsInsertCall) Header() http.Header { func (c *ChannelSectionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelsection) if err != nil { return nil, err } @@ -10192,12 +10169,11 @@ func (c *ChannelSectionsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelSections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10305,8 +10281,7 @@ func (c *ChannelSectionsUpdateCall) Header() http.Header { func (c *ChannelSectionsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelsection) if err != nil { return nil, err } @@ -10511,12 +10486,11 @@ func (c *ChannelsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -10647,8 +10621,7 @@ func (c *ChannelsUpdateCall) Header() http.Header { func (c *ChannelsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) if err != nil { return nil, err } @@ -10746,8 +10719,7 @@ func (c *CommentThreadsInsertCall) Header() http.Header { func (c *CommentThreadsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentthread) if err != nil { return nil, err } @@ -10953,12 +10925,11 @@ func (c *CommentThreadsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/commentThreads") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11066,12 +11037,11 @@ func (c *CommentsDeleteCall) Header() http.Header { func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -11138,8 +11108,7 @@ func (c *CommentsInsertCall) Header() http.Header { func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -11295,12 +11264,11 @@ func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11409,12 +11377,11 @@ func (c *CommentsMarkAsSpamCall) Header() http.Header { func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments/markAsSpam") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11491,12 +11458,11 @@ func (c *CommentsSetModerationStatusCall) Header() http.Header { func (c *CommentsSetModerationStatusCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments/setModerationStatus") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -11564,8 +11530,7 @@ func (c *CommentsUpdateCall) Header() http.Header { func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment) if err != nil { return nil, err } @@ -11678,12 +11643,11 @@ func (c *I18nLanguagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/i18nLanguages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11789,12 +11753,11 @@ func (c *I18nRegionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/i18nRegions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -11931,12 +11894,11 @@ func (c *LiveBroadcastsBindCall) Header() http.Header { func (c *LiveBroadcastsBindCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts/bind") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12060,12 +12022,11 @@ func (c *LiveBroadcastsDeleteCall) Header() http.Header { func (c *LiveBroadcastsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12172,8 +12133,7 @@ func (c *LiveBroadcastsInsertCall) Header() http.Header { func (c *LiveBroadcastsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livebroadcast) if err != nil { return nil, err } @@ -12320,8 +12280,7 @@ func (c *LiveBroadcastsInsertCuepointCall) Header() http.Header { func (c *LiveBroadcastsInsertCuepointCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cuepoint) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cuepoint) if err != nil { return nil, err } @@ -12527,12 +12486,11 @@ func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -12685,12 +12643,11 @@ func (c *LiveBroadcastsTransitionCall) Header() http.Header { func (c *LiveBroadcastsTransitionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts/transition") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -12828,8 +12785,7 @@ func (c *LiveBroadcastsUpdateCall) Header() http.Header { func (c *LiveBroadcastsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livebroadcast) if err != nil { return nil, err } @@ -12923,12 +12879,11 @@ func (c *LiveChatBansDeleteCall) Header() http.Header { func (c *LiveChatBansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/bans") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -12996,8 +12951,7 @@ func (c *LiveChatBansInsertCall) Header() http.Header { func (c *LiveChatBansInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatban) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livechatban) if err != nil { return nil, err } @@ -13091,12 +13045,11 @@ func (c *LiveChatMessagesDeleteCall) Header() http.Header { func (c *LiveChatMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13163,8 +13116,7 @@ func (c *LiveChatMessagesInsertCall) Header() http.Header { func (c *LiveChatMessagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmessage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livechatmessage) if err != nil { return nil, err } @@ -13306,12 +13258,11 @@ func (c *LiveChatMessagesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13435,12 +13386,11 @@ func (c *LiveChatMessagesTransitionCall) Header() http.Header { func (c *LiveChatMessagesTransitionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages/transition") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -13527,12 +13477,11 @@ func (c *LiveChatModeratorsDeleteCall) Header() http.Header { func (c *LiveChatModeratorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/moderators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13600,8 +13549,7 @@ func (c *LiveChatModeratorsInsertCall) Header() http.Header { func (c *LiveChatModeratorsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmoderator) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livechatmoderator) if err != nil { return nil, err } @@ -13729,12 +13677,11 @@ func (c *LiveChatModeratorsListCall) doRequest(alt string) (*http.Response, erro if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/moderators") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -13880,12 +13827,11 @@ func (c *LiveStreamsDeleteCall) Header() http.Header { func (c *LiveStreamsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveStreams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -13992,8 +13938,7 @@ func (c *LiveStreamsInsertCall) Header() http.Header { func (c *LiveStreamsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livestream) if err != nil { return nil, err } @@ -14170,12 +14115,11 @@ func (c *LiveStreamsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveStreams") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14330,8 +14274,7 @@ func (c *LiveStreamsUpdateCall) Header() http.Header { func (c *LiveStreamsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livestream) if err != nil { return nil, err } @@ -14489,12 +14432,11 @@ func (c *MembersListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/members") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14616,12 +14558,11 @@ func (c *MembershipsLevelsListCall) doRequest(alt string) (*http.Response, error if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/membershipsLevels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -14728,12 +14669,11 @@ func (c *PlaylistImagesDeleteCall) Header() http.Header { func (c *PlaylistImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -14879,8 +14819,7 @@ func (c *PlaylistImagesInsertCall) Header() http.Header { func (c *PlaylistImagesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistimage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistimage) if err != nil { return nil, err } @@ -14891,14 +14830,10 @@ func (c *PlaylistImagesInsertCall) doRequest(alt string) (*http.Response, error) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/playlistImages") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -15083,12 +15018,11 @@ func (c *PlaylistImagesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistImages") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15257,8 +15191,7 @@ func (c *PlaylistImagesUpdateCall) Header() http.Header { func (c *PlaylistImagesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistimage) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistimage) if err != nil { return nil, err } @@ -15269,14 +15202,10 @@ func (c *PlaylistImagesUpdateCall) doRequest(alt string) (*http.Response, error) urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/playlistImages") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PUT", urls, newBody) if err != nil { return nil, err } @@ -15396,12 +15325,11 @@ func (c *PlaylistItemsDeleteCall) Header() http.Header { func (c *PlaylistItemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -15484,8 +15412,7 @@ func (c *PlaylistItemsInsertCall) Header() http.Header { func (c *PlaylistItemsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistitem) if err != nil { return nil, err } @@ -15651,12 +15578,11 @@ func (c *PlaylistItemsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -15794,8 +15720,7 @@ func (c *PlaylistItemsUpdateCall) Header() http.Header { func (c *PlaylistItemsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistitem) if err != nil { return nil, err } @@ -15905,12 +15830,11 @@ func (c *PlaylistsDeleteCall) Header() http.Header { func (c *PlaylistsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16015,8 +15939,7 @@ func (c *PlaylistsInsertCall) Header() http.Header { func (c *PlaylistsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlist) if err != nil { return nil, err } @@ -16210,12 +16133,11 @@ func (c *PlaylistsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlists") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16349,8 +16271,7 @@ func (c *PlaylistsUpdateCall) Header() http.Header { func (c *PlaylistsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlist) if err != nil { return nil, err } @@ -16799,12 +16720,11 @@ func (c *SearchListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -16912,12 +16832,11 @@ func (c *SubscriptionsDeleteCall) Header() http.Header { func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -16984,8 +16903,7 @@ func (c *SubscriptionsInsertCall) Header() http.Header { func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription) if err != nil { return nil, err } @@ -17208,12 +17126,11 @@ func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17359,12 +17276,11 @@ func (c *SuperChatEventsListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/superChatEvents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17480,8 +17396,7 @@ func (c *TestsInsertCall) Header() http.Header { func (c *TestsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testitem) if err != nil { return nil, err } @@ -17591,12 +17506,11 @@ func (c *ThirdPartyLinksDeleteCall) Header() http.Header { func (c *ThirdPartyLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thirdPartyLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -17670,8 +17584,7 @@ func (c *ThirdPartyLinksInsertCall) Header() http.Header { func (c *ThirdPartyLinksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.thirdpartylink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.thirdpartylink) if err != nil { return nil, err } @@ -17808,12 +17721,11 @@ func (c *ThirdPartyLinksListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thirdPartyLinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -17911,8 +17823,7 @@ func (c *ThirdPartyLinksUpdateCall) Header() http.Header { func (c *ThirdPartyLinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.thirdpartylink) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.thirdpartylink) if err != nil { return nil, err } @@ -18063,8 +17974,7 @@ func (c *ThumbnailsSetCall) Header() http.Header { } func (c *ThumbnailsSetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thumbnails/set") @@ -18072,14 +17982,10 @@ func (c *ThumbnailsSetCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/thumbnails/set") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -18203,12 +18109,11 @@ func (c *VideoAbuseReportReasonsListCall) doRequest(alt string) (*http.Response, if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videoAbuseReportReasons") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18327,12 +18232,11 @@ func (c *VideoCategoriesListCall) doRequest(alt string) (*http.Response, error) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videoCategories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18435,12 +18339,11 @@ func (c *VideosDeleteCall) Header() http.Header { func (c *VideosDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -18532,12 +18435,11 @@ func (c *VideosGetRatingCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos/getRating") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -18732,8 +18634,7 @@ func (c *VideosInsertCall) Header() http.Header { func (c *VideosInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.video) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.video) if err != nil { return nil, err } @@ -18744,14 +18645,10 @@ func (c *VideosInsertCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/videos") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -18988,12 +18885,11 @@ func (c *VideosListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -19104,12 +19000,11 @@ func (c *VideosRateCall) Header() http.Header { func (c *VideosRateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos/rate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19187,8 +19082,7 @@ func (c *VideosReportAbuseCall) Header() http.Header { func (c *VideosReportAbuseCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.videoabusereport) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.videoabusereport) if err != nil { return nil, err } @@ -19293,8 +19187,7 @@ func (c *VideosUpdateCall) Header() http.Header { func (c *VideosUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.video) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.video) if err != nil { return nil, err } @@ -19445,8 +19338,7 @@ func (c *WatermarksSetCall) Header() http.Header { func (c *WatermarksSetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.invideobranding) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.invideobranding) if err != nil { return nil, err } @@ -19457,14 +19349,10 @@ func (c *WatermarksSetCall) doRequest(alt string) (*http.Response, error) { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/watermarks/set") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, newBody) if err != nil { return nil, err } @@ -19561,12 +19449,11 @@ func (c *WatermarksUnsetCall) Header() http.Header { func (c *WatermarksUnsetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/watermarks/unset") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("POST", urls, nil) if err != nil { return nil, err } @@ -19638,8 +19525,7 @@ func (c *YoutubeV3UpdateCommentThreadsCall) Header() http.Header { func (c *YoutubeV3UpdateCommentThreadsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentthread) if err != nil { return nil, err } diff --git a/youtubeanalytics/v2/youtubeanalytics-gen.go b/youtubeanalytics/v2/youtubeanalytics-gen.go index 6ba4195dcf2..606a954ad56 100644 --- a/youtubeanalytics/v2/youtubeanalytics-gen.go +++ b/youtubeanalytics/v2/youtubeanalytics-gen.go @@ -136,7 +136,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.GroupItems = NewGroupItemsService(s) + s.Groups = NewGroupsService(s) + s.Reports = NewReportsService(s) if err != nil { return nil, err } @@ -155,11 +158,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.GroupItems = NewGroupItemsService(s) - s.Groups = NewGroupsService(s) - s.Reports = NewReportsService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -688,12 +687,11 @@ func (c *GroupItemsDeleteCall) Header() http.Header { func (c *GroupItemsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/groupItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -794,8 +792,7 @@ func (c *GroupItemsInsertCall) Header() http.Header { func (c *GroupItemsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupitem) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.groupitem) if err != nil { return nil, err } @@ -923,12 +920,11 @@ func (c *GroupItemsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/groupItems") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1035,12 +1031,11 @@ func (c *GroupsDeleteCall) Header() http.Header { func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1141,8 +1136,7 @@ func (c *GroupsInsertCall) Header() http.Header { func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -1291,12 +1285,11 @@ func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/groups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1419,8 +1412,7 @@ func (c *GroupsUpdateCall) Header() http.Header { func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.group) if err != nil { return nil, err } @@ -1631,12 +1623,11 @@ func (c *ReportsQueryCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } diff --git a/youtubereporting/v1/youtubereporting-gen.go b/youtubereporting/v1/youtubereporting-gen.go index 87209d35189..25e14d010f4 100644 --- a/youtubereporting/v1/youtubereporting-gen.go +++ b/youtubereporting/v1/youtubereporting-gen.go @@ -124,7 +124,10 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err if err != nil { return nil, err } - s, err := New(client) + s := &Service{client: client, BasePath: basePath} + s.Jobs = NewJobsService(s) + s.Media = NewMediaService(s) + s.ReportTypes = NewReportTypesService(s) if err != nil { return nil, err } @@ -143,11 +146,7 @@ func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } - s := &Service{client: client, BasePath: basePath} - s.Jobs = NewJobsService(s) - s.Media = NewMediaService(s) - s.ReportTypes = NewReportTypesService(s) - return s, nil + return NewService(context.Background(), option.WithHTTPClient(client)) } type Service struct { @@ -846,8 +845,7 @@ func (c *JobsCreateCall) Header() http.Header { func (c *JobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) if err != nil { return nil, err } @@ -950,12 +948,11 @@ func (c *JobsDeleteCall) Header() http.Header { func (c *JobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("DELETE", urls, nil) if err != nil { return nil, err } @@ -1065,12 +1062,11 @@ func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1202,12 +1198,11 @@ func (c *JobsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1339,12 +1334,11 @@ func (c *JobsReportsGetCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}/reports/{reportId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1496,12 +1490,11 @@ func (c *JobsReportsListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}/reports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1626,12 +1619,11 @@ func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/media/{+resourceName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err } @@ -1779,12 +1771,11 @@ func (c *ReportTypesListCall) doRequest(alt string) (*http.Response, error) { if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/reportTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("GET", urls, nil) if err != nil { return nil, err }